gallium: fix the test in vs_exec_prepare() to avoid redundant bindings
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 15 Oct 2008 17:56:57 +0000 (11:56 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 15 Oct 2008 18:00:48 +0000 (12:00 -0600)
Fixes regressions seen in progs/samples/prim.c, progs/demos/ray.c

src/gallium/auxiliary/draw/draw_vs_exec.c

index 79a19d6be2bb543e9c980f8e1cf850d438b13c77..13d4fcfdbf613937e8e292b79985e54f38081715 100644 (file)
@@ -46,7 +46,6 @@
 struct exec_vertex_shader {
    struct draw_vertex_shader base;
    struct tgsi_exec_machine *machine;
-   const struct tgsi_token *machine_tokens;
 };
 
 static struct exec_vertex_shader *exec_vertex_shader( struct draw_vertex_shader *vs )
@@ -66,12 +65,11 @@ vs_exec_prepare( struct draw_vertex_shader *shader,
    /* Specify the vertex program to interpret/execute.
     * Avoid rebinding when possible.
     */
-   if (evs->machine_tokens != shader->state.tokens) {
+   if (evs->machine->Tokens != shader->state.tokens) {
       tgsi_exec_machine_bind_shader(evs->machine,
                                     shader->state.tokens,
                                     PIPE_MAX_SAMPLERS,
                                     NULL /*samplers*/ );
-      evs->machine_tokens = shader->state.tokens;
    }
 }