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

24 lines
349 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()
{
double b2 = b;
int64_t v = doubleBitsToInt64(b2);
v ^= 0x8000000000000000L;
double a2 = int64BitsToDouble(v);
a = float(a2);
}