From 4b1116f3a32d95f5c3ed00880d74ae1d4a160781 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 23 Jul 2024 15:41:34 +1000 Subject: [PATCH] arb_bindless_texture: add another function param bindless test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- ...texture2D-local-var-function-params.shader_test | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/spec/arb_bindless_texture/execution/samplers/basic-texture2D-local-var-function-params.shader_test diff --git a/tests/spec/arb_bindless_texture/execution/samplers/basic-texture2D-local-var-function-params.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/basic-texture2D-local-var-function-params.shader_test new file mode 100644 index 000000000..550a2796b --- /dev/null +++ b/tests/spec/arb_bindless_texture/execution/samplers/basic-texture2D-local-var-function-params.shader_test @@ -0,0 +1,35 @@ +# Basic test to perform a texture lookup with a resident texture. This makes +# sure the function doesn't lose the information it needs after the +# sampler is stored in a local variable before being passed to the function. +[require] +GL >= 3.3 +GLSL >= 3.30 +GL_ARB_bindless_texture + +[vertex shader passthrough] + +[fragment shader] +#version 330 +#extension GL_ARB_bindless_texture: require + +layout (bindless_sampler) uniform sampler2D tex; + +out vec4 finalColor; + +vec4 func1(in sampler2D tex1) +{ + return texture2D(tex1, vec2(0, 0)); +} + +void main() +{ + sampler2D tex2 = tex; + finalColor = func1(tex2); +} + +[test] +texture rgbw 0 (16, 16) +resident texture 0 +uniform handle tex 0 +draw rect -1 -1 2 2 +relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0) -- 2.11.4.GIT