SPIRV-Cross/reference/opt/shaders-hlsl/comp/access-chains.comp

22 lines
596 B
Plaintext
Raw Normal View History

2017-11-22 11:08:06 +00:00
RWByteAddressBuffer wo : register(u1);
ByteAddressBuffer ro : register(t0);
2017-11-22 11:08:06 +00:00
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
wo.Store4(gl_GlobalInvocationID.x * 64 + 272, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 64 + 160))));
wo.Store4(gl_GlobalInvocationID.x * 16 + 480, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 16 + 480))));
}
[numthreads(1, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}