wined3d/BltFast

Christopher GAUTIER krys at via.ecp.fr
Thu Oct 5 02:45:23 CDT 2006


I've identified a bug in IWineD3DSurfaceImpl_BltOverride(). Some blits
used to emulate a fading effect would result in a non-fading, white
screen.

It was due to GL_REGISTER_COMBINERS_NV being glEnabled() before entering
IWineD3DSurfaceImpl_BltOverride. I believe it should be glDisabled()
temporarily while blitting.

Patch included.

Changelog:
    * dlls/wined3d/surface.c:
    wined3d: Disable GL_REGISTER_COMBINERS_NV (if supported) in
             IWineD3DSurfaceImpl_BltOverride

--
k
-------------- next part --------------
diff -ru dlls/wined3d/surface.c dlls/wined3d_krys/surface.c
--- dlls/wined3d/surface.c	2006-10-04 18:47:21.000000000 +0200
+++ dlls/wined3d_krys/surface.c	2006-10-05 00:42:37.000000000 +0200
@@ -2377,9 +2377,9 @@
             DWORD oldCKey;
             DDCOLORKEY oldBltCKey = {0,0};
             GLint oldLight, oldFog, oldDepth, oldBlend, oldCull, oldAlpha;
+            GLint oldStencil, oldNVRegisterCombiners;
             GLint alphafunc;
             GLclampf alpharef;
-            GLint oldStencil;
             RECT SourceRectangle;
             GLint oldDraw;
 
@@ -2441,6 +2441,10 @@
             oldAlpha = glIsEnabled(GL_ALPHA_TEST);
             oldStencil = glIsEnabled(GL_STENCIL_TEST);
 
+            if (GL_SUPPORT(NV_REGISTER_COMBINERS)) {
+                oldNVRegisterCombiners = glIsEnabled(GL_REGISTER_COMBINERS_NV);
+            }
+
             glGetIntegerv(GL_ALPHA_TEST_FUNC, &alphafunc);
             checkGLcall("glGetFloatv GL_ALPHA_TEST_FUNC");
             glGetFloatv(GL_ALPHA_TEST_REF, &alpharef);
@@ -2477,6 +2481,10 @@
             checkGLcall("glDisable GL_CULL_FACE");
             glDisable(GL_STENCIL_TEST);
             checkGLcall("glDisable GL_STENCIL_TEST");
+            if (GL_SUPPORT(NV_REGISTER_COMBINERS)) {
+                glDisable(GL_REGISTER_COMBINERS_NV);
+                checkGLcall("glDisable GL_REGISTER_COMBINERS_NV");
+            }
 
             /* Ok, we need 2d textures, but not 1D or 3D */
             glDisable(GL_TEXTURE_1D);
@@ -2580,6 +2588,10 @@
                 glEnable(GL_ALPHA_TEST);
                 checkGLcall("glEnable GL_ALPHA_TEST");
             }
+            if (GL_SUPPORT(NV_REGISTER_COMBINERS) && oldNVRegisterCombiners) {
+                glEnable(GL_REGISTER_COMBINERS_NV);
+                checkGLcall("glEnable GL_REGISTER_COMBINERS_NV");
+            }
 
             glAlphaFunc(alphafunc, alpharef);
             checkGLcall("glAlphaFunc\n");


More information about the wine-patches mailing list