From 7fe68a6e1e3568a2ab1e6a3abdc116fc894125db Mon Sep 17 00:00:00 2001 From: narzoul Date: Mon, 31 Dec 2018 18:04:05 +0100 Subject: [PATCH] Reverting commit 6a225516 due to possible BSOD on AMD drivers --- DDrawCompat/Config/Config.h | 1 - DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp | 32 ------------------- DDrawCompat/DDraw/Surfaces/PrimarySurface.h | 6 ---- 3 files changed, 39 deletions(-) diff --git a/DDrawCompat/Config/Config.h b/DDrawCompat/Config/Config.h index a5fc504..f0f9f94 100644 --- a/DDrawCompat/Config/Config.h +++ b/DDrawCompat/Config/Config.h @@ -7,5 +7,4 @@ namespace Config const int delayedFlipModeTimeout = 200; const int maxPaletteUpdatesPerMs = 5; const int minExpectedFlipsPerSec = 5; - const DWORD primarySurfaceExtraRows = 2; } diff --git a/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp b/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp index 2223416..d549cec 100644 --- a/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp +++ b/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp @@ -37,7 +37,6 @@ namespace DDraw g_primarySurface = nullptr; g_origCaps = 0; s_palette = nullptr; - s_surfaceBuffers.clear(); ZeroMemory(&s_paletteEntries, sizeof(s_paletteEntries)); ZeroMemory(&g_primarySurfaceDesc, sizeof(g_primarySurfaceDesc)); @@ -197,40 +196,10 @@ namespace DDraw g_primarySurfaceDesc.dwSize = sizeof(g_primarySurfaceDesc); g_primarySurface->GetSurfaceDesc(g_primarySurface, &g_primarySurfaceDesc); - if (g_primarySurfaceDesc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) - { - resizeBuffers(); - } - g_gdiResourceHandle = getResourceHandle(*g_primarySurface); D3dDdi::Device::setGdiResourceHandle(*reinterpret_cast(g_gdiResourceHandle)); } - void PrimarySurface::resizeBuffers() - { - DDSCAPS2 flipCaps = {}; - flipCaps.dwCaps = DDSCAPS_FLIP; - - DDSURFACEDESC2 desc = {}; - desc.dwSize = sizeof(desc); - desc.dwFlags = DDSD_LPSURFACE; - - const DWORD newBufferSize = g_primarySurfaceDesc.lPitch * - (g_primarySurfaceDesc.dwHeight + Config::primarySurfaceExtraRows); - - auto surfacePtr(CompatPtr::from(g_primarySurface.get())); - do - { - s_surfaceBuffers.push_back(std::vector(newBufferSize)); - desc.lpSurface = s_surfaceBuffers.back().data(); - surfacePtr->SetSurfaceDesc(surfacePtr, &desc, 0); - - CompatPtr nextSurface; - surfacePtr->GetAttachedSurface(surfacePtr, &flipCaps, &nextSurface.getRef()); - surfacePtr.swap(nextSurface); - } while (surfacePtr && surfacePtr != g_primarySurface.get()); - } - void PrimarySurface::updatePalette() { if (s_palette) @@ -242,5 +211,4 @@ namespace DDraw CompatWeakPtr PrimarySurface::s_palette; PALETTEENTRY PrimarySurface::s_paletteEntries[256] = {}; - std::vector> PrimarySurface::s_surfaceBuffers; } diff --git a/DDrawCompat/DDraw/Surfaces/PrimarySurface.h b/DDrawCompat/DDraw/Surfaces/PrimarySurface.h index e0f5802..3c104c6 100644 --- a/DDrawCompat/DDraw/Surfaces/PrimarySurface.h +++ b/DDrawCompat/DDraw/Surfaces/PrimarySurface.h @@ -1,7 +1,5 @@ #pragma once -#include - #include #include "Common/CompatPtr.h" @@ -39,10 +37,6 @@ namespace DDraw virtual void createImpl() override; - static void resizeBuffers(); - std::unique_ptr m_surface; - - static std::vector> s_surfaceBuffers; }; }