diff options
author | Timothy Arceri <tarceri@itsqueeze.com> | 2024-08-09 19:04:40 +1000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-08-12 01:42:39 +0000 |
commit | c11c9374c1448d01b31e7f724921cc1f4ee2c84c (patch) | |
tree | 9d8706e9423169172c27939ddb4aa91617b33af9 | |
parent | f11abb664bfcad09586f32f411b90331e23be2e5 (diff) |
arb_bindless_texture: test image/sampler constructors
Tests an issue that was causing a segfault in mesa due to the sampler
constructor being used directly as a parammeter to builtins.
Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11648
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/939>
-rw-r--r-- | tests/spec/arb_bindless_texture/compiler/images/direct-use-image-constructor.frag | 21 | ||||
-rw-r--r-- | tests/spec/arb_bindless_texture/compiler/samplers/direct-use-sampler-constructor.frag | 20 |
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/spec/arb_bindless_texture/compiler/images/direct-use-image-constructor.frag b/tests/spec/arb_bindless_texture/compiler/images/direct-use-image-constructor.frag new file mode 100644 index 000000000..b5750d65d --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/images/direct-use-image-constructor.frag @@ -0,0 +1,21 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require +#extension GL_ARB_shader_image_load_store: enable + +uniform uvec2 handle; + +out vec4 finalColor; + +void main() +{ + /* Test that using an image constructor directly in the imageStore + * builtin compiles as expected. + */ + imageStore(image2D(handle), ivec2(0, 0), vec4(1, 2, 3, 4)); +} diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/direct-use-sampler-constructor.frag b/tests/spec/arb_bindless_texture/compiler/samplers/direct-use-sampler-constructor.frag new file mode 100644 index 000000000..d7fb0f457 --- /dev/null +++ b/tests/spec/arb_bindless_texture/compiler/samplers/direct-use-sampler-constructor.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: pass +// glsl_version: 3.30 +// require_extensions: GL_ARB_bindless_texture +// [end config] + +#version 330 +#extension GL_ARB_bindless_texture: require + +uniform uvec2 handleOffset; + +out vec4 finalColor; + +void main() +{ + /* Test that using a sampler constructor directly in the texture + * builtin compiles as expected. + */ + finalColor = texture(samplerCube(handleOffset), vec3(0)); +} |