Tests loosely based on arb_arrays_of_arrays but with resident textures/images.
Signed-off-by: Samuel Pitoiset <[email protected]> --- .../fs-const-index-three-dimensions.shader_test | 45 +++++++++++ .../images/fs-struct-non-const-index.shader_test | 94 ++++++++++++++++++++++ .../fs-const-index-three-dimensions.shader_test | 35 ++++++++ .../samplers/fs-struct-non-const-index.shader_test | 90 +++++++++++++++++++++ 4 files changed, 264 insertions(+) create mode 100644 tests/spec/arb_bindless_texture/execution/images/fs-const-index-three-dimensions.shader_test create mode 100644 tests/spec/arb_bindless_texture/execution/images/fs-struct-non-const-index.shader_test create mode 100644 tests/spec/arb_bindless_texture/execution/samplers/fs-const-index-three-dimensions.shader_test create mode 100644 tests/spec/arb_bindless_texture/execution/samplers/fs-struct-non-const-index.shader_test diff --git a/tests/spec/arb_bindless_texture/execution/images/fs-const-index-three-dimensions.shader_test b/tests/spec/arb_bindless_texture/execution/images/fs-const-index-three-dimensions.shader_test new file mode 100644 index 000000000..251206f4d --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/images/fs-const-index-three-dimensions.shader_test @@ -0,0 +1,45 @@ +# Based on arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test +[require] +GLSL >= 3.30 +GL_ARB_arrays_of_arrays +GL_ARB_bindless_texture +GL_ARB_shader_image_load_store + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_bindless_texture: enable +#extension GL_ARB_shader_image_load_store: enable + +layout (bindless_image) uniform; + +uniform vec4 color; +writeonly uniform image2D img[2][2][2]; +out vec4 outcolor; + +void main() +{ + imageStore(img[1][0][1], 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 +uniform handle img[1][0][1] 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/fs-struct-non-const-index.shader_test b/tests/spec/arb_bindless_texture/execution/images/fs-struct-non-const-index.shader_test new file mode 100644 index 000000000..399bb7b47 --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/images/fs-struct-non-const-index.shader_test @@ -0,0 +1,94 @@ +# This test verifies that dynamically uniform indexing of image arrays +# in the fragment shader with resident textures behaves correctly. +# Based on arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test. +[require] +GLSL >= 3.30 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays +GL_ARB_bindless_texture +GL_ARB_shader_image_load_store + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_bindless_texture: enable +#extension GL_ARB_shader_image_load_store: enable + +layout (bindless_image) uniform; + +struct S { + writeonly image2D img; +}; + +uniform vec4 color; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +out vec4 outcolor; + +void main() +{ + imageStore(s[n][m].img, 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 +uniform handle s[0][0].img 0 + +# Texture 3 is the rendering output. We don't care about this. +texture rgbw 3 (16, 16) GL_RGBA8 + +# Store red using imageStore +uniform int n 0 +uniform int m 0 +uniform vec4 color 1.0 0.0 0.0 1.0 +fb tex 2d 3 +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 + +# Texture 1 is the imageStore output. +texture rgbw 1 (16, 16) GL_RGBA8 +resident image texture 1 GL_RGBA8 +uniform handle s[1][0].img 1 + +# Store green using imageStore +uniform int n 1 +uniform int m 0 +uniform vec4 color 0.0 1.0 0.0 1.0 +fb tex 2d 3 +draw rect -1 -1 2 2 + +# Test the result of imageStore +memory barrier GL_FRAMEBUFFER_BARRIER_BIT +fb tex 2d 1 +probe all rgba 0.0 1.0 0.0 1.0 + +# Texture 2 is the imageStore output. +texture rgbw 2 (16, 16) GL_RGBA8 +resident image texture 2 GL_RGBA8 +uniform handle s[0][1].img 2 + +# Store blue using imageStore +uniform int n 0 +uniform int m 1 +uniform vec4 color 0.0 0.0 1.0 1.0 +fb tex 2d 3 +draw rect -1 -1 2 2 + +# Test the result of imageStore +memory barrier GL_FRAMEBUFFER_BARRIER_BIT +fb tex 2d 2 +probe all rgba 0.0 0.0 1.0 1.0 diff --git a/tests/spec/arb_bindless_texture/execution/samplers/fs-const-index-three-dimensions.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/fs-const-index-three-dimensions.shader_test new file mode 100644 index 000000000..0b3275308 --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/samplers/fs-const-index-three-dimensions.shader_test @@ -0,0 +1,35 @@ +# Based on arb_arrays_of_arrays/execution/sampler/fs-const-index-three-dimensions.shader_test +[require] +GLSL >= 3.30 +GL_ARB_arrays_of_arrays +GL_ARB_bindless_texture + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_bindless_texture: enable + +layout (bindless_sampler) uniform; + +uniform sampler2D tex[2][2][2]; +out vec4 color; + +void main() +{ + color = texture(tex[1][0][1], vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest +texparameter 2D border_color 0.0 0.0 0.0 0.0 +resident texture 0 +uniform handle tex[1][0][1] 0 +draw rect -1 -1 1 1 +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) diff --git a/tests/spec/arb_bindless_texture/execution/samplers/fs-struct-non-const-index.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/fs-struct-non-const-index.shader_test new file mode 100644 index 000000000..09dfdcc06 --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/samplers/fs-struct-non-const-index.shader_test @@ -0,0 +1,90 @@ +# This test verifies that dynamically uniform indexing of sampler arrays +# in the fragment shader with resident textures behaves correctly. +# Based on arb_arrays_of_arrays/execution/sampler/fs-struct-non-const-index.shader_test. +[require] +GLSL >= 3.30 +GL_ARB_gpu_shader5 +GL_ARB_arrays_of_arrays +GL_ARB_bindless_texture + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_gpu_shader5: require +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_bindless_texture: enable + +layout (bindless_sampler) uniform; + +struct S { + sampler2D tex; +}; + +uniform S s[2][2]; + +uniform int n; +uniform int m; + +out vec4 color; + +void main() +{ + color = texture(s[n][m].tex, vec2(0.75, 0.25)); +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +texture checkerboard 0 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest +texparameter 2D border_color 0.0 0.0 0.0 0.0 +resident texture 0 +uniform handle s[0][0].tex 0 + +texture checkerboard 1 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest +texparameter 2D border_color 0.0 0.0 0.0 0.0 +resident texture 1 +uniform handle s[0][1].tex 1 + +texture checkerboard 2 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (0.0, 0.0, 1.0, 0.0) +texparameter 2D min nearest +texparameter 2D mag nearest +texparameter 2D border_color 0.0 0.0 0.0 0.0 +resident texture 2 +uniform handle s[1][0].tex 2 + +texture checkerboard 3 0 (32, 32) (0.5, 0.0, 0.0, 0.0) (1.0, 1.0, 1.0, 1.0) +texparameter 2D min nearest +texparameter 2D mag nearest +texparameter 2D border_color 0.0 0.0 0.0 0.0 +resident texture 3 +uniform handle s[1][1].tex 3 + +uniform int n 0 +uniform int m 0 +draw rect -1 -1 1 1 + +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int n 0 +uniform int m 1 +draw rect 0 -1 1 1 + +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int n 1 +uniform int m 0 +draw rect -1 0 1 1 + +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int n 1 +uniform int m 1 +draw rect 0 0 1 1 + +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) -- 2.12.2 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
