glsl: add a few missing int64 constant propagation cases
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 17 Aug 2017 02:18:39 +0000 (22:18 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 18 Aug 2017 06:26:16 +0000 (02:26 -0400)
Fixes KHR-GL45.shader_ballot_tests.ShaderBallotAvailability, which
causes some silly swizzles to appear, triggering this optimization to
get hit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/glsl/ir_constant_expression.cpp
src/compiler/glsl/opt_constant_propagation.cpp

index 25b00a749f2d23537537749532d99c48bebece3c..2fc23baba793fbeea478b762cfba2838f7b75c1a 100644 (file)
@@ -732,6 +732,8 @@ ir_swizzle::constant_expression_value(void *mem_ctx,
          case GLSL_TYPE_FLOAT: data.f[i] = v->value.f[swiz_idx[i]]; break;
          case GLSL_TYPE_BOOL:  data.b[i] = v->value.b[swiz_idx[i]]; break;
          case GLSL_TYPE_DOUBLE:data.d[i] = v->value.d[swiz_idx[i]]; break;
+         case GLSL_TYPE_UINT64:data.u64[i] = v->value.u64[swiz_idx[i]]; break;
+         case GLSL_TYPE_INT64: data.i64[i] = v->value.i64[swiz_idx[i]]; break;
          default:              assert(!"Should not get here."); break;
          }
       }
index 52e3937bb11ecfe685dcae6828dfae2f83dd767a..05dc71efb72038339b58fdec2fe4a091e7b0cd87 100644 (file)
@@ -238,6 +238,12 @@ ir_constant_propagation_visitor::constant_propagation(ir_rvalue **rvalue) {
       case GLSL_TYPE_BOOL:
         data.b[i] = found->constant->value.b[rhs_channel];
         break;
+      case GLSL_TYPE_UINT64:
+        data.u64[i] = found->constant->value.u64[rhs_channel];
+        break;
+      case GLSL_TYPE_INT64:
+        data.i64[i] = found->constant->value.i64[rhs_channel];
+        break;
       default:
         assert(!"not reached");
         break;