[WINED3D] Resend, Bugfix: Read shader constants from correct stateblock

Ivan Gyurdiev ivg231 at gmail.com
Thu Jul 20 22:02:29 CDT 2006


Get() requests must always read from the current stateblock.
Set() requests must always write to the update stateblock.

Uncovered by stateblock test patch.
-------------- next part --------------
---

 dlls/wined3d/device.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

650c63645faf8c890d68f8a596a12642962c200e
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0a0e4e6..2956a15 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4650,7 +4650,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->vertexShaderConstantB[start], cnt * sizeof(BOOL));
+    memcpy(dstData, &This->stateBlock->vertexShaderConstantB[start], cnt * sizeof(BOOL));
     return WINED3D_OK;
 }
 
@@ -4697,7 +4697,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->vertexShaderConstantI[start * 4], cnt * sizeof(int) * 4);
+    memcpy(dstData, &This->stateBlock->vertexShaderConstantI[start * 4], cnt * sizeof(int) * 4);
     return WINED3D_OK;
 }
 
@@ -4744,7 +4744,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->vertexShaderConstantF[start * 4], cnt * sizeof(float) * 4);
+    memcpy(dstData, &This->stateBlock->vertexShaderConstantF[start * 4], cnt * sizeof(float) * 4);
     return WINED3D_OK;
 }
 
@@ -4832,7 +4832,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->pixelShaderConstantB[start], cnt * sizeof(BOOL));
+    memcpy(dstData, &This->stateBlock->pixelShaderConstantB[start], cnt * sizeof(BOOL));
     return WINED3D_OK;
 }
 
@@ -4879,7 +4879,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->pixelShaderConstantI[start * 4], cnt * sizeof(int) * 4);
+    memcpy(dstData, &This->stateBlock->pixelShaderConstantI[start * 4], cnt * sizeof(int) * 4);
     return WINED3D_OK;
 }
 
@@ -4926,7 +4926,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     if (dstData == NULL || cnt < 0)
         return WINED3DERR_INVALIDCALL;
 
-    memcpy(dstData, &This->updateStateBlock->pixelShaderConstantF[start * 4], cnt * sizeof(float) * 4);
+    memcpy(dstData, &This->stateBlock->pixelShaderConstantF[start * 4], cnt * sizeof(float) * 4);
     return WINED3D_OK;
 }
 
-- 
1.3.3



More information about the wine-patches mailing list