glsl/tests: add DOUBLE types
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 8 Feb 2015 08:42:51 +0000 (03:42 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 19 Feb 2015 05:28:35 +0000 (00:28 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/glsl/tests/uniform_initializer_utils.cpp

index 31dc9b78ae5098cdbc5f496053d3fecac39a7ef9..297f342c1b3f12f69684f8bee3c3dfaa9b73c1dd 100644 (file)
@@ -93,6 +93,9 @@ generate_data_element(void *mem_ctx, const glsl_type *type,
       case GLSL_TYPE_BOOL:
         data.b[i] = bool(values[idx]);
         break;
+      case GLSL_TYPE_DOUBLE:
+        data.d[i] = double(values[idx]);
+        break;
       case GLSL_TYPE_ATOMIC_UINT:
       case GLSL_TYPE_STRUCT:
       case GLSL_TYPE_ARRAY:
@@ -122,6 +125,9 @@ generate_data_element(void *mem_ctx, const glsl_type *type,
       case GLSL_TYPE_BOOL:
         ASSERT_EQ(data.b[i], val->value.b[i]);
         break;
+      case GLSL_TYPE_DOUBLE:
+        ASSERT_EQ(data.d[i], val->value.d[i]);
+        break;
       case GLSL_TYPE_ATOMIC_UINT:
       case GLSL_TYPE_STRUCT:
       case GLSL_TYPE_ARRAY:
@@ -223,6 +229,9 @@ verify_data(gl_constant_value *storage, unsigned storage_array_size,
         case GLSL_TYPE_BOOL:
            EXPECT_EQ(val->value.b[i] ? boolean_true : 0, storage[i].i);
            break;
+        case GLSL_TYPE_DOUBLE:
+           EXPECT_EQ(val->value.d[i], *(double *)&storage[i*2].i);
+           break;
          case GLSL_TYPE_ATOMIC_UINT:
         case GLSL_TYPE_STRUCT:
         case GLSL_TYPE_ARRAY: