https://github.com/shader-slang/slang
Raw File
Tip revision: c7d7a965c14318c07bd5b8ec60b960c2e95dfebd authored by Yong He on 14 March 2024, 21:58:24 UTC
Support `#include` with angle brackets. (#3773)
Tip revision: c7d7a96
semantic.slang
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -compute-dispatch 3,1,1 -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compute-dispatch 3,1,1 -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -compute-dispatch 3,1,1 -shaderobj
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compute-dispatch 3,1,1 -shaderobj

//TEST_INPUT:ubuffer(data=[0 0 0 0  0 0 0 0  0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID, uint3 groupID : SV_GroupID, uint3 groupThreadID : SV_GroupThreadId)
{
    outputBuffer[dispatchThreadID.x] = int((dispatchThreadID.x << 8) | (groupID.x << 4) | (groupThreadID.x));
}
back to top