Switch over to use the CoordsReplaceBits bitmask.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
/* _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;
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));
/* _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 */
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;
}