mesa: Branch 'master'

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Apr 17 12:03:47 UTC 2007


 src/mesa/tnl/t_vb_program.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

New commits:
diff-tree 36949abec763e56a5356b65e2f2570cfed11d853 (from 6459adf79b0a3622515d5f2197a791538ca2f342)
Author: Roland Scheidegger <sroland at tungstengraphics.com>
Date:   Tue Apr 17 14:01:42 2007 +0200

    cleanups for t_vb_program.c
    
    use VertexProgram._Current instead of VertexProgram.Current in a few more places.
    Only fixup fogc and psiz in case this is really a nv program (others are fine
    if undefined), and fix this case up so the values actually get written.

diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index 260f9d7..3d7ea3a 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -84,7 +84,7 @@ init_machine(GLcontext *ctx, struct gl_p
    MEMCPY(machine->VertAttribs, ctx->Current.Attrib,
           MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat));
 
-   if (ctx->VertexProgram.Current->IsNVProgram) {
+   if (ctx->VertexProgram._Current->IsNVProgram) {
       GLuint i;
       /* Output/result regs are initialized to [0,0,0,1] */
       for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
@@ -225,7 +225,7 @@ run_vp( GLcontext *ctx, struct tnl_pipel
       return GL_TRUE;
 #endif
 
-   if (ctx->VertexProgram.Current->IsNVProgram) {
+   if (program->IsNVProgram) {
       _mesa_load_tracked_matrices(ctx);
    }
    else {
@@ -276,17 +276,6 @@ run_vp( GLcontext *ctx, struct tnl_pipel
       /* execute the program */
       _mesa_execute_program(ctx, &program->Base, &machine);
 
-      /* Fixup fog an point size results if needed */
-      if (ctx->Fog.Enabled &&
-          (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) {
-         machine.Outputs[VERT_RESULT_FOGC][0] = 1.0;
-      }
-
-      if (ctx->VertexProgram.PointSizeEnabled &&
-          (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) {
-         machine.Outputs[VERT_RESULT_PSIZ][0] = ctx->Point.Size;
-      }
-
       /* copy the output registers into the VB->attribs arrays */
       for (j = 0; j < numOutputs; j++) {
          const GLuint attr = outputs[j];
@@ -301,6 +290,23 @@ run_vp( GLcontext *ctx, struct tnl_pipel
 #endif
    }
 
+   /* Fixup fog and point size results if needed */
+   if (program->IsNVProgram) {
+      if (ctx->Fog.Enabled &&
+          (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) {
+         for (i = 0; i < VB->Count; i++) {
+            store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
+         }
+      }
+
+      if (ctx->VertexProgram.PointSizeEnabled &&
+          (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) {
+         for (i = 0; i < VB->Count; i++) {
+            store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
+         }
+      }
+   }
+
    /* Setup the VB pointers so that the next pipeline stages get
     * their data from the right place (the program output arrays).
     */



More information about the mesa-commit mailing list