diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-05-01 17:07:39 +0200 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-05-19 13:52:17 +0200 |
commit | c4228772a58c9af3c2da6d752d78d637de106c86 (patch) | |
tree | b1d1d96eb3d5371b6c9b7af81f89f753932fd539 /tests | |
parent | 41d045f8c1566ee6926fa29ef551edc434397d41 (diff) |
arb_bindless_texture: add ubo-named-block execution tests
In order to exercise setting resident handles directly to
uniform buffer objects.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/arb_bindless_texture/execution/images/ubo-named-block.shader_test | 51 | ||||
-rw-r--r-- | tests/spec/arb_bindless_texture/execution/samplers/ubo-named-block.shader_test | 37 |
2 files changed, 88 insertions, 0 deletions
diff --git a/tests/spec/arb_bindless_texture/execution/images/ubo-named-block.shader_test b/tests/spec/arb_bindless_texture/execution/images/ubo-named-block.shader_test new file mode 100644 index 000000000..12872402c --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/images/ubo-named-block.shader_test @@ -0,0 +1,51 @@ +# Test access to a uniform buffer object via dereferencing the block name, +# where it has a structure which contains a bindless image. +[require] +GL >= 3.3 +GLSL >= 3.30 +GL_ARB_bindless_texture +GL_ARB_shader_image_load_store + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable +#extension GL_ARB_uniform_buffer_object: enable + +struct Struct { + vec4 color; + writeonly image2D img; +}; + +layout (std140) uniform Block { + Struct s; +} block; + +out vec4 outcolor; + +void main() +{ + imageStore(block.s.img, ivec2(gl_FragCoord.xy), block.s.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 +uniform handle Block.s.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 Block.s.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/samplers/ubo-named-block.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/ubo-named-block.shader_test new file mode 100644 index 000000000..5c3c4785f --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/samplers/ubo-named-block.shader_test @@ -0,0 +1,37 @@ +# Test access to a uniform buffer object via dereferencing the block name, +# where it has a structure which contains a bindless sampler. +[require] +GL >= 3.3 +GLSL >= 3.30 +GL_ARB_bindless_texture + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_uniform_buffer_object: enable + +struct Struct { + uvec2 coord; + sampler2D tex; +}; + +layout (std140) uniform Block { + Struct s; +} block; + +out vec4 color; + +void main() +{ + color = texture2D(block.s.tex, block.s.coord); +} + +[test] +texture rgbw 0 (16, 16) +resident texture 0 +uniform uvec2 Block.s.coord 0 0 +uniform handle Block.s.tex 0 +draw rect -1 -1 2 2 +relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0) |