[PATCH 3/4] wined3d: Standalone surfaces should never be sRGB.

Henri Verbeet hverbeet at codeweavers.com
Wed Mar 2 01:55:48 CST 2011


---
 dlls/wined3d/surface.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b0f9dc6..0897467 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -707,24 +707,25 @@ void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb)
     }
     else
     {
-        GLuint *name = srgb ? &surface->texture_name_srgb : &surface->texture_name;
-
         if (surface->texture_level)
         {
             ERR("Standalone surface %p is non-zero texture level %u.\n",
                     surface, surface->texture_level);
         }
 
+        if (srgb)
+            ERR("Trying to bind standalone surface %p as sRGB.\n", surface);
+
         ENTER_GL();
 
-        if (!*name)
+        if (!surface->texture_name)
         {
-            glGenTextures(1, name);
+            glGenTextures(1, &surface->texture_name);
             checkGLcall("glGenTextures");
 
-            TRACE("Surface %p given name %u.\n", surface, *name);
+            TRACE("Surface %p given name %u.\n", surface, surface->texture_name);
 
-            glBindTexture(surface->texture_target, *name);
+            glBindTexture(surface->texture_target, surface->texture_name);
             checkGLcall("glBindTexture");
             glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
             glTexParameteri(surface->texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
@@ -735,7 +736,7 @@ void surface_bind(IWineD3DSurfaceImpl *surface, BOOL srgb)
         }
         else
         {
-            glBindTexture(surface->texture_target, *name);
+            glBindTexture(surface->texture_target, surface->texture_name);
             checkGLcall("glBindTexture");
         }
 
-- 
1.7.3.4




More information about the wine-patches mailing list