hits an assert in gallium:
../src/mesa/state_tracker/st_atom_array.c:251: st_pipe_vertex_format: Assertion 
`attrib->_ElementSize == _mesa_bytes_per_vertex_attrib(size, type)' failed.

v2: add test for iamges as well

Signed-off-by: Karol Herbst <kher...@redhat.com>
---
 .../image-vertex-attrib-input-output.shader_test   | 58 ++++++++++++++++++++++
 ... image-vertex-uniform-input-output.shader_test} |  0
 .../sampler-vertex-attrib-input-output.shader_test | 41 +++++++++++++++
 ...ampler-vertex-uniform-input-output.shader_test} |  0
 4 files changed, 99 insertions(+)
 create mode 100644 
tests/spec/arb_bindless_texture/execution/images/image-vertex-attrib-input-output.shader_test
 rename 
tests/spec/arb_bindless_texture/execution/images/{image-input-output.shader_test
 => image-vertex-uniform-input-output.shader_test} (100%)
 create mode 100644 
tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-attrib-input-output.shader_test
 rename 
tests/spec/arb_bindless_texture/execution/samplers/{sampler-input-output.shader_test
 => sampler-vertex-uniform-input-output.shader_test} (100%)

diff --git 
a/tests/spec/arb_bindless_texture/execution/images/image-vertex-attrib-input-output.shader_test
 
b/tests/spec/arb_bindless_texture/execution/images/image-vertex-attrib-input-output.shader_test
new file mode 100644
index 000000000..5b14aa03d
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/execution/images/image-vertex-attrib-input-output.shader_test
@@ -0,0 +1,58 @@
+# In this test, the image to use is selected in a vertex shader, passed
+# to the fragment shader as a (flat) input, and then used for an image store.
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+GL_ARB_shader_image_load_store
+
+[vertex shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+in writeonly image2D img;
+in vec4 piglit_vertex;
+
+flat out writeonly image2D image_vs;
+
+void main()
+{
+       gl_Position = piglit_vertex;
+       image_vs = img;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+flat in writeonly image2D image_vs;
+
+uniform vec4 color;
+out vec4 outcolor;
+
+void main()
+{
+       imageStore(image_vs, ivec2(gl_FragCoord.xy), color);
+       outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Texture 0 is the imageStore output.
+texture rgbw 0 (16, 16) GL_RGBA8
+resident image texture 0 GL_RGBA8
+vertex attrib handle img 0
+
+# Texture 1 is the rendering output. We don't care about this.
+texture rgbw 1 (16, 16) GL_RGBA8
+
+# 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
+memory barrier GL_FRAMEBUFFER_BARRIER_BIT
+fb tex 2d 0
+probe all rgba 1.0 0.0 0.0 1.0
diff --git 
a/tests/spec/arb_bindless_texture/execution/images/image-input-output.shader_test
 
b/tests/spec/arb_bindless_texture/execution/images/image-vertex-uniform-input-output.shader_test
similarity index 100%
rename from 
tests/spec/arb_bindless_texture/execution/images/image-input-output.shader_test
rename to 
tests/spec/arb_bindless_texture/execution/images/image-vertex-uniform-input-output.shader_test
diff --git 
a/tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-attrib-input-output.shader_test
 
b/tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-attrib-input-output.shader_test
new file mode 100644
index 000000000..00005187b
--- /dev/null
+++ 
b/tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-attrib-input-output.shader_test
@@ -0,0 +1,41 @@
+# In this test, the sampler to use is selected in a vertex shader, passed
+# to the fragment shader as a (flat) input, and then used for a texture
+# lookup.
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+
+[vertex shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+in sampler2D tex;
+in vec4 piglit_vertex;
+
+flat out sampler2D sampler_vs;
+
+void main()
+{
+       gl_Position = piglit_vertex;
+       sampler_vs = tex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+flat in sampler2D sampler_vs;
+out vec4 color;
+
+void main()
+{
+       color = texture2D(sampler_vs, vec2(0, 0));
+}
+
+[test]
+texture rgbw 0 (16, 16)
+resident texture 0
+vertex attrib handle tex 0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
diff --git 
a/tests/spec/arb_bindless_texture/execution/samplers/sampler-input-output.shader_test
 
b/tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-uniform-input-output.shader_test
similarity index 100%
rename from 
tests/spec/arb_bindless_texture/execution/samplers/sampler-input-output.shader_test
rename to 
tests/spec/arb_bindless_texture/execution/samplers/sampler-vertex-uniform-input-output.shader_test
-- 
2.14.3

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to