[4/5] wined3d: Remove the sharing of mapping code for fixed function and pixel shader samplers

H. Verbeet hverbeet at gmail.com
Fri Jun 22 13:43:38 CDT 2007


The mapping code for fixed function and pixel shader samplers should
be completely separate after this patch. Additionally, this part of
the code will diverge slightly from the corresponding code for pixel
shaders in a later patch (not in this set either).

Changelog:
  - Remove the sharing of mapping code for fixed function and pixel
shader samplers
-------------- next part --------------
---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index ebad26f..c81b5b8 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3244,6 +3244,19 @@ static void device_map_fixed_function_samplers(IWineD3DDeviceImpl *This) {
 
     device_update_fixed_function_usage_map(This);
 
+    if (This->stateBlock->lowest_disabled_stage <= GL_LIMITS(textures)) {
+        for (i = 0; i < MAX_SAMPLERS; ++i) {
+            if (This->texUnitMap[i] != i) {
+                device_map_stage(This, i, i);
+                IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(i));
+                if (i < MAX_TEXTURES) {
+                    markTextureStagesDirty(This, i);
+                }
+            }
+        }
+        return;
+    }
+
     /* No pixel shader, and we do not have enough texture units available. Try to skip NULL textures
      * First, see if we can succeed at all
      */
@@ -3296,7 +3309,7 @@ void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This) {
      * -> Whith a 1:1 mapping oneToOneTexUnitMap is set to avoid checking MAX_SAMPLERS array
      * entries to make pixel shaders cheaper. MAX_SAMPLERS will be 128 in dx10
      */
-    if(This->stateBlock->pixelShader || This->stateBlock->lowest_disabled_stage <= GL_LIMITS(textures)) {
+    if (This->stateBlock->pixelShader) {
         if(This->oneToOneTexUnitMap) {
             TRACE("Not touching 1:1 map\n");
             return;


More information about the wine-patches mailing list