[Piglit] [PATCH] varying-packing: use correct type for extra varyings

Timothy Arceri t_arceri at yahoo.com.au
Wed Nov 4 20:58:51 PST 2015


From: Timothy Arceri <timothy.arceri at collabora.com>

In order to make sure we use the all the room available in our
packing tests with vec3s we add some extra varyings to fill the
the remaining space. However they need to be the same type in order
to be packed together.

This fixes some failing tests.
---
 tests/spec/glsl-1.10/execution/varying-packing/simple.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tests/spec/glsl-1.10/execution/varying-packing/simple.c b/tests/spec/glsl-1.10/execution/varying-packing/simple.c
index 2b1c010..f555569 100644
--- a/tests/spec/glsl-1.10/execution/varying-packing/simple.c
+++ b/tests/spec/glsl-1.10/execution/varying-packing/simple.c
@@ -407,7 +407,20 @@ choose_varyings(struct varying_desc *varyings,
 		}
 	}
 	for (i = 0; i < num_extra_varyings; ++i) {
-		varyings[num_varyings].type = &float_type;
+		switch(test_type->base) {
+		case BASE_TYPE_UINT:
+			varyings[num_varyings].type = &uint_type;
+			break;
+		case BASE_TYPE_INT:
+			varyings[num_varyings].type = &int_type;
+			break;
+		case BASE_TYPE_FLOAT:
+			varyings[num_varyings].type = &float_type;
+			break;
+		case BASE_TYPE_DOUBLE:
+			varyings[num_varyings].type = &double_type;
+			break;
+		}
 		varyings[num_varyings].two_dim_array_elems = 0;
 		varyings[num_varyings].one_dim_array_elems = 0;
 		++num_varyings;
-- 
2.4.3



More information about the Piglit mailing list