summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_program.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-03 17:25:14 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-03 17:25:14 +0100
commit4a4daa75a85db22cd37ebd533ebbccb427e07077 (patch)
tree981d728824666f3c19995ce54e05a511c1fdd690 /src/gallium/drivers/nv50/nv50_program.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/nv50/nv50_program.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index e16fa479e5..593d743603 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -4067,15 +4067,13 @@ nv50_pntc_replace(struct nv50_context *nv50, uint32_t pntc[8], unsigned base)
}
if (j < vp->info.num_outputs) {
- ubyte mode =
- nv50->rasterizer->pipe.sprite_coord_mode[si];
+ ubyte enable =
+ (nv50->rasterizer->pipe.sprite_coord_enable >> si) & 1;
- if (mode == PIPE_SPRITE_COORD_NONE) {
+ if (enable == 0) {
m += n;
continue;
- } else
- if (mode == PIPE_SPRITE_COORD_LOWER_LEFT)
- origin = 0;
+ }
}
/* this is either PointCoord or replaced by sprite coords */
@@ -4086,7 +4084,7 @@ nv50_pntc_replace(struct nv50_context *nv50, uint32_t pntc[8], unsigned base)
++m;
}
}
- return origin;
+ return (nv50->rasterizer->pipe.sprite_coord_mode == PIPE_SPRITE_COORD_LOWER_LEFT ? 0 : origin);
}
static int
@@ -4202,7 +4200,7 @@ nv50_linkage_validate(struct nv50_context *nv50)
so_method(so, tesla, NV50TCL_NOPERSPECTIVE_BITMAP(0), 4);
so_datap (so, lin, 4);
- if (nv50->rasterizer->pipe.point_sprite) {
+ if (nv50->rasterizer->pipe.sprite_coord_enable) {
so_method(so, tesla, NV50TCL_POINT_SPRITE_CTRL, 1);
so_data (so,
nv50_pntc_replace(nv50, pcrd, (reg[4] >> 8) & 0xff));