r300-gallium: r500-fs: If recompiling a shader, overwrite old insts.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 31 Mar 2009 00:20:12 +0000 (17:20 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 31 Mar 2009 00:20:12 +0000 (17:20 -0700)
src/gallium/drivers/r300/r300_state_shader.c

index ed9d26f0b9b152dd9f084d633f540e5e0ba4bc3a..5dc7266f9b1ae5d53bb3f9c75aae3e1c33a1ee07 100644 (file)
@@ -582,6 +582,11 @@ void r300_translate_fragment_shader(struct r300_context* r300,
     /* Setup starting offset for immediates. */
     assembler->imm_offset = consts->user_count;
 
+    /* Make sure we start at the beginning of the shader. */
+    if (is_r500) {
+        ((struct r500_fragment_shader*)fs)->instruction_count = 0;
+    }
+
     tgsi_parse_init(&parser, fs->state.tokens);
 
     while (!tgsi_parse_end_of_tokens(&parser)) {