summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-05-22 13:46:30 +0200
committerMarek Olšák <[email protected]>2010-05-23 17:13:31 +0200
commit7d602b3651d4be18a207d3089fd3aa14eaffe441 (patch)
tree2d0e67a6af1d4c81d35682f2e27d87d02ac28547
parent98630a900e78ec7ee598679c27c25923c1ffb929 (diff)
r300g: fix dummy vertex shader compilation
-rw-r--r--src/gallium/drivers/r300/r300_vs.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c
index 59f89b3482a..ef3af630ac8 100644
--- a/src/gallium/drivers/r300/r300_vs.c
+++ b/src/gallium/drivers/r300/r300_vs.c
@@ -160,11 +160,16 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
c->code->outputs[outputs->wpos] = reg++;
}
+void r300_init_vs_outputs(struct r300_vertex_shader *vs)
+{
+ tgsi_scan_shader(vs->state.tokens, &vs->info);
+ r300_shader_read_vs_outputs(&vs->info, &vs->outputs);
+}
+
static void r300_dummy_vertex_shader(
struct r300_context* r300,
struct r300_vertex_shader* shader)
{
- struct pipe_shader_state state;
struct ureg_program *ureg;
struct ureg_dst dst;
struct ureg_src imm;
@@ -178,18 +183,12 @@ static void r300_dummy_vertex_shader(
ureg_MOV(ureg, dst, imm);
ureg_END(ureg);
- state.tokens = ureg_finalize(ureg);
+ shader->state.tokens = tgsi_dup_tokens(ureg_finalize(ureg));
+ ureg_destroy(ureg);
shader->dummy = TRUE;
+ r300_init_vs_outputs(shader);
r300_translate_vertex_shader(r300, shader);
-
- ureg_destroy(ureg);
-}
-
-void r300_init_vs_outputs(struct r300_vertex_shader *vs)
-{
- tgsi_scan_shader(vs->state.tokens, &vs->info);
- r300_shader_read_vs_outputs(&vs->info, &vs->outputs);
}
void r300_translate_vertex_shader(struct r300_context *r300,