H. Verbeet : wined3d: In device_map_psamplers(), only touch the sampler mapping for samplers that are used by the shader.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 29 08:14:51 CDT 2007


Module: wine
Branch: master
Commit: 92fc808b05df5df49d85698ad0b5fd871cc5c048
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=92fc808b05df5df49d85698ad0b5fd871cc5c048

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Thu Jun 28 23:32:53 2007 +0200

wined3d: In device_map_psamplers(), only touch the sampler mapping for samplers that are used by the shader.

---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 5d3a7ce..947038a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3291,10 +3291,11 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
 }
 
 static void device_map_psamplers(IWineD3DDeviceImpl *This) {
+    DWORD *sampler_tokens = ((IWineD3DPixelShaderImpl *)This->stateBlock->pixelShader)->baseShader.reg_maps.samplers;
     int i;
 
     for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) {
-        if (This->texUnitMap[i] != i) {
+        if (sampler_tokens[i] && This->texUnitMap[i] != i) {
             device_map_stage(This, i, i);
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(i));
             if (i < MAX_TEXTURES) {




More information about the wine-cvs mailing list