SPIRV-Cross/shaders-msl-no-opt/comp/int64min-literal.msl22.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

22 lines
316 B
Plaintext

#version 450
#extension GL_ARB_gpu_shader_int64 : require
layout(local_size_x = 1) in;
layout(set = 0, binding = 1) buffer SSBO
{
float a;
};
layout(set = 0, binding = 0) uniform UBO
{
float b;
};
void main()
{
int64_t v = int64_t(floatBitsToInt(b));
v ^= 0x8000000000000000L;
a = intBitsToFloat(int(v));
}