[44/47] WineD3D: Move SRGBWRITEENABLE to the state table

Stefan Dösinger stefan at codeweavers.com
Sun Dec 10 16:13:38 CST 2006


This state would affect the pixel shader by adding a line to do gamma scaling 
before writing the final result. This patch adds an ERR if it is enabled 
because this state causes noticeably broken colors.
-------------- next part --------------
From 89d6f56eca0571f6cec22053039e30dea0390888 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Sun, 10 Dec 2006 23:08:54 +0100
Subject: [PATCH] WineD3D: Move SRGBWRITEENABLE to the state table

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f453569..c789164 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3437,6 +3437,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     case WINED3DRS_ADAPTIVETESS_Z :
     case WINED3DRS_ADAPTIVETESS_W :
     case WINED3DRS_ENABLEADAPTIVETESSELLATION:
+    case WINED3DRS_SRGBWRITEENABLE           :
         StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
         break;
 
@@ -3447,13 +3448,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl
         return WINED3DERR_INVALIDCALL;
       }
 
-    case WINED3DRS_SRGBWRITEENABLE           :
-    {
-        if(Value)
-            ERR("(%p)->(%s,%d) not yet implemented\n", This, debug_d3drenderstate(State), Value);
-        break;
-    }
-
     case WINED3DRS_SEPARATEALPHABLENDENABLE  :
     {
         if(Value)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 6a3ea9c..1844482 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1208,6 +1208,12 @@ static void state_tessellation(DWORD sta
         FIXME("(WINED3DRS_ENABLEADAPTIVETESSELLATION,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_ENABLEADAPTIVETESSELLATION]);
 }
 
+
+static void state_srgbwrite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+    if(stateblock->renderState[WINED3DRS_SRGBWRITEENABLE])
+        ERR("Render state WINED3DRS_SRGBWRITEENABLE not yet implemented\n");
+}
+
 const struct StateEntry StateTable[] =
 {
       /* State name                                         representative,                                     apply function */
@@ -1409,7 +1415,7 @@ const struct StateEntry StateTable[] =
     { /*191, WINED3DRS_COLORWRITEENABLE2            */      STATE_RENDER(WINED3DRS_COLORWRITEENABLE),           state_colorwrite    },
     { /*192, WINED3DRS_COLORWRITEENABLE3            */      STATE_RENDER(WINED3DRS_COLORWRITEENABLE),           state_colorwrite    },
     { /*193, WINED3DRS_BLENDFACTOR                  */      STATE_RENDER(WINED3DRS_ALPHABLENDENABLE),           state_blend         },
-    { /*194, WINED3DRS_SRGBWRITEENABLE              */      0,                                                  state_nogl          },
+    { /*194, WINED3DRS_SRGBWRITEENABLE              */      STATE_RENDER(WINED3DRS_SRGBWRITEENABLE),            state_srgbwrite     },
     { /*195, WINED3DRS_DEPTHBIAS                    */      STATE_RENDER(WINED3DRS_DEPTHBIAS),                  state_depthbias     },
     { /*196, undefined                              */      0,                                                  state_undefined     },
     { /*197, undefined                              */      0,                                                  state_undefined     },
-- 
1.4.2.4



More information about the wine-patches mailing list