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
870 B23 linesraw
1//TEST_CATEGORY(wave-mask, compute)
2//DISABLE_TEST:COMPARE_COMPUTE_EX:-cpu -compute -shaderobj
3//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -shaderobj
4//TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -profile cs_6_0 -shaderobj
5//TEST(vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
6//TEST:COMPARE_COMPUTE_EX:-cuda -compute -shaderobj
7//TEST:COMPARE_COMPUTE_EX:-metal -compute -shaderobj
8
9//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer
10RWStructuredBuffer<int> outputBuffer;
11
12[numthreads(4, 1, 1)]
13void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
14{
15    int idx = int(dispatchThreadID.x);
16    
17    WaveMask mask = WaveGetActiveMask();
18    uint4 multi = WaveGetActiveMulti();
19    
20    // Should be 0xf, because numthreads is 4, 1, 1
21    outputBuffer[idx * 2 + 0] = int(mask);
22    outputBuffer[idx * 2 + 1] = int(multi.x);
23}