Merge remote branch 'origin/master' into gallium_draw_llvm
[mesa.git] / src / mesa / state_tracker / st_atom_rasterizer.c
index 4e70510c0c0fde129b62d1624706bdd9a0a9e2df..9c9a99bcfc6f0a68305b6daf96578fd408275564 100644 (file)
@@ -102,6 +102,9 @@ static void update_raster_state( struct st_context *st )
    if (ctx->Light.ShadeModel == GL_FLAT)
       raster->flatshade = 1;
 
+   if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)
+      raster->flatshade_first = 1;
+
    /* _NEW_LIGHT | _NEW_PROGRAM
     *
     * Back-face colors can come from traditional lighting (when
@@ -180,26 +183,26 @@ static void update_raster_state( struct st_context *st )
 
    if (ctx->Polygon.StippleFlag)
       raster->poly_stipple_enable = 1;
-     
+
    /* _NEW_POINT
     */
    raster->point_size = ctx->Point.Size;
 
-   raster->point_size_min = 0;    /* temporary, will go away */
-   raster->point_size_max = 1000; /* temporary, will go away */
+   if (!ctx->Point.PointSprite && ctx->Point.SmoothFlag)
+      raster->point_smooth = 1;
 
-   raster->point_smooth = ctx->Point.SmoothFlag;
-   raster->point_sprite = ctx->Point.PointSprite;
-   for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
-      if (ctx->Point.CoordReplace[i]) {
-         if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT)
-            raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_UPPER_LEFT;
-         else 
-            raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_LOWER_LEFT;
-      }
-      else {
-         raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_NONE;
+   if (ctx->Point.PointSprite) {
+      if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
+          (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
+         raster->sprite_coord_mode = PIPE_SPRITE_COORD_UPPER_LEFT;
+      else 
+         raster->sprite_coord_mode = PIPE_SPRITE_COORD_LOWER_LEFT;
+      for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
+         if (ctx->Point.CoordReplace[i]) {
+            raster->sprite_coord_enable |= 1 << i;
+         }
       }
+      raster->point_quad_rasterization = 1;
    }
 
    /* ST_NEW_VERTEX_PROGRAM