struct PixelIdData
{
    float4 id;
};

RWStructuredBuffer<PixelIdData> PixelIdOutput : register(u0, space1);

cbuffer UBO : register(b0, space2)
{
    int4 ubo_size : packoffset(c0);
};

[numthreads(64, 1, 1)]
void main(uint3 GlobalInvocationID : SV_DispatchThreadID)
{
    uint n = GlobalInvocationID.x;

    int2 r;
    r.y = n / ubo_size.x;
    r.x = n - r.y * ubo_size.x;

    PixelIdData pd;
    pd.id.x = r.x / (float)ubo_size.x;
    pd.id.y = r.y / (float) ubo_size.y;
    pd.id.z = 1;
    pd.id.w = 1;
    
    PixelIdOutput[n] = pd;
}
