i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 29 May 2014 07:06:08 +0000 (00:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 23 Jun 2014 20:29:39 +0000 (13:29 -0700)
As far as I can tell, Broadwell doesn't need any of the SURFACE_STATE
workarounds for textureGather() bugs, so there's no need to emit
a second set of identical copies.

To keep things simple, just point the gather surface index base to the
same place as the texture surface index base.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 103c70b8cd55c0724c0e80d6a7125b4f06e7910b..2fa3ad945df2d90c62877f095d004dddd067c83b 100644 (file)
@@ -763,8 +763,13 @@ backend_visitor::assign_common_binding_table_offsets(uint32_t next_binding_table
    }
 
    if (prog->UsesGather) {
-      stage_prog_data->binding_table.gather_texture_start = next_binding_table_offset;
-      next_binding_table_offset += num_textures;
+      if (brw->gen >= 8) {
+         stage_prog_data->binding_table.gather_texture_start =
+            stage_prog_data->binding_table.texture_start;
+      } else {
+         stage_prog_data->binding_table.gather_texture_start = next_binding_table_offset;
+         next_binding_table_offset += num_textures;
+      }
    } else {
       stage_prog_data->binding_table.gather_texture_start = 0xd0d0d0d0;
    }
index c9d961491ae6b7c48b0b9c3790e752fc00c1c6ae..3279d3bbbcbfb23ad6b93bca22990f2bd3f9d300 100644 (file)
@@ -829,12 +829,14 @@ brw_update_texture_surfaces(struct brw_context *brw)
    /* emit alternate set of surface state for gather. this
     * allows the surface format to be overriden for only the
     * gather4 messages. */
-   if (vs && vs->UsesGather)
-      update_stage_texture_surfaces(brw, vs, &brw->vs.base, true);
-   if (gs && gs->UsesGather)
-      update_stage_texture_surfaces(brw, gs, &brw->gs.base, true);
-   if (fs && fs->UsesGather)
-      update_stage_texture_surfaces(brw, fs, &brw->wm.base, true);
+   if (brw->gen < 8) {
+      if (vs && vs->UsesGather)
+         update_stage_texture_surfaces(brw, vs, &brw->vs.base, true);
+      if (gs && gs->UsesGather)
+         update_stage_texture_surfaces(brw, gs, &brw->gs.base, true);
+      if (fs && fs->UsesGather)
+         update_stage_texture_surfaces(brw, fs, &brw->wm.base, true);
+   }
 
    brw->state.dirty.brw |= BRW_NEW_SURFACES;
 }