wined3d/BltFast

Christopher GAUTIER krys at via.ecp.fr
Fri Oct 6 02:54:01 CDT 2006


On Thu, Oct 05, 2006, Christopher GAUTIER wrote:
> It was due to GL_REGISTER_COMBINERS_NV being glEnabled() before entering
> IWineD3DSurfaceImpl_BltOverride. I believe it should be glDisabled()
> temporarily while blitting.

I'm resending the patch, to fix a "might-not-be-initialized"
warning, and reduce the number of GL calls.

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

--
krys
-------------- next part --------------
Index: dlls/wined3d/surface.c
===================================================================
RCS file: /home/wine/wine/dlls/wined3d/surface.c,v
retrieving revision 1.117
diff -u -r1.117 surface.c
--- dlls/wined3d/surface.c	2 Oct 2006 20:06:24 -0000	1.117
+++ dlls/wined3d/surface.c	6 Oct 2006 07:40:27 -0000
@@ -2377,9 +2377,10 @@
             DWORD oldCKey;
             DDCOLORKEY oldBltCKey = {0,0};
             GLint oldLight, oldFog, oldDepth, oldBlend, oldCull, oldAlpha;
+            GLint oldStencil;
+            GLboolean oldNVRegisterCombiners = GL_FALSE;
             GLint alphafunc;
             GLclampf alpharef;
-            GLint oldStencil;
             RECT SourceRectangle;
             GLint oldDraw;
 
@@ -2441,6 +2442,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 +2482,10 @@
             checkGLcall("glDisable GL_CULL_FACE");
             glDisable(GL_STENCIL_TEST);
             checkGLcall("glDisable GL_STENCIL_TEST");
+            if (oldNVRegisterCombiners == GL_TRUE) {
+                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 +2589,10 @@
                 glEnable(GL_ALPHA_TEST);
                 checkGLcall("glEnable GL_ALPHA_TEST");
             }
+            if (oldNVRegisterCombiners == GL_TRUE) {
+                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