Files
SPIRV-Cross/shaders/comp/type-alias.comp
Hans-Kristian Arntzen 5ad4340976 Workaround case with identical structs but different types.
With the current workarounds for SSBO type aliasing, we have no choice
but to look at OpName in order to figure this out properly.
2016-05-28 09:47:52 +02:00

46 lines
537 B
Plaintext

#version 310 es
layout(local_size_x = 1) in;
struct S0
{
vec4 a;
};
struct S1
{
vec4 a;
};
vec4 overload(S0 s0)
{
return s0.a;
}
vec4 overload(S1 s1)
{
return s1.a;
}
layout(std430, binding = 0) buffer SSBO0
{
S0 s0s[];
};
layout(std430, binding = 1) buffer SSBO1
{
S1 s1s[];
};
layout(std430, binding = 2) buffer SSBO2
{
vec4 outputs[];
};
void main()
{
S0 s0 = s0s[gl_GlobalInvocationID.x];
S1 s1 = s1s[gl_GlobalInvocationID.x];
outputs[gl_GlobalInvocationID.x] = overload(s0) + overload(s1);
}