i965: Convert i965 to use CoordsReplaceBits.
authorMathias Fröhlich <mathias.froehlich@web.de>
Sun, 22 May 2016 12:10:19 +0000 (14:10 +0200)
committerMathias Fröhlich <mathias.froehlich@web.de>
Thu, 16 Jun 2016 03:50:53 +0000 (05:50 +0200)
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>
src/mesa/drivers/dri/i965/brw_sf.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/gen6_sf_state.c

index c85d8bc0ea2126c92f93a18b08e033a3c8c07150..bbfa2c699f8a3e0a621db5e9d6ece119ebc098bf 100644 (file)
@@ -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;
index d929f9b403bb2472d19e78a23add9719421a8727..fb52990e05d6ad32704f49cd1ecb437e91d38f3d 100644 (file)
@@ -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 */
index 0538ab7042865a5d21d30397b080b00afbed70e6..309464fc9a9807caa4ca5676423a04c53e019ba3 100644 (file)
@@ -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;
          }