summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-02-03 17:25:14 +0100
committerRoland Scheidegger <[email protected]>2010-02-03 17:25:14 +0100
commit4a4daa75a85db22cd37ebd533ebbccb427e07077 (patch)
tree981d728824666f3c19995ce54e05a511c1fdd690 /src/mesa/state_tracker
parenta407636efb6c32cee81b9a1525dbc804aacd957b (diff)
gallium: clean up point sprite rasterizer state
Don't need sprite coord origin per coord. Also, don't need separate sprite enable bit - if all coords have it diabled, then there are no point sprites (technically, there's a distinction in pre-GL3, but it only differs in having more leniency in clamping to max size, something the state tracker would need to handle and the hardware won't bother anyway). Also, use packed field for the per-coord enables. All in all, should save 3 dwords in rasterizer state (from 10 down to 7).
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 710574f3618..16c842d2f69 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -188,18 +188,19 @@ static void update_raster_state( struct st_context *st )
*/
raster->point_size = ctx->Point.Size;
- 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) ^
- (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
- 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 && ctx->Point.SmoothFlag)
+ raster->point_smooth = 1;
+
+ 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;
+ }
}
}