wined3d: state_pointsprite should apply to all texture units

Chris Robinson chris.kcat at gmail.com
Tue Jan 2 18:06:19 CST 2007


-------------- next part --------------
From a9232f5dd8ea714eb588e1935cc53021dade84a8 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat at gmail.com>
Date: Sat, 23 Dec 2006 19:59:17 -0800
Subject: [PATCH] wined3d: state_pointsprite should apply to all texture units

---
 dlls/wined3d/state.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index a8419a7..460c9d6 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1048,6 +1048,9 @@ static void state_lastpixel(DWORD state,
 }
 
 static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+    unsigned int i;
+    int val;
+
     /* TODO: NV_POINT_SPRITE */
     if (!GL_SUPPORT(ARB_POINT_SPRITE)) {
         TRACE("Point sprites not supported\n");
@@ -1055,15 +1058,25 @@ static void state_pointsprite(DWORD stat
     }
 
     if (stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
-        glEnable(GL_POINT_SPRITE_ARB);
-        checkGLcall("glEnable(GL_POINT_SPRITE_ARB)");
-        glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, TRUE);
-        checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, TRUE)");
+        val = GL_TRUE;
     } else {
-        glDisable(GL_POINT_SPRITE_ARB);
-        checkGLcall("glDisable(GL_POINT_SPRITE_ARB)");
-        glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, FALSE);
-        checkGLcall("glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, FALSE)");
+        val = GL_FALSE;
+    }
+
+    for (i = 0; i < GL_LIMITS(texture_stages); i++) {
+        /* Note the WINED3DRS value applies to all textures, but GL has one
+         * per texture, so apply it now ready to be used!
+         */
+        if (GL_SUPPORT(ARB_MULTITEXTURE)) {
+            GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i));
+            checkGLcall("glActiveTextureARB");
+        } else if (i>0) {
+            FIXME("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
+        }
+
+        glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, val);
+        checkGLcall((val?"glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)":
+                         "glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE)"));
     }
 }
 
-- 
1.4.2.4



More information about the wine-patches mailing list