OSDN Git Service

r300: Remove faux lazy translation of vertex programs
authorNicolai Hähnle <nhaehnle@gmail.com>
Wed, 22 Jul 2009 20:47:31 +0000 (22:47 +0200)
committerNicolai Hähnle <nhaehnle@gmail.com>
Mon, 27 Jul 2009 18:32:05 +0000 (20:32 +0200)
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 <nhaehnle@gmail.com>
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_shader.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_vertprog.c
src/mesa/drivers/dri/r300/r300_vertprog.h

index ce74264..bd363f6 100644 (file)
@@ -420,7 +420,6 @@ struct r300_vertex_program {
                } body;
        } hw_code;
 
-       GLboolean translated;
        GLboolean error;
 
        int pos_end;
index 06c8938..3704c10 100644 (file)
@@ -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;
        }
index 66d9a69..fdc3362 100644 (file)
@@ -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);
        }
index cf47884..1df50c1 100644 (file)
@@ -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 };
index 2dab11c..896699f 100644 (file)
@@ -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