SPIRV-Cross/reference/shaders-msl/tese/in-block-with-nested-struct.tese
Bill Hollings 0c0fd98322 MSL: Use var name instead of var-type name for flattened interface members.
This allows two variables of the same struct type to be flattened
into the same interface struct without a member name conflict.

Add shaders-msl/frag/in_block_with_multiple_structs_of_same_type.frag
unit test shader to demonstrate this.
2022-03-04 11:38:53 -05:00

45 lines
1.1 KiB
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct t35
{
float2 m0;
float4 m1;
};
struct t36
{
float2 m0;
t35 m1;
};
struct main0_out
{
float v80 [[user(locn0)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float2 v40_m0 [[attribute(0)]];
float2 v40_m1_m0 [[attribute(1)]];
float4 v40_m1_m1 [[attribute(2)]];
};
struct main0_patchIn
{
patch_control_point<main0_in> gl_in;
};
[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], float3 gl_TessCoord [[position_in_patch]])
{
main0_out out = {};
out.gl_Position = float4((gl_TessCoord.xy * 2.0) - float2(1.0), 0.0, 1.0);
float v34 = ((float(abs(patchIn.gl_in[0].v40_m1_m1.x - (-4.0)) < 0.001000000047497451305389404296875) * float(abs(patchIn.gl_in[0].v40_m1_m1.y - (-9.0)) < 0.001000000047497451305389404296875)) * float(abs(patchIn.gl_in[0].v40_m1_m1.z - 3.0) < 0.001000000047497451305389404296875)) * float(abs(patchIn.gl_in[0].v40_m1_m1.w - 7.0) < 0.001000000047497451305389404296875);
out.v80 = v34;
return out;
}