SPIRV-Cross/reference/shaders/asm/comp/block-name-alias-global.asm.comp
Hans-Kristian Arntzen 9728f9c1b7 Use correct block-name / other-name aliasing rules.
A block name cannot alias with any name in its own scope,
and it cannot alias with any other "global" name.

To solve this, we need to complicate the name cache updates a little bit
where we have a "primary" namespace and "secondary" namespace.
2019-01-04 15:02:54 +01:00

44 lines
748 B
Plaintext

#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
struct A
{
int a;
int b;
};
struct A_1
{
int a;
int b;
};
layout(binding = 1, std430) buffer C1
{
A Data[];
} C1_1;
layout(binding = 2, std140) uniform C2
{
A_1 Data[1024];
} C2_1;
layout(binding = 0, std430) buffer B
{
A Data[];
} C3;
layout(binding = 3, std140) uniform B
{
A_1 Data[1024];
} C4;
void main()
{
C1_1.Data[gl_GlobalInvocationID.x].a = C2_1.Data[gl_GlobalInvocationID.x].a;
C1_1.Data[gl_GlobalInvocationID.x].b = C2_1.Data[gl_GlobalInvocationID.x].b;
C3.Data[gl_GlobalInvocationID.x].a = C4.Data[gl_GlobalInvocationID.x].a;
C3.Data[gl_GlobalInvocationID.x].b = C4.Data[gl_GlobalInvocationID.x].b;
}