Signed-off-by: Jordan Justen <[email protected]>
Cc: Francisco Jerez <[email protected]>
---
Francisco,

I was looking at your image-load-store branch. I noticed using
imageStore directly from a uniform results in:

brw_ir_svec4.h:94: brw::array_reg<R> brw::half(const brw::array_reg<R>&, 
unsigned int) [with R = fs_reg]: Assertion `reg_width(storage(reg)) == 16' 
failed.

-Jordan

 .../basic-imageStore-from-uniform.shader_test      | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 
tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test

diff --git 
a/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
 
b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
new file mode 100644
index 0000000..802eda0
--- /dev/null
+++ 
b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
@@ -0,0 +1,56 @@
+# Verify simple reading of a uniform and output to an image
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+
+[vertex shader]
+#version 130
+in vec4 piglit_vertex;
+
+void main()
+{
+       gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+
+uniform vec4 color;
+writeonly uniform image2D tex;
+out vec4 outcolor;
+
+void main()
+{
+       imageStore(tex, ivec2(gl_FragCoord.xy), color);
+       outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Texture 0 is the imageStore output.
+uniform int tex 0
+texture rgbw 0 (16, 16)
+image texture 0
+
+# Texture 1 is the rendering output. We don't care about this.
+texture rgbw 1 (16, 16)
+
+# Store red using imageStore
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 1
+draw rect -1 -1 2 2
+
+# Test the result of imageStore
+fb tex 2d 0
+probe all rgba 1.0 0.0 0.0 1.0
+
+# Store green using imageStore
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 1
+draw rect -1 -1 2 2
+
+# Test the result of imageStore
+fb tex 2d 0
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.1.1

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to