diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-05-15 22:55:17 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-05-15 22:55:17 +0200 |
commit | f86ac27bf9203fdd9b7110dc843263307f475a99 (patch) | |
tree | f19b9fa1b289e376ea35561c03b7e85921fcda3f /src/gallium/drivers/r300/r300_vs.c | |
parent | cf5dff1f2337303f49780dc646a44c6dbbe48e5a (diff) | |
download | external_mesa3d-f86ac27bf9203fdd9b7110dc843263307f475a99.zip external_mesa3d-f86ac27bf9203fdd9b7110dc843263307f475a99.tar.gz external_mesa3d-f86ac27bf9203fdd9b7110dc843263307f475a99.tar.bz2 |
r300g: fix psychedelic colors with SWTCL
r300_vertex_shader::outputs was uninitialized.
Also remove the tokens parameter.
Diffstat (limited to 'src/gallium/drivers/r300/r300_vs.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_vs.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index f318643..59f89b3 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -181,21 +181,23 @@ static void r300_dummy_vertex_shader( state.tokens = ureg_finalize(ureg); shader->dummy = TRUE; - r300_translate_vertex_shader(r300, shader, state.tokens); + r300_translate_vertex_shader(r300, shader); ureg_destroy(ureg); } -void r300_translate_vertex_shader(struct r300_context* r300, - struct r300_vertex_shader* vs, - const struct tgsi_token *tokens) +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, + struct r300_vertex_shader *vs) { struct r300_vertex_program_compiler compiler; struct tgsi_to_rc ttr; - tgsi_scan_shader(tokens, &vs->info); - r300_shader_read_vs_outputs(&vs->info, &vs->outputs); - /* Setup the compiler */ rc_init(&compiler.Base); @@ -205,7 +207,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, if (compiler.Base.Debug) { debug_printf("r300: Initial vertex program\n"); - tgsi_dump(tokens, 0); + tgsi_dump(vs->state.tokens, 0); } /* Translate TGSI to our internal representation */ @@ -213,7 +215,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, ttr.info = &vs->info; ttr.use_half_swizzles = FALSE; - r300_tgsi_to_rc(&ttr, tokens); + r300_tgsi_to_rc(&ttr, vs->state.tokens); compiler.RequiredOutputs = ~(~0 << (vs->info.num_outputs + 1)); compiler.SetHwInputOutput = &set_vertex_inputs_outputs; |