[Mesa-dev] [PATCH 08/23] glsl: add 64-bit integer support to uniform initialiser code

Dave Airlie airlied at gmail.com
Thu Jun 9 00:48:09 UTC 2016


From: Dave Airlie <airlied at redhat.com>

Just add support to the double case, same code should work.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/compiler/glsl/link_uniform_initializers.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp
index bec2dae..401e8fc 100644
--- a/src/compiler/glsl/link_uniform_initializers.cpp
+++ b/src/compiler/glsl/link_uniform_initializers.cpp
@@ -64,6 +64,8 @@ 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 */
          storage[i * 2].u = *(uint32_t *)&val->value.d[i];
          storage[i * 2 + 1].u = *(((uint32_t *)&val->value.d[i]) + 1);
@@ -71,8 +73,6 @@ copy_constant_to_storage(union gl_constant_value *storage,
       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:
-- 
2.5.5



More information about the mesa-dev mailing list