glsl: fix a crash in ir_print_visitor() for bindless samplers/images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 25 May 2017 17:12:12 +0000 (19:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 1 Jun 2017 09:54:06 +0000 (11:54 +0200)
Bindless samplers/images are represented with 64-bit unsigned
integers and they can be assigned with explicit constructors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/ir_print_visitor.cpp

index 43be940a2f716fb0be156135d8026f9a4a832b32..ba3c1e243fbc18f0706cf1520db4df0371b4bf7e 100644 (file)
@@ -492,7 +492,11 @@ void ir_print_visitor::visit(ir_constant *ir)
             else
                fprintf(f, "%f", ir->value.f[i]);
             break;
-        case GLSL_TYPE_UINT64:fprintf(f, "%" PRIu64, ir->value.u64[i]); break;
+        case GLSL_TYPE_SAMPLER:
+        case GLSL_TYPE_IMAGE:
+        case GLSL_TYPE_UINT64:
+            fprintf(f, "%" PRIu64, ir->value.u64[i]);
+            break;
         case GLSL_TYPE_INT64: fprintf(f, "%" PRIi64, ir->value.i64[i]); break;
         case GLSL_TYPE_BOOL:  fprintf(f, "%d", ir->value.b[i]); break;
         case GLSL_TYPE_DOUBLE: