SPIRV-Cross/reference/shaders-msl-no-opt/comp/intmin-literal.comp
Hans-Kristian Arntzen f72bb3c6f5 Improve handling of INT_MIN/INT64_MIN literals.
We cannot naively convert these to decimal literals. C/C++ (and thus
MSL) has extremely awkward literal promotion rules.
2021-09-30 16:29:30 +02:00

23 lines
349 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO
{
float a;
};
struct UBO
{
float b;
};
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
kernel void main0(device SSBO& _9 [[buffer(0)]], constant UBO& _14 [[buffer(1)]])
{
_9.a = as_type<float>(as_type<int>(_14.b) ^ int(0x80000000));
}