[Piglit] [PATCH 1/2] glsl-1.40: Don't use embedded structure definitions

Ian Romanick idr at freedesktop.org
Fri Aug 16 13:33:41 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

NVIDIA's compiler (304.64 on a GTX 260) generates the error messages:

0(5) : error C7539: GLSL 1.20 does not allow nested structs
0(9) : error C7539: GLSL 1.20 does not allow nested structs

Our compiler was even generating the error messages:

0:7(2): error: embedded structure declartions are not allowed
0:13(2): error: embedded structure declartions are not allowed

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../uniform_buffer/fs-struct-pad.shader_test       | 27 +++++++++++++---------
 .../uniform_buffer/vs-struct-pad.shader_test       | 27 +++++++++++++---------
 2 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/tests/spec/glsl-1.40/uniform_buffer/fs-struct-pad.shader_test b/tests/spec/glsl-1.40/uniform_buffer/fs-struct-pad.shader_test
index a2202ff..b2a0141 100644
--- a/tests/spec/glsl-1.40/uniform_buffer/fs-struct-pad.shader_test
+++ b/tests/spec/glsl-1.40/uniform_buffer/fs-struct-pad.shader_test
@@ -14,18 +14,23 @@ void main()
 [fragment shader]
 #version 140
 
+struct S1 {
+	float r;
+};
+
+struct S2 {
+	float g;
+	float b;
+	float a;
+};
+
+struct S {
+       S1 s1;
+       S2 s2;
+};
+
 uniform ubo1 {
-	struct S {
-		struct S1 {
-			float r;
-		} s1;
-
-		struct S2 {
-			float g;
-			float b;
-			float a;
-		} s2;
-	} s;
+	S s;
 };
 
 void main()
diff --git a/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad.shader_test b/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad.shader_test
index 7390ea8..b283b69 100644
--- a/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad.shader_test
+++ b/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad.shader_test
@@ -4,18 +4,23 @@ GLSL >= 1.40
 [vertex shader]
 #version 140
 
+struct S1 {
+	float r;
+};
+
+struct S2 {
+	float g;
+	float b;
+	float a;
+};
+
+struct S {
+       S1 s1;
+       S2 s2;
+};
+
 uniform ubo1 {
-	struct S {
-		struct S1 {
-			float r;
-		} s1;
-
-		struct S2 {
-			float g;
-			float b;
-			float a;
-		} s2;
-	} s;
+	S s;
 };
 
 in vec4 vertex;
-- 
1.8.1.4



More information about the Piglit mailing list