[Mesa-dev,v5,29/29] glsl/tests: add DOUBLE/IMAGE types

Submitted by Ilia Mirkin on Feb. 10, 2015, 11:59 a.m.

Details

Message ID 1423569549-13866-30-git-send-email-imirkin@alum.mit.edu
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Ilia Mirkin Feb. 10, 2015, 11:59 a.m.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 src/glsl/tests/uniform_initializer_utils.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/glsl/tests/uniform_initializer_utils.cpp b/src/glsl/tests/uniform_initializer_utils.cpp
index 6f47acd..8c9d8cc 100644
--- a/src/glsl/tests/uniform_initializer_utils.cpp
+++ b/src/glsl/tests/uniform_initializer_utils.cpp
@@ -84,6 +84,7 @@  generate_data_element(void *mem_ctx, const glsl_type *type,
       case GLSL_TYPE_UINT:
       case GLSL_TYPE_INT:
       case GLSL_TYPE_SAMPLER:
+      case GLSL_TYPE_IMAGE:
 	 data.i[i] = values[idx];
 	 break;
       case GLSL_TYPE_FLOAT:
@@ -92,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:
@@ -112,6 +116,7 @@  generate_data_element(void *mem_ctx, const glsl_type *type,
       case GLSL_TYPE_UINT:
       case GLSL_TYPE_INT:
       case GLSL_TYPE_SAMPLER:
+      case GLSL_TYPE_IMAGE:
 	 ASSERT_EQ(data.i[i], val->value.i[i]);
 	 break;
       case GLSL_TYPE_FLOAT:
@@ -120,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:
@@ -212,6 +220,7 @@  verify_data(gl_constant_value *storage, unsigned storage_array_size,
 	 case GLSL_TYPE_UINT:
 	 case GLSL_TYPE_INT:
 	 case GLSL_TYPE_SAMPLER:
+         case GLSL_TYPE_IMAGE:
 	    EXPECT_EQ(val->value.i[i], storage[i].i);
 	    break;
 	 case GLSL_TYPE_FLOAT:
@@ -220,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:

Comments

On 10 February 2015 at 21:59, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>

This makes sense but the warning is there now, so I tore out the IMAGE
bits and pushed them.

The double bits are,

Reviewed-by: Dave Airlie <airlied@redhat.com>

Dave.