i965/fs: Allow copy propagating into new surface access opcodes
authorKristian Høgsberg Kristensen <krh@bitplanet.net>
Wed, 21 Oct 2015 06:22:27 +0000 (23:22 -0700)
committerKristian Høgsberg Kristensen <krh@bitplanet.net>
Fri, 23 Oct 2015 16:42:28 +0000 (09:42 -0700)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp

index 5589716239afa3418b56f4771f31a49fcf819397..97e206d3daacc6cea81f51c917a35e2ffc0f4fc0 100644 (file)
@@ -612,6 +612,21 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
          }
          break;
 
+      case SHADER_OPCODE_UNTYPED_ATOMIC:
+      case SHADER_OPCODE_UNTYPED_SURFACE_READ:
+      case SHADER_OPCODE_UNTYPED_SURFACE_WRITE:
+      case SHADER_OPCODE_TYPED_ATOMIC:
+      case SHADER_OPCODE_TYPED_SURFACE_READ:
+      case SHADER_OPCODE_TYPED_SURFACE_WRITE:
+         /* We only propagate into the surface argument of the
+          * instruction. Everything else goes through LOAD_PAYLOAD.
+          */
+         if (i == 1) {
+            inst->src[i] = val;
+            progress = true;
+         }
+         break;
+
       case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
       case SHADER_OPCODE_BROADCAST:
          inst->src[i] = val;