You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
544 B
Plaintext

4 years ago

#include "./../../../GPUInstancer/Resources/Compute/Include/PlatformDefines.compute"
#pragma kernel CSOptionalRendererBufferCopy
uniform RWStructuredBuffer<float4x4> childInstanceData;
uniform StructuredBuffer<float4x4> parentInstanceData;
uniform uint instanceCount;
[numthreads(GPUI_THREADS, 1, 1)]
void CSOptionalRendererBufferCopy(uint3 id : SV_DispatchThreadID)
{
if (id.x >= instanceCount)
return;
if (length(childInstanceData[id.x]._11_12_13) > 0)
childInstanceData[id.x] = parentInstanceData[id.x];
}