yum-mirror/slang

Making it easier to work with shaders

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

James Helferty (NVIDIA)render-test: Change D3D12 default to sm_6_5 (#8320)f02b08490

master
1.0 KiB28 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly
2//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.
3//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
4
5// CHECK: type: float
6// CHECK-NEXT: 2.000000
7// CHECK-NEXT: 4.000000
8// CHECK-NEXT: 6.000000
9// CHECK-NEXT: 8.000000
10
11//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
12RWStructuredBuffer<float> outputBuffer;
13
14//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4),name=input
15ByteAddressBuffer input;
16
17[numthreads(1, 1, 1)]
18void computeMain()
19{
20    let intVec = coopVecLoad<4, int>(input);
21    let floatVec = CoopVec<float, 4>(intVec);
22    let uintVec = CoopVec<uint, 4>(intVec);
23    let floatVec2 = CoopVec<float, 4>(uintVec);
24
25    let result = floatVec + floatVec2;
26    for(int i = 0; i < result.getCount(); ++i)
27        outputBuffer[i] = result[i];
28}