svga: Rebind shaders when tokens change.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 5 Jan 2010 17:32:19 +0000 (17:32 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 5 Jan 2010 17:32:53 +0000 (17:32 +0000)
Even shader ID doesn't change. Otherwise the token change is not
effective.

This reverts regression from commit
cdb445f3a9285e2d8f042a07021ade78b94e0156. Regression could be seen in
Quake3's loading screen -- the upper right corner of the screen would
be black.

src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_state_fs.c
src/gallium/drivers/svga/svga_state_vs.c

index eb666c2616b7e3ed27ad43058de2c290d7dfa403..32e9304f819ba66709d0c27601f5878294f8c7bc 100644 (file)
@@ -268,8 +268,6 @@ struct svga_hw_draw_state
    unsigned ts[16][TS_MAX];
    float cb[PIPE_SHADER_TYPES][CB_MAX][4];
 
-   unsigned shader_id[PIPE_SHADER_TYPES];
-   
    struct svga_shader_result *fs;
    struct svga_shader_result *vs;
    struct svga_hw_view_state views[PIPE_MAX_SAMPLERS];
index 1902b0106bafcc93678aa3f56b3787459d094ed5..272d1dd14e3c3cf809b24c1329a3ffb7535c51d4 100644 (file)
@@ -268,16 +268,13 @@ static int emit_hw_fs( struct svga_context *svga,
    assert(id != SVGA3D_INVALID_ID);
 
    if (result != svga->state.hw_draw.fs) {
-      if (id != svga->state.hw_draw.shader_id[PIPE_SHADER_FRAGMENT]) {
-         ret = SVGA3D_SetShader(svga->swc,
-                                SVGA3D_SHADERTYPE_PS,
-                                id );
-         if (ret)
-            return ret;
-      }
+      ret = SVGA3D_SetShader(svga->swc,
+                             SVGA3D_SHADERTYPE_PS,
+                             id );
+      if (ret)
+         return ret;
 
       svga->dirty |= SVGA_NEW_FS_RESULT;
-      svga->state.hw_draw.shader_id[PIPE_SHADER_FRAGMENT] = id;
       svga->state.hw_draw.fs = result;      
    }
 
index 6cf51434d7fd5bc10fdf0fbadc9a44369c086a6d..db30f2735fd1e9bb084fb2add0511ba3fd43ba6f 100644 (file)
@@ -149,16 +149,13 @@ static int emit_hw_vs( struct svga_context *svga,
    }
 
    if (result != svga->state.hw_draw.vs) {
-      if (id != svga->state.hw_draw.shader_id[PIPE_SHADER_VERTEX]) {
-         ret = SVGA3D_SetShader(svga->swc,
-                                SVGA3D_SHADERTYPE_VS,
-                                id );
-         if (ret)
-            return ret;
-      }
+      ret = SVGA3D_SetShader(svga->swc,
+                             SVGA3D_SHADERTYPE_VS,
+                             id );
+      if (ret)
+         return ret;
 
       svga->dirty |= SVGA_NEW_VS_RESULT;
-      svga->state.hw_draw.shader_id[PIPE_SHADER_VERTEX] = id;
       svga->state.hw_draw.vs = result;      
    }