From 0f77c1a885f85a1f45da12058e6372a6bb3e621f Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 20 Oct 2009 11:44:43 +0000 Subject: [PATCH] GSdx: Possible fix for DX10 leaking memory. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2042 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSDevice10.cpp | 11 ++++++++--- plugins/GSdx/GSRendererDX10.h | 1 + plugins/GSdx/GSRendererDX11.h | 1 + plugins/GSdx/GSRendererDX9.h | 1 + plugins/GSdx/GSRendererNull.h | 2 ++ plugins/GSdx/GSRendererOGL.h | 1 + 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSDevice10.cpp b/plugins/GSdx/GSDevice10.cpp index 0fbc1c4f89..d6f5c2cb6d 100644 --- a/plugins/GSdx/GSDevice10.cpp +++ b/plugins/GSdx/GSDevice10.cpp @@ -68,9 +68,14 @@ bool GSDevice10::Create(GSWnd* wnd, bool vsync) scd.SampleDesc.Quality = 0; scd.Windowed = TRUE; - //Crashes when 2 threads work on the swapchain, as in pcsx2/wx. - //Todo : Figure out a way to have this flag anyway - uint32 flags = 0; //D3D10_CREATE_DEVICE_SINGLETHREADED; + // Crashes when 2 threads work on the swapchain, as in pcsx2/wx when it provides us + // an external window handle (which could be attached to any thread other than the GS one). + // (but if we're managing our own window then it's safe to enable) + + // FIXME : Figure out a way to have this flag anyway, since it's a measurable speedup (may + // not be possible though). + + uint32 flags = m_wnd->IsManaged() ? D3D10_CREATE_DEVICE_SINGLETHREADED : 0; #ifdef DEBUG flags |= D3D10_CREATE_DEVICE_DEBUG; diff --git a/plugins/GSdx/GSRendererDX10.h b/plugins/GSdx/GSRendererDX10.h index 17b51589b2..c3899a1792 100644 --- a/plugins/GSdx/GSRendererDX10.h +++ b/plugins/GSdx/GSRendererDX10.h @@ -39,6 +39,7 @@ protected: public: GSRendererDX10(); + virtual ~GSRendererDX10() {} bool CreateDevice(GSDevice* dev); diff --git a/plugins/GSdx/GSRendererDX11.h b/plugins/GSdx/GSRendererDX11.h index 35411f90b8..f1e5290891 100644 --- a/plugins/GSdx/GSRendererDX11.h +++ b/plugins/GSdx/GSRendererDX11.h @@ -40,6 +40,7 @@ protected: public: GSRendererDX11(); + virtual ~GSRendererDX11() {} bool CreateDevice(GSDevice* dev); diff --git a/plugins/GSdx/GSRendererDX9.h b/plugins/GSdx/GSRendererDX9.h index 1772830694..a94575a028 100644 --- a/plugins/GSdx/GSRendererDX9.h +++ b/plugins/GSdx/GSRendererDX9.h @@ -46,6 +46,7 @@ protected: public: GSRendererDX9(); + virtual ~GSRendererDX9() {} bool CreateDevice(GSDevice* dev); diff --git a/plugins/GSdx/GSRendererNull.h b/plugins/GSdx/GSRendererNull.h index b1c5b60b14..112e3bf626 100644 --- a/plugins/GSdx/GSRendererNull.h +++ b/plugins/GSdx/GSRendererNull.h @@ -43,6 +43,8 @@ public: InitVertexKick(); } + virtual ~GSRendererNull() {} + template void VertexKick(bool skip) { } diff --git a/plugins/GSdx/GSRendererOGL.h b/plugins/GSdx/GSRendererOGL.h index e9accf1a87..4a6bc9e448 100644 --- a/plugins/GSdx/GSRendererOGL.h +++ b/plugins/GSdx/GSRendererOGL.h @@ -32,6 +32,7 @@ protected: public: GSRendererOGL(); + virtual ~GSRendererOGL() {} bool CreateDevice(GSDevice* dev);