SPIRV-Cross/reference/shaders-msl/asm/comp/undefined-constant-composite.asm.comp
Chip Davis 06ef3de002 GLSL, MSL: Handle OpUndef as part of a constant composite.
Fixes the CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_constant_composite`
and helps with another,
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.
Unfortunately, fixing the latter requires another change.
2022-11-20 02:08:33 -08:00

39 lines
661 B
Plaintext

#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct _20
{
int _m0;
int _m1;
};
struct _5
{
int _m0[10];
};
struct _7
{
int _m0[10];
};
constant int _28 = {};
static inline __attribute__((always_inline))
int _39(thread const int& _41, thread const _20& _42)
{
return _41 + _42._m1;
}
kernel void main0(device _5& _6 [[buffer(0)]], device _7& _8 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
int _32 = _8._m0[gl_GlobalInvocationID.x];
_20 _33 = _20{ _28, 200 };
_6._m0[gl_GlobalInvocationID.x] = _39(_32, _33);
}