From b7c9aa63cd68d51ddf3a596bf0fb5e24accb3987 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sat, 5 Jun 2010 04:06:24 +0000 Subject: [PATCH] GSdx: Fix an unfriendly crash when trying to create a device on a machine that only supports DX9 when DX10/11 is configured (Think temporary downgrading your video card, and then running PCSX2). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3161 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GS.cpp | 4 ++++ plugins/GSdx/GSRenderer.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 8cfe2b5332..c3d2765396 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -232,6 +232,10 @@ static INT32 _GSopen(void* dsp, char* title, int renderer) if( !s_gs->CreateDevice(dev) ) { + // This probably means the user has DX11 configured with a video card that is only DX9 + // compliant. Cound mean drivr issues of some sort also, but to be sure, that's the most + // common cause of device creation errors. :) --air + GSclose(); return -1; } diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index bd2239651d..4b362e96e0 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -81,7 +81,7 @@ public: { InvalidateTextureCache(); ResetPrim(); - m_dev->Reset(1, 1); + if( m_dev ) m_dev->Reset(1, 1); } virtual void VSync(int field); virtual bool MakeSnapshot(const string& path);