[Mesa-dev] [PATCH v3 29/29] glsl/tests: add DOUBLE/IMAGE types
Ilia Mirkin
imirkin at alum.mit.edu
Sun Feb 8 01:00:45 PST 2015
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/glsl/tests/uniform_initializer_utils.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/glsl/tests/uniform_initializer_utils.cpp b/src/glsl/tests/uniform_initializer_utils.cpp
index 6f47acd..272266f 100644
--- a/src/glsl/tests/uniform_initializer_utils.cpp
+++ b/src/glsl/tests/uniform_initializer_utils.cpp
@@ -92,12 +92,16 @@ 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:
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
+ case GLSL_TYPE_IMAGE:
ASSERT_TRUE(false);
break;
}
@@ -120,12 +124,16 @@ 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:
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
+ case GLSL_TYPE_IMAGE:
ASSERT_TRUE(false);
break;
}
@@ -220,12 +228,16 @@ 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:
case GLSL_TYPE_VOID:
case GLSL_TYPE_ERROR:
case GLSL_TYPE_INTERFACE:
+ case GLSL_TYPE_IMAGE:
ASSERT_TRUE(false);
break;
}
--
2.0.5
More information about the mesa-dev
mailing list