https://github.com/shader-slang/slang
Raw File
Tip revision: b4f94629f225b837e7102acc337610c5d4d8a7c1 authored by Tim Foley on 05 January 2021, 17:00:00 UTC
Use "capability" system to select VKRT extension (#1647)
Tip revision: b4f9462
semantic.slang
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -compute-dispatch 3,1,1
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compute-dispatch 3,1,1
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -compute-dispatch 3,1,1
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compute-dispatch 3,1,1

//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] = (dispatchThreadID.x << 8) | (groupID.x << 4) | (groupThreadID.x);
}
back to top