19 lines
647 B
Plaintext
19 lines
647 B
Plaintext
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
||
|
|
||
|
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
|
||
|
|
||
|
#pragma kernel KClear
|
||
|
|
||
|
// Indirect arguments have to be in a RWBuffer
|
||
|
// The first three uints are near threadgroups, the last three are far threadgroups
|
||
|
RWBuffer<uint> _IndirectBuffer;
|
||
|
|
||
|
|
||
|
[numthreads(2, 1, 1)]
|
||
|
void KClear(uint dispatchThreadId : SV_DispatchThreadID)
|
||
|
{
|
||
|
_IndirectBuffer[dispatchThreadId * 3 ] = 0; // ThreadGroupCountX
|
||
|
_IndirectBuffer[dispatchThreadId * 3 + 1] = 1; // ThreadGroupCountY
|
||
|
_IndirectBuffer[dispatchThreadId * 3 + 2] = 1; // ThreadGroupCountZ
|
||
|
}
|