glsl: Add 64-bit integer support to uniform initialiser code
authorDave Airlie <airlied@redhat.com>
Wed, 8 Jun 2016 23:50:54 +0000 (09:50 +1000)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 20 Jan 2017 23:41:23 +0000 (15:41 -0800)
Just add support to the double case, same code should work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/link_uniform_initializers.cpp

index 994c2f4ed218d3240ed14cac27a5ca04445e9ad6..fe0841f472fa30b18f78c32569bae6c8f1a3045c 100644 (file)
@@ -64,14 +64,14 @@ copy_constant_to_storage(union gl_constant_value *storage,
          storage[i].f = val->value.f[i];
          break;
       case GLSL_TYPE_DOUBLE:
+      case GLSL_TYPE_UINT64:
+      case GLSL_TYPE_INT64:
          /* XXX need to check on big-endian */
          memcpy(&storage[i * 2].u, &val->value.d[i], sizeof(double));
          break;
       case GLSL_TYPE_BOOL:
          storage[i].b = val->value.b[i] ? boolean_true : 0;
          break;
-      case GLSL_TYPE_INT64:
-      case GLSL_TYPE_UINT64:
       case GLSL_TYPE_ARRAY:
       case GLSL_TYPE_STRUCT:
       case GLSL_TYPE_IMAGE: