[Piglit] [PATCH 6/9] ARB_get_program_binary: Test that uniforms are reset on program reload

Jordan Justen jordan.l.justen at intel.com
Sat Jun 9 05:48:04 UTC 2018


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 .../uniform-after-restore.shader_test         | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 tests/spec/arb_get_program_binary/execution/uniform-after-restore.shader_test

diff --git a/tests/spec/arb_get_program_binary/execution/uniform-after-restore.shader_test b/tests/spec/arb_get_program_binary/execution/uniform-after-restore.shader_test
new file mode 100644
index 000000000..5b18c04c2
--- /dev/null
+++ b/tests/spec/arb_get_program_binary/execution/uniform-after-restore.shader_test
@@ -0,0 +1,35 @@
+# From the ARB_get_program_binary extension spec:
+#
+# "A successful call to ProgramBinary will reset all uniform variables
+#  to their initial values. The initial value is either the value of
+#  the variable's initializer as specified in the original shader
+#  source, or 0 if no initializer was present."
+#
+
+[require]
+GLSL >= 1.20
+GL_NUM_PROGRAM_BINARY_FORMATS >= 1
+
+[vertex shader]
+void main()
+{
+    gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 120
+
+uniform vec4 color = vec4(0.0, 1.0, 0.0, 1.0);
+void main()
+{
+    gl_FragColor = color;
+}
+
+[test]
+uniform vec4 color 1.0 0.0 1.0 0.0
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 1.0 0.0
+uniform vec4 color 1.0 0.0 1.0 0.0
+program binary save restore
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.17.1



More information about the Piglit mailing list