summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2009-07-22 22:47:31 +0200
committerNicolai Hähnle <[email protected]>2009-07-27 20:32:05 +0200
commit927f5f16826a95cf665219c4b0039eeafb936057 (patch)
treeb2e705dcf83e166441a78eb4d8be1eb29bd94c96 /src
parenta808b10ce82692ff91ab69a1afda24dda56cba6b (diff)
r300: Remove faux lazy translation of vertex programs
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h1
-rw-r--r--src/mesa/drivers/dri/r300/r300_shader.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c7
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.h4
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