Rasagar/Library/PackageCache/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldClearIndirectArgs.compute
2024-08-26 23:07:20 +03:00

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
}