mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 04:53:06 +01:00
20 lines
391 B
Plaintext
20 lines
391 B
Plaintext
struct sb_t
|
|
{
|
|
float4 color;
|
|
uint2 threadId;
|
|
};
|
|
|
|
RWTexture2D<float4> outtx;
|
|
ConsumeStructuredBuffer<sb_t> csb : register(u1);
|
|
RWStructuredBuffer<float4> 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);
|
|
}
|