yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakFix VVL errors on coopvec tests (#8541)f55f669d1

master
1.6 KiB45 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
2//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
3
4// Disabled because HLSL can't multiply from *RW*ByteAddressBuffers
5//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_9 -Xslang... -Xdxc -Vd -X.
6
7// CHECK: type: int32_t
8// CHECK-NEXT: 30
9// CHECK-NEXT: 70
10// CHECK-NEXT: 110
11// CHECK-NEXT: 150
12
13//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
14RWStructuredBuffer<int32_t> outputBuffer;
15//TEST_INPUT:ubuffer(data=[67305985], stride=4),name=input
16//[1 2 3 4]
17ByteAddressBuffer input;
18
19//TEST_INPUT:ubuffer(data=[67305985 134678021 202050057 269422093], stride=4),name=matrix
20//[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
21RWByteAddressBuffer matrix;
22
23[numthreads(1, 1, 1)]
24void computeMain()
25{
26    // Expected to fail with Vulkan 1.4.313.0 or below due to a bug in the VVL
27    // The VVL incorrectly reports that the result type in the following command is `VK_COMPONENT_TYPE_UINT32_KHR`.
28    // Tracking the issue in github #7715.
29
30    let vec = coopVecLoad<1, uint32_t>(input);
31    CoopVec<int32_t, 4> result = coopVecMatMulPacked<int32_t, 4>(
32        vec,
33        CoopVecComponentType::SignedInt8Packed,
34        4,
35        matrix,
36        0,
37        CoopVecComponentType::SignedInt8,
38        CoopVecMatrixLayout::RowMajor,
39        false,
40        4
41    );
42
43    for(int i = 0; i < result.getCount(); ++i)
44        outputBuffer[i] = result[i];
45}