SPIRV-Cross/reference/opt/shaders-msl/masking/write-outputs-block.mask-location-0.for-tess.vert
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

36 lines
762 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct V
{
float4 a;
float4 b;
float4 c;
float4 d;
};
struct main0_out
{
float4 m_22_b;
float4 m_22_c;
float4 m_22_d;
float4 gl_Position;
};
kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint3 spvStageInputSize [[grid_size]], device main0_out* spvOut [[buffer(28)]])
{
V _22 = {};
device main0_out& out = spvOut[gl_GlobalInvocationID.y * spvStageInputSize.x + gl_GlobalInvocationID.x];
if (any(gl_GlobalInvocationID >= spvStageInputSize))
return;
out.gl_Position = float4(1.0);
_22.a = float4(2.0);
_22.b = float4(3.0);
out.m_22_b = _22.b;
out.m_22_c = _22.c;
out.m_22_d = _22.d;
}