From 927f5f16826a95cf665219c4b0039eeafb936057 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Wed, 22 Jul 2009 22:47:31 +0200 Subject: [PATCH] r300: Remove faux lazy translation of vertex programs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit De facto, vertex programs were translated immediately in all situations, so let's just stop pretending that we do lazy translation. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/r300_shader.c | 4 +--- src/mesa/drivers/dri/r300/r300_state.c | 4 +--- src/mesa/drivers/dri/r300/r300_vertprog.c | 7 ++++--- src/mesa/drivers/dri/r300/r300_vertprog.h | 4 +--- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index ce742641a43..bd363f6b3a2 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -420,7 +420,6 @@ struct r300_vertex_program { } body; } hw_code; - GLboolean translated; GLboolean error; int pos_end; diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 06c893881e5..3704c101558 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -126,9 +126,7 @@ r300IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) return !fp->error; } else { - struct r300_vertex_program *vp = r300SelectVertexShader(ctx); - if (!vp->translated) - r300TranslateVertexShader(vp); + struct r300_vertex_program *vp = r300SelectAndTranslateVertexShader(ctx); return !vp->error; } diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 66d9a69622a..fdc3362dddd 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2020,9 +2020,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) } } - vp = r300SelectVertexShader(ctx); - if (!vp->translated) - r300TranslateVertexShader(vp); + vp = r300SelectAndTranslateVertexShader(ctx); r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error); } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index cf4788411fe..1df50c15091 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -1006,7 +1006,7 @@ static void t_inputs_outputs(struct r300_vertex_program *vp) } } -void r300TranslateVertexShader(struct r300_vertex_program *vp) +static void translate_vertex_program(struct r300_vertex_program *vp) { struct prog_instruction *vpi = vp->Base->Base.Instructions; int i; @@ -1020,7 +1020,6 @@ void r300TranslateVertexShader(struct r300_vertex_program *vp) vp->pos_end = 0; /* Not supported yet */ vp->hw_code.length = 0; - vp->translated = GL_TRUE; vp->error = GL_FALSE; t_inputs_outputs(vp); @@ -1628,10 +1627,12 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, vp->num_temporaries = max + 1; } + translate_vertex_program(vp); + return vp; } -struct r300_vertex_program * r300SelectVertexShader(GLcontext *ctx) +struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx) { r300ContextPtr r300 = R300_CONTEXT(ctx); struct r300_vertex_program_key wanted_key = { 0 }; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.h b/src/mesa/drivers/dri/r300/r300_vertprog.h index 2dab11c3378..896699ffe2e 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.h +++ b/src/mesa/drivers/dri/r300/r300_vertprog.h @@ -34,8 +34,6 @@ void r300SetupVertexProgram(r300ContextPtr rmesa); -struct r300_vertex_program * r300SelectVertexShader(GLcontext *ctx); - -void r300TranslateVertexShader(struct r300_vertex_program *vp); +struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx); #endif -- 2.30.2