SPIRV-Cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag
Hans-Kristian Arntzen 3b5c4c7316 Implement constant empty struct correctly on all backends.
MSL actually supports empty structs, so enable that path as well.
2019-10-26 16:10:11 +02:00

30 lines
525 B
JavaScript

#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct EmptyStructTest
{
};
static inline __attribute__((always_inline))
float GetValue(thread const EmptyStructTest& self)
{
return 0.0;
}
static inline __attribute__((always_inline))
float GetValue_1(EmptyStructTest self)
{
return 0.0;
}
fragment void main0()
{
EmptyStructTest emptyStruct;
float value = GetValue(emptyStruct);
value = GetValue_1(EmptyStructTest{ });
}