yum-mirror/slang

Making it easier to work with shaders

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

Yong HeMetal: misc fixes and enable more tests. (#4374)cfef0c6f6

master
597 B16 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
2//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
3
4//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
5RWStructuredBuffer<uint> outputBuffer;
6
7[numthreads(1, 1, 1)]
8void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
9{
10     {
11        int16_t a = 30000;      // 0x00007530 -> 0x7530 (30000) in 16-bit.
12        int16_t b = int16_t(-200000);    // 0xfffcf2c0 -> Truncated to 0xf2c0 (-3392) in 16-bit.
13        outputBuffer[0] = asuint((int)a);
14        outputBuffer[1] = asuint((int)b);
15    }
16}