From 4a4daa75a85db22cd37ebd533ebbccb427e07077 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 3 Feb 2010 17:25:14 +0100 Subject: 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). --- src/gallium/include/pipe/p_defines.h | 5 ++--- src/gallium/include/pipe/p_state.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/gallium/include/pipe') diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 35f3830ebc..a85a170153 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -364,9 +364,8 @@ enum pipe_transfer_usage { /** * Point sprite coord modes */ -#define PIPE_SPRITE_COORD_NONE 0 -#define PIPE_SPRITE_COORD_UPPER_LEFT 1 -#define PIPE_SPRITE_COORD_LOWER_LEFT 2 +#define PIPE_SPRITE_COORD_UPPER_LEFT 0 +#define PIPE_SPRITE_COORD_LOWER_LEFT 1 /** diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index ea3ec201ea..50a4cd6e13 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -101,7 +101,8 @@ struct pipe_rasterizer_state unsigned poly_smooth:1; unsigned poly_stipple_enable:1; unsigned point_smooth:1; - unsigned point_sprite:1; + unsigned sprite_coord_enable:PIPE_MAX_SHADER_OUTPUTS; + unsigned sprite_coord_mode:1; /**< PIPE_SPRITE_COORD_ */ unsigned point_size_per_vertex:1; /**< size computed in vertex shader */ unsigned multisample:1; /* XXX maybe more ms state in future */ unsigned line_smooth:1; @@ -143,7 +144,6 @@ struct pipe_rasterizer_state float point_size; /**< used when no per-vertex size */ float offset_units; float offset_scale; - ubyte sprite_coord_mode[PIPE_MAX_SHADER_OUTPUTS]; /**< PIPE_SPRITE_COORD_ */ }; -- cgit v1.2.3