summaryrefslogtreecommitdiff
path: root/tests/bugs
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-06-08 05:12:49 -0700
committerGitHub <noreply@github.com>2024-06-08 05:12:49 -0700
commit9a23a9aab3721828526c921db1e779008e133e8f (patch)
treeb49448075cdffe278fd6760e2879bc061eb8e0af /tests/bugs
parentbc680e74bd8a0c415cab5ed6fe00b762c26b8b8d (diff)
SPIRV `Block` decoration fixes. (#4303)
* SPIRV `Block` decoration fixes. - SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them. - Also fixes duplication of OpName. - SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code. * Convert failing cross-compile tests to filecheck. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/gh-941.slang6
-rw-r--r--tests/bugs/vk-image-atomics.slang6
-rw-r--r--tests/bugs/vk-structured-buffer-binding.hlsl6
-rw-r--r--tests/bugs/vk-structured-buffer-binding.hlsl.glsl24
4 files changed, 15 insertions, 27 deletions
diff --git a/tests/bugs/gh-941.slang b/tests/bugs/gh-941.slang
index f66c25e97..f0e5a7036 100644
--- a/tests/bugs/gh-941.slang
+++ b/tests/bugs/gh-941.slang
@@ -1,7 +1,11 @@
-//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK): -profile spirv_1_5+fragment -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=GLSL): -profile spirv_1_5+fragment -entry main -target glsl
// Ensure that we add the `GL_EXT_nonuniform_qualifier` extension for any code that uses unbounded-size arrays of resources.
+// CHECK: OpCapability RuntimeDescriptorArray
+// GLSL: #extension GL_EXT_nonuniform_qualifier : require
+
Texture2D t[];
SamplerState s;
diff --git a/tests/bugs/vk-image-atomics.slang b/tests/bugs/vk-image-atomics.slang
index f846606f9..f5b2821ec 100644
--- a/tests/bugs/vk-image-atomics.slang
+++ b/tests/bugs/vk-image-atomics.slang
@@ -1,7 +1,11 @@
-//TEST:CROSS_COMPILE: -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly -emit-spirv-via-glsl
// Ensure that we can lower to `imageAtomicAdd` correctly.
+// CHECK: OpImageTexelPointer
+// CHECK: OpAtomicIAdd
+
RWTexture2D<uint> t;
float4 main() : SV_Target
diff --git a/tests/bugs/vk-structured-buffer-binding.hlsl b/tests/bugs/vk-structured-buffer-binding.hlsl
index 3ef1bcc8c..da0424543 100644
--- a/tests/bugs/vk-structured-buffer-binding.hlsl
+++ b/tests/bugs/vk-structured-buffer-binding.hlsl
@@ -1,4 +1,8 @@
-//TEST:CROSS_COMPILE:-profile ps_4_0 -entry main -target spirv-assembly
+//TEST:SIMPLE(filecheck=CHECK):-profile ps_4_0 -entry main -target spirv-assembly
+
+// CHECK-DAG: OpDecorate %gDoneGroups{{.*}} DescriptorSet 4
+
+// CHECK-DAG: OpDecorate %gDoneGroups{{.*}} Binding 3
[[vk::binding(3, 4)]]
RWStructuredBuffer<uint> gDoneGroups : register(u3);
diff --git a/tests/bugs/vk-structured-buffer-binding.hlsl.glsl b/tests/bugs/vk-structured-buffer-binding.hlsl.glsl
deleted file mode 100644
index 18ed1a8a7..000000000
--- a/tests/bugs/vk-structured-buffer-binding.hlsl.glsl
+++ /dev/null
@@ -1,24 +0,0 @@
-// vk-structured-buffer-binding.hlsl.glsl
-//TEST_IGNORE_FILE:
-
-#version 450
-layout(row_major) uniform;
-layout(row_major) buffer;
-
-layout(std430, binding = 3, set = 4) buffer StructuredBuffer_uint_t_0 {
- uint _data[];
-} gDoneGroups_0;
-
-layout(location = 0)
-out vec4 main_0;
-
-layout(location = 0)
-in vec3 uv_0;
-
-void main()
-{
- main_0 = vec4(float(gDoneGroups_0._data[uint(int(uv_0.z))]));
- return;
-}
-
-