SPIRV-Cross/reference/shaders-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
Hans-Kristian Arntzen a0c13e4ee8 Do not consider aliased struct types if the master is not a block.
It is possible for a shader to declare two plain struct types which
simply share the same OpName without there being an implicit
value/buffer alias relationship.

For to_member_name(), make sure to use the type alias master when
resolving member names. The member name may be different in a type alias
master if the SPIR-V is being intentionally difficult.
2019-10-07 10:52:16 +02:00

31 lines
351 B
Plaintext

#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
struct T
{
float c;
};
struct T_1
{
float b;
};
layout(binding = 0, std430) buffer SSBO1
{
T_1 foo[];
} _7;
layout(binding = 1, std140) buffer SSBO2
{
T bar[];
} _10;
void main()
{
T v = T(40.0);
_7.foo[10].b = v.c;
_10.bar[30].c = v.c;
}