i965: Support copy propagating of untyped atomic surface indexes.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 24 Sep 2017 19:42:52 +0000 (12:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 26 Sep 2017 22:35:14 +0000 (15:35 -0700)
In the vec4 backend, SHADER_OPCODE_UNTYPED_ATOMIC's src[1] is the
surface index.  We want to copy propagate so we can use an immediate
message descriptor, rather than an indirect send.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/intel/compiler/brw_vec4_copy_propagation.cpp

index c1ae32a2936c3d07c132ce95da8db0a5cf1f7f0f..63155ecdfb016546e94fecfedf976fe2ac6bd8a4 100644 (file)
@@ -190,6 +190,13 @@ try_constant_propagate(const struct gen_device_info *devinfo,
       inst->src[arg] = value;
       return true;
 
+   case SHADER_OPCODE_UNTYPED_ATOMIC:
+      if (arg == 1) {
+         inst->src[arg] = value;
+         return true;
+      }
+      break;
+
    case SHADER_OPCODE_POW:
    case SHADER_OPCODE_INT_QUOTIENT:
    case SHADER_OPCODE_INT_REMAINDER: