[Piglit] [PATCH 3/3] transform_feedback: extend testing of generated names for api matching

Timothy Arceri timothy.arceri at collabora.com
Tue Mar 15 11:48:30 UTC 2016


This tests an interface block array which has and array as a member,
importantly the members array size is large than the blocks array size.

This exposes a bug in Mesa where we incorrectly use the blocks array
size as well as the members after lowering the named interface block.

So Mesa thinks a valid name is:

WithInstArray[0].g[0][0] when it should be WithInstArray[0].g[0]

Running this on the Nvidia blob produces an error message which indicates
they have a similar bug:

   "Failed to link: error: Transform feedback varying WithInstArray[0].g[2]
   has index 2, but the array size is 2."
---
 .../execution/interface-blocks-api-access-members.c    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/spec/glsl-1.50/execution/interface-blocks-api-access-members.c b/tests/spec/glsl-1.50/execution/interface-blocks-api-access-members.c
index 22b6295..dfe04d2 100644
--- a/tests/spec/glsl-1.50/execution/interface-blocks-api-access-members.c
+++ b/tests/spec/glsl-1.50/execution/interface-blocks-api-access-members.c
@@ -67,16 +67,20 @@ static const char *gstext =
 	"out WithInstArray {\n"
 	"	float e;\n"
 	"	vec3 f;\n"
-	"} instArray[3];\n"
+	"	float g[3];\n"
+	"} instArray[2];\n"
 	"void main()\n"
 	"{\n"
 	"	a = 1.0;\n"
 	"	b = vec3(2.0);\n"
 	"	inst.c = 3.0;\n"
 	"	inst.d = vec3(4.0);\n"
-	"	for(int i = 0; i < 3; i++) {\n"
-	"		instArray[i].e = 5.0 + 2 * i;\n"
-	"		instArray[i].f = vec3(6.0 + 2 * i);\n"
+	"	for(int i = 0; i < 2; i++) {\n"
+	"		instArray[i].e = 5.0 + 5 * i;\n"
+	"		instArray[i].f = vec3(6.0 + 5 * i);\n"
+	"		for(int j = 0; j < 3; j++) {\n"
+	"			instArray[i].g[j] = instArray[i].e + 2.0 + j;\n"
+	"		}\n"
 	"	}\n"
 	"}\n";
 
@@ -88,7 +92,8 @@ static const char *valid_varying_names[] = {
 	"WithInst.c", "WithInst.d",
 	"WithInstArray[0].e", "WithInstArray[0].f",
 	"WithInstArray[1].e", "WithInstArray[1].f",
-	"WithInstArray[2].e", "WithInstArray[2].f"
+	"WithInstArray[0].g[0]", "WithInstArray[0].g[1]", "WithInstArray[0].g[2]",
+	"WithInstArray[1].g[0]", "WithInstArray[1].g[1]", "WithInstArray[1].g[2]"
 };
 
 static const char *invalid_varying_names[] = {
@@ -100,7 +105,8 @@ static const char *invalid_varying_names[] = {
 	"WithInstArray.e", "WithInstArray.f",
 	"instArray[0].e", "instArray[0].f",
 	"instArray[1].e", "instArray[1].f",
-	"instArray[2].e", "instArray[2].f"
+	"instArray[0].g[0]", "instArray[0].g[1]", "WithInstArray[0].g[3]",
+	"instArray[1].g[0]", "instArray[1].g[1]", "instArray[1].g[2]"
 };
 
 void
-- 
2.5.0



More information about the Piglit mailing list