gallium: fix computation of raster.point_size_per_vertex flag
authorBrian <brian.paul@tungstengraphics.com>
Wed, 23 Jan 2008 15:24:30 +0000 (08:24 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 23 Jan 2008 15:24:30 +0000 (08:24 -0700)
src/mesa/state_tracker/st_atom_rasterizer.c

index beae36b..435d604 100644 (file)
@@ -74,6 +74,7 @@ static void update_raster_state( struct st_context *st )
    GLcontext *ctx = st->ctx;
    struct pipe_rasterizer_state raster;
    const struct cso_rasterizer *cso;
+   const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current;
    uint i;
 
    memset(&raster, 0, sizeof(raster));
@@ -210,7 +211,19 @@ static void update_raster_state( struct st_context *st )
          raster.sprite_coord_mode[i] = PIPE_SPRITE_COORD_NONE;
       }
    }
-   raster.point_size_per_vertex = ctx->VertexProgram.PointSizeEnabled;
+   if (vertProg) {
+      if (vertProg->Base.Id == 0) {
+         if (vertProg->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) {
+            /* generated program which emits point size */
+            raster.point_size_per_vertex = TRUE;
+         }
+      }
+      else if (ctx->VertexProgram.PointSizeEnabled) {
+         /* user-defined program and GL_VERTEX_PROGRAM_POINT_SIZE set */
+         raster.point_size_per_vertex = ctx->VertexProgram.PointSizeEnabled;
+      }
+   }
+
 
    /* _NEW_LINE
     */