From: Corbin Simpson Date: Thu, 23 Jul 2009 06:58:35 +0000 (-0700) Subject: r300g: Actually mark shaders as translated/untranslated. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07961bb05e5ba05205b9f53834863664f1023870;p=mesa.git r300g: Actually mark shaders as translated/untranslated. Also trust that Gallium will not give us TGSI that miscounts shader consts. This creates a 20x speedup on glxgears, from 8 FPS to 160 FPS. --- diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 8672e211bc4..ca8ef999024 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -105,4 +105,7 @@ void r300_translate_fragment_shader(struct r300_context* r300, tgsi_parse_free(&parser); FREE(assembler); + + /* And, finally... */ + fs->translated = TRUE; } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 68da0aa4cbb..162740f594d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -155,7 +155,7 @@ static void } r300->dirty_state |= R300_NEW_CONSTANTS; - +#if 0 /* If the number of constants have changed, invalidate the shader. */ if (r300->shader_constants[shader].user_count != i) { if (shader == PIPE_SHADER_FRAGMENT && r300->fs && @@ -168,6 +168,7 @@ static void r300_translate_vertex_shader(r300, r300->vs); } } +#endif } /* Create a new depth, stencil, and alpha state based on the CSO dsa state. @@ -315,7 +316,6 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) r300_translate_fragment_shader(r300, fs); } - fs->translated = TRUE; r300->fs = fs; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index a664a316e8c..741a1b69895 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -408,4 +408,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, tgsi_parse_free(&parser); FREE(assembler); + + /* And, finally... */ + vs->translated = TRUE; }