diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-05-19 14:10:49 +0200 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-05-22 09:50:54 +0200 |
commit | 439b7053a7cd8e7817cde979967642ceff4813db (patch) | |
tree | 30852b76971bae110c2eae5588f5cca96bdc2afd /tests | |
parent | 4a4ef79d305f078a3f796ec9d6c40216748eeb7e (diff) |
arb_bindless_texture: add new explicit-image-binding.shader_test
Similar to explicit-sampler-binding.shader_test but this one
exercices the explicit binding layout qualifier with
bound/bindless images.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test b/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test new file mode 100644 index 000000000..6a89440cb --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test @@ -0,0 +1,58 @@ +# In this test, perform an image store with a bound image, then create a +# resident image and pass the handle through the OpenGL API. +[require] +GL >= 4.2 +GLSL >= 4.20 +GL_ARB_bindless_texture +GL_ARB_shader_image_load_store + +[vertex shader passthrough] + +[fragment shader] +#version 420 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +uniform vec4 color; +layout (bindless_image, binding = 5) 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] +# Test with a bound image. +# Texture 5 is the imageStore output. +texture rgbw 5 (16, 16) GL_RGBA8 +image texture 5 GL_RGBA8 + +# 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 5 +probe all rgba 1.0 0.0 0.0 1.0 + +# Test with a bindless image. +texture rgbw 3 (16, 16) GL_RGBA8 +resident image texture 3 GL_RGBA8 +uniform handle tex 3 + +# 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 +memory barrier GL_FRAMEBUFFER_BARRIER_BIT +fb tex 2d 3 +probe all rgba 0.0 1.0 0.0 1.0 |