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

92 lines
1.5 KiB
Plaintext

#version 450
layout(local_size_x = 1) in;
struct M0
{
double v;
dvec2 b[2];
dmat2x3 c;
dmat3x2 d;
};
// Test buffer layout handling.
layout(std430, binding = 0) buffer SSBO0
{
dvec4 a;
M0 m0;
dmat4 b;
} ssbo_0;
layout(std430, binding = 1) buffer SSBO1
{
dmat4 a;
dvec4 b;
M0 m0;
} ssbo_1;
layout(std430, binding = 2) buffer SSBO2
{
double a[4];
dvec2 b[4];
} ssbo_2;
layout(std140, binding = 3) buffer SSBO3
{
double a[4];
dvec2 b[4];
} ssbo_3;
void main()
{
ssbo_0.a += dvec4(10, 20, 30, 40);
ssbo_0.a += 20;
dvec4 a = ssbo_0.a;
dmat4 amat = ssbo_0.b;
ssbo_0.a = abs(a);
ssbo_0.a = sign(a);
ssbo_0.a = floor(a);
ssbo_0.a = trunc(a);
ssbo_0.a = round(a);
ssbo_0.a = roundEven(a);
ssbo_0.a = ceil(a);
ssbo_0.a = fract(a);
ssbo_0.a = mod(a, 20.0);
ssbo_0.a = mod(a, a);
ssbo_0.a = min(a, a);
ssbo_0.a = max(a, a);
ssbo_0.a = clamp(a, a, a);
ssbo_0.a = mix(a, a, a);
ssbo_0.a = step(a, a);
ssbo_0.a = smoothstep(a, a, a);
bvec4 b = isnan(a);
bvec4 c = isinf(a);
double f = packDouble2x32(uvec2(10, 40));
uvec2 g = unpackDouble2x32(f);
double d = length(a);
d = distance(a, a);
d = dot(a, a);
dvec3 e = cross(a.xyz, a.yzw);
a = faceforward(a, a, a);
a = reflect(a, a);
a = refract(a, a, a.x);
dmat4 l = matrixCompMult(amat, amat);
l = outerProduct(a, a);
l = transpose(l);
double m = determinant(l);
l = inverse(l);
bvec4 k = lessThan(a, a);
k = lessThanEqual(a, a);
k = greaterThan(a, a);
k = greaterThanEqual(a, a);
ssbo_1.b.x += 1.0lf;
ssbo_2.b[0].x += 1.0lf;
ssbo_3.b[0].x += 1.0lf;
}