summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965/brw_sf.c
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/gallium/drivers/i965/brw_sf.c
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/gallium/drivers/i965/brw_sf.c')
-rw-r--r--src/gallium/drivers/i965/brw_sf.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/i965/brw_sf.c b/src/gallium/drivers/i965/brw_sf.c
index e1986a9dbbd..fc3102b5318 100644
--- a/src/gallium/drivers/i965/brw_sf.c
+++ b/src/gallium/drivers/i965/brw_sf.c
@@ -128,6 +128,7 @@ static enum pipe_error compile_sf_prog( struct brw_context *brw,
static enum pipe_error upload_sf_prog(struct brw_context *brw)
{
const struct brw_fs_signature *sig = &brw->curr.fragment_shader->signature;
+ const struct pipe_rasterizer_state *rast = &brw->curr.rast->templ;
struct brw_sf_prog_key key;
enum pipe_error ret;
unsigned i;
@@ -166,8 +167,8 @@ static enum pipe_error upload_sf_prog(struct brw_context *brw)
case PIPE_PRIM_TRIANGLES:
/* PIPE_NEW_RAST
*/
- if (brw->curr.rast->templ.fill_cw != PIPE_POLYGON_MODE_FILL ||
- brw->curr.rast->templ.fill_ccw != PIPE_POLYGON_MODE_FILL)
+ if (rast->fill_cw != PIPE_POLYGON_MODE_FILL ||
+ rast->fill_ccw != PIPE_POLYGON_MODE_FILL)
key.primitive = SF_UNFILLED_TRIS;
else
key.primitive = SF_TRIANGLES;
@@ -180,14 +181,14 @@ static enum pipe_error upload_sf_prog(struct brw_context *brw)
break;
}
- key.do_point_sprite = brw->curr.rast->templ.point_sprite;
- key.sprite_origin_lower_left = 0; /* XXX: ctx->Point.SpriteOrigin - fix rast state */
- key.do_flat_shading = brw->curr.rast->templ.flatshade;
- key.do_twoside_color = brw->curr.rast->templ.light_twoside;
+ key.do_point_sprite = rast->sprite_coord_enable ? 1 : 0;
+ key.sprite_origin_lower_left = (rast->sprite_coord_mode == PIPE_SPRITE_COORD_LOWER_LEFT);
+ key.point_coord_replace_attrs = rast->sprite_coord_enable;
+ key.do_flat_shading = rast->flatshade;
+ key.do_twoside_color = rast->light_twoside;
if (key.do_twoside_color) {
- key.frontface_ccw = (brw->curr.rast->templ.front_winding ==
- PIPE_WINDING_CCW);
+ key.frontface_ccw = (rast->front_winding == PIPE_WINDING_CCW);
}
if (brw_search_cache(&brw->cache, BRW_SF_PROG,