yum-mirror/slang

Making it easier to work with shaders

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

James Helferty (NVIDIA)Enable metal tests (#8446)8086adc90

master
1.0 KiB32 linesraw
1//TEST:SIMPLE(filecheck=METALLIB): -target metallib
2//TEST:SIMPLE(filecheck=METAL): -target metal
3//TEST(compute, metal):COMPARE_COMPUTE(filecheck-buffer=BUF):-metal -compute -entry computeMain -output-using-type
4//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -output-using-type
5
6// Test that we always emit correct type for system value and insert conversion logic
7// if the declared type of the SV is different from the spec-defined type.
8
9//TEST_INPUT: ubuffer(data=[0], stride=1):out,name outputBuffer
10uniform RWStructuredBuffer<uint> outputBuffer;
11
12//TEST_INPUT: ubuffer(data=[5 0 0 0 0 0 0 0], stride=4, count=32):name buffer
13RWByteAddressBuffer buffer;
14
15// METALLIB: define void @computeMain
16
17struct TestStruct
18{
19    uint8_t a;
20    float b;
21}
22
23// METAL: void computeMain(uint3 tid{{.*}}
24// METAL: uint(int(tid{{.*}}.x))
25
26[numthreads(1,1,1)]
27void computeMain(int tid: SV_DispatchThreadID)
28{
29    buffer.Store(16, buffer.Load<TestStruct>(tid));
30    // BUF: 5
31    outputBuffer[0] = buffer.Load<TestStruct>(16).a;
32}