SPIRV-Cross/shaders/desktop-only/comp/int64.desktop.comp
2016-09-10 12:53:41 +02:00

56 lines
948 B
Plaintext

#version 450
#extension GL_ARB_gpu_shader_int64 : require
layout(local_size_x = 1) in;
struct M0
{
int64_t v;
i64vec2 b[2];
uint64_t c;
uint64_t d[5];
};
// Test buffer layout handling.
layout(std430, binding = 0) buffer SSBO0
{
i64vec4 a;
M0 m0;
} ssbo_0;
layout(std430, binding = 1) buffer SSBO1
{
u64vec4 b;
M0 m0;
} ssbo_1;
layout(std430, binding = 2) buffer SSBO2
{
int64_t a[4];
i64vec2 b[4];
} ssbo_2;
layout(std140, binding = 3) buffer SSBO3
{
int64_t a[4];
i64vec2 b[4];
} ssbo_3;
void main()
{
ssbo_0.a += i64vec4(10, 20, 30, 40);
ssbo_1.b += u64vec4(999999999999999999ul, 8888888888888888ul, 77777777777777777ul, 6666666666666666ul);
ssbo_0.a += 20;
ssbo_0.a = abs(ssbo_0.a + i64vec4(ssbo_1.b));
ssbo_0.a++;
ssbo_1.b++;
ssbo_0.a--;
ssbo_1.b--;
ssbo_1.b = doubleBitsToUint64(int64BitsToDouble(ssbo_0.a));
ssbo_0.a = doubleBitsToInt64(uint64BitsToDouble(ssbo_1.b));
ssbo_2.a[0] += 1l;
ssbo_3.a[0] += 2l;
}