summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-07-10 14:10:33 -0700
committerGitHub <noreply@github.com>2024-07-10 14:10:33 -0700
commit82f308ca692878bfe9844b86629c6536b4cd0f0a (patch)
tree001eb3d90ea98e945c73c2659bc9415d254da366 /tests
parentb89421cb3b803165455020f5b70d582b6aec6e76 (diff)
Fix the invalid spirv generation for matrix cast (#4588)
Spirv doesn't have instruction to do the float cast for the matrix type. So we have to convert the matrix row by row, and then construct them to a new matrix. Update the unit test to make sure the cast won't miss any elements. Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/gh-4556.slang15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/bugs/gh-4556.slang b/tests/bugs/gh-4556.slang
index e5d938840..1f779e199 100644
--- a/tests/bugs/gh-4556.slang
+++ b/tests/bugs/gh-4556.slang
@@ -1,12 +1,15 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -compute -output-using-type -shaderobj
-//DISABLE_TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -compute -output-using-type -shaderobj
-//DISABLE_TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -glsl -compute -output-using-type -shaderobj
+//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -compute -output-using-type -shaderobj
+//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -glsl -compute -output-using-type -shaderobj
+//TEST(compute):SIMPLE(filecheck=SPIRV): -target spirv-asm -stage compute
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-mtl -compute -output-using-type -shaderobj
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -cpu -output-using-type -shaderobj
-//TEST_INPUT:ubuffer(data=[0.0 0.0], stride=4):out,name=outputBuffer
+//TEST_INPUT:ubuffer(data=[0.0 0.0 0.0 0.0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
+//SPIRV-NOT: Validation of generated SPIR-V failed
+
[shader("compute")]
[numthreads(1, 1, 1)]
void computeMain(uint3 id: SV_DispatchThreadID)
@@ -18,4 +21,10 @@ void computeMain(uint3 id: SV_DispatchThreadID)
outputBuffer[0] = (float)b[0][0];
// CHECK: 2.000000
outputBuffer[1] = (float)b[0][1];
+
+ // CHECK: 7.000000
+ outputBuffer[2] = (float)b[1][2];
+
+ // CHECK: 12.000000
+ outputBuffer[3] = (float)b[2][3];
}