struct sb_t { float4 color; uint2 threadId; }; RWTexture2D outtx; ConsumeStructuredBuffer csb : register(u1); RWStructuredBuffer rwsb; [numthreads(1, 1, 1)] void main(uint3 nThreadId : SV_DispatchThreadID) { sb_t data = csb.Consume(); float2 coord = float2(data.threadId.xy); outtx[coord] = data.color; rwsb[coord.x] = rwsb.Load(coord.y); }