summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2011-10-08 15:23:00 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2011-10-08 15:29:04 -0700
commitad508ab8fb34cd80db45814619fbde2546df7e7d (patch)
tree5167ea5167117126bad96e395b7cda935d39ff73
parent59072adc32bf779dee4879a456fcb2bdc71036fc (diff)
Let's go ahead and throw this in here, should bring support of Intel IGP back in with DX9.... I can't actually test this for an obvious reason, but I figure while Windows is broken anyway, go ahead with it.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7707 8ced0084-cf51-0410-be5f-012b33b47a6e That should fix the seg faults on IGP chipsets. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7715 8ced0084-cf51-0410-be5f-012b33b47a6e Compile fix. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7716 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp19
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h1
2 files changed, 15 insertions, 5 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp
index de610eab39..ff3f68a6cd 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp
@@ -28,7 +28,8 @@ D3DXCOMPILESHADERTYPE PD3DXCompileShader = NULL;
namespace DX9
{
-
+static char vsVersions[5][7] = {"ERROR", "vs_1_4", "vs_2_a", "vs_3_0", "vs_4_0"};
+static char psVersions[5][7] = {"ERROR", "ps_1_4", "ps_2_a", "ps_3_0", "ps_4_0"};
// D3DX
HINSTANCE hD3DXDll = NULL;
int d3dx_dll_ref = 0;
@@ -55,6 +56,7 @@ static bool auto_depth_stencil = false;
#define VENDOR_NVIDIA 4318
#define VENDOR_ATI 4098
+#define VENDOR_INTEL 32902
bool bFrameInProgress = false;
@@ -112,6 +114,10 @@ bool IsATIDevice()
{
return GetCurAdapter().ident.VendorId == VENDOR_ATI;
}
+bool IsIntelDevice()
+{
+ return GetCurAdapter().ident.VendorId == VENDOR_INTEL;
+}
HRESULT Init()
@@ -139,6 +145,11 @@ HRESULT Init()
int adapter = g_Config.iAdapter;
D3D->GetDeviceCaps((adapter >= 0 && adapter < std::min(MAX_ADAPTERS, numAdapters)) ? adapter : D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps);
Enumerate();
+ if(IsIntelDevice()){
+ // Murder the a because Intel doesn't support 2.0a because the 'a' part was a ATI and Nvidia war going on
+ psVersions[2][5] = '0';
+ vsVersions[2][5] = '0';
+ }
return S_OK;
}
@@ -522,16 +533,14 @@ D3DFORMAT GetSupportedDepthSurfaceFormat(D3DFORMAT target_format)
const char *VertexShaderVersionString()
{
- static const char *versions[5] = {"ERROR", "vs_1_4", "vs_2_a", "vs_3_0", "vs_4_0"};
int version = ((D3D::caps.VertexShaderVersion >> 8) & 0xFF);
- return versions[std::min(4, version)];
+ return vsVersions[std::min(4, version)];
}
const char *PixelShaderVersionString()
{
- static const char *versions[5] = {"ERROR", "ps_1_4", "ps_2_a", "ps_3_0", "ps_4_0"};
int version = ((D3D::caps.PixelShaderVersion >> 8) & 0xFF);
- return versions[std::min(4, version)];
+ return psVersions[std::min(4, version)];
}
LPDIRECT3DSURFACE9 GetBackBufferSurface()
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h
index f4a5244dbe..d1e7eeaa91 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h
+++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.h
@@ -47,6 +47,7 @@ namespace D3D
#define FOURCC_NULL ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')))
bool IsATIDevice();
+bool IsIntelDevice();
HRESULT Init();
HRESULT Create(int adapter, HWND wnd, int resolution, int aa_mode, bool auto_depth);
void Close();