您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

12 行
574 B

#pragma kernel ClearDispatchIndirect
#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch
RWBuffer<uint> g_DispatchIndirectBuffer : register( u0 ); // Indirect arguments have to be in a _buffer_, not a structured buffer
[numthreads(64, 1, 1)]
void ClearDispatchIndirect(uint dispatchThreadId : SV_DispatchThreadID)
{
g_DispatchIndirectBuffer[dispatchThreadId * 3 + 0] = 0; // ThreadGroupCountX
g_DispatchIndirectBuffer[dispatchThreadId * 3 + 1] = 1; // ThreadGroupCountY
g_DispatchIndirectBuffer[dispatchThreadId * 3 + 2] = 1; // ThreadGroupCountZ
}