summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2016-05-22 14:10:19 +0200
committerMathias Fröhlich <[email protected]>2016-06-16 05:50:53 +0200
commitd19c69659ae5874b0c78afac5f4e634f7f0f5489 (patch)
treeed75fcc9f7cc211427e2c98373094abf801501e6 /src/mesa
parent97f67be0a7562cc477531675170c52fd7b17f899 (diff)
i965: Convert i965 to use CoordsReplaceBits.
Switch over to use the CoordsReplaceBits bitmask. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c6
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sf_state.c2
3 files changed, 3 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index c85d8bc0ea2..bbfa2c699f8 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -190,12 +190,7 @@ brw_upload_sf_prog(struct brw_context *brw)
/* _NEW_POINT */
key.do_point_sprite = ctx->Point.PointSprite;
if (key.do_point_sprite) {
- int i;
-
- for (i = 0; i < 8; i++) {
- if (ctx->Point.CoordReplace[i])
- key.point_sprite_coord_replace |= (1 << i);
- }
+ key.point_sprite_coord_replace = ctx->Point.CoordReplaceBits & 0xff;
}
if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(VARYING_SLOT_PNTC))
key.do_point_coord = 1;
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index d929f9b403b..fb52990e05d 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -299,7 +299,6 @@ brw_vs_populate_key(struct brw_context *brw,
struct brw_vertex_program *vp =
(struct brw_vertex_program *)brw->vertex_program;
struct gl_program *prog = (struct gl_program *) brw->vertex_program;
- int i;
memset(key, 0, sizeof(*key));
@@ -330,10 +329,7 @@ brw_vs_populate_key(struct brw_context *brw,
/* _NEW_POINT */
if (brw->gen < 6 && ctx->Point.PointSprite) {
- for (i = 0; i < 8; i++) {
- if (ctx->Point.CoordReplace[i])
- key->point_coord_replace |= (1 << i);
- }
+ key->point_coord_replace = ctx->Point.CoordReplaceBits & 0xff;
}
/* _NEW_TEXTURE */
diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index 0538ab70428..309464fc9a9 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -214,7 +214,7 @@ calculate_attr_overrides(const struct brw_context *brw,
if (drawing_points) {
if (brw->ctx.Point.PointSprite &&
(attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) &&
- brw->ctx.Point.CoordReplace[attr - VARYING_SLOT_TEX0]) {
+ (brw->ctx.Point.CoordReplaceBits & (1u << (attr - VARYING_SLOT_TEX0)))) {
point_sprite = true;
}