diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/gh-941.slang | 17 | ||||
| -rw-r--r-- | tests/bugs/gh-941.slang.glsl | 38 |
2 files changed, 55 insertions, 0 deletions
diff --git a/tests/bugs/gh-941.slang b/tests/bugs/gh-941.slang new file mode 100644 index 000000000..f66c25e97 --- /dev/null +++ b/tests/bugs/gh-941.slang @@ -0,0 +1,17 @@ +//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly + +// Ensure that we add the `GL_EXT_nonuniform_qualifier` extension for any code that uses unbounded-size arrays of resources. + +Texture2D t[]; +SamplerState s; + +cbuffer C +{ + float2 uv; + uint index; +} + +float4 main() : SV_Target +{ + return t[index].Sample(s, uv); +} diff --git a/tests/bugs/gh-941.slang.glsl b/tests/bugs/gh-941.slang.glsl new file mode 100644 index 000000000..d3c29820d --- /dev/null +++ b/tests/bugs/gh-941.slang.glsl @@ -0,0 +1,38 @@ +//TEST_IGNORE_FILE: + +#version 450 + +#extension GL_EXT_nonuniform_qualifier : require + +struct SLANG_ParameterGroup_C_0 +{ + vec2 uv_0; + uint index_0; +}; + +layout(binding = 2) +layout(std140) +uniform _S1 +{ + SLANG_ParameterGroup_C_0 _data; +} C_0; + +layout(binding = 0) +uniform texture2D t_0[]; + +layout(binding = 1) +uniform sampler s_0; + +layout(location = 0) +out vec4 _S2; + +void main() +{ + vec4 _S3 = texture( + sampler2D( + t_0[C_0._data.index_0], + s_0), + C_0._data.uv_0); + _S2 = _S3; + return; +}
\ No newline at end of file |
