SPIRV-Cross/reference/shaders/desktop-only/comp/int64.desktop.comp
Hans-Kristian Arntzen 62613df5a5 Optimize for read-modify-writes.
Required for legacy loop increments.
2016-12-16 13:14:22 +01:00

53 lines
1.1 KiB
Plaintext

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