[Piglit] [PATCH] arb_shader_subroutine: test subroutine uniform array with explicit location

Timothy Arceri timothy.arceri at collabora.com
Sun Jan 17 15:42:26 PST 2016


Currently segfaults in Mesa.
---
 ...array-subroutines-explicit-location.shader_test | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 tests/spec/arb_shader_subroutine/execution/array-subroutines-explicit-location.shader_test

diff --git a/tests/spec/arb_shader_subroutine/execution/array-subroutines-explicit-location.shader_test b/tests/spec/arb_shader_subroutine/execution/array-subroutines-explicit-location.shader_test
new file mode 100644
index 0000000..5bf0419
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/execution/array-subroutines-explicit-location.shader_test
@@ -0,0 +1,51 @@
+# test calling subroutine uniforms in an array
+# with a constant value works.
+[require]
+GLSL >= 1.50
+GL_ARB_explicit_attrib_location
+GL_ARB_explicit_uniform_location
+GL_ARB_shader_subroutine
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_explicit_attrib_location : require
+#extension GL_ARB_explicit_uniform_location : require
+#extension GL_ARB_shader_subroutine: enable
+
+out vec4 color;
+
+subroutine float getchan1();
+
+layout(location = 4) subroutine uniform getchan1 GetChan1[2];
+
+subroutine(getchan1)
+float chan_full()
+{
+	return 1.0;
+}
+
+subroutine(getchan1)
+float chan_empty()
+{
+	return 0.0;
+}
+
+void main()
+{
+	color = vec4(GetChan1[0](), GetChan1[1](), 0.0, 1.0);
+}
+
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+subuniform GL_FRAGMENT_SHADER GetChan1[0] chan_full
+subuniform GL_FRAGMENT_SHADER GetChan1[1] chan_empty
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.0 1.0
+subuniform GL_FRAGMENT_SHADER GetChan1[0] chan_empty
+subuniform GL_FRAGMENT_SHADER GetChan1[1] chan_full
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.4.3



More information about the Piglit mailing list