Commit 126b26fc authored by Karol Herbst's avatar Karol Herbst

arb_bindless_texture: rename vertex uniform test and add vertex attrib test

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's avatarKarol Herbst <kherbst@redhat.com>
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
parent c9cf17c8
# 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
# 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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment