summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-09-21 11:38:00 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-09-21 11:38:00 +0100
commiteec77bb853ebf72283ff0dcf3dfbf0483ddd0a6b (patch)
tree956c57fae0a7fddcc2e5a822eaf3e2d8e7399a0a
parentb024c85d2487d2dc48b0713cc980b2011d92d110 (diff)
d3dstate: Don't mistake FVF codes for VS handles.
Avoids errors when dumping.
-rw-r--r--retrace/d3d8state.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/retrace/d3d8state.cpp b/retrace/d3d8state.cpp
index 77be00b5..e4112ad2 100644
--- a/retrace/d3d8state.cpp
+++ b/retrace/d3d8state.cpp
@@ -44,7 +44,12 @@ typedef HRESULT (STDMETHODCALLTYPE IDirect3DDevice8::*GetShaderFunctionMethod)(D
struct VertexShaderGetter
{
HRESULT GetShader(IDirect3DDevice8 *pDevice, DWORD *pHandle) {
- return pDevice->GetVertexShader(pHandle);
+ HRESULT hr = pDevice->GetVertexShader(pHandle);
+ if (SUCCEEDED(hr) && (*pHandle & 1) == 0) {
+ // Handle is a FVF code.
+ *pHandle = 0;
+ }
+ return hr;
}
HRESULT GetShaderFunction(IDirect3DDevice8 *pDevice, DWORD Handle, void* pData, DWORD* pSizeOfData) {
return pDevice->GetVertexShaderFunction(Handle, pData, pSizeOfData);