File: spv.boolInBlock.frag

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (31 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#version 450

layout(binding = 0, std140) uniform Uniform
{
    bvec4 b4;
};

layout(binding = 1, std430) buffer Buffer
{
    bvec2 b2;
};

void foo(bvec4 paramb4, out bvec2 paramb2)
{
    bool b1 = paramb4.z;
    paramb2 = bvec2(b1);
}

layout(location = 0) out vec4 fragColor;

void main()
{
    b2 = bvec2(0.0);
    if (b4.z)
        b2 = bvec2(b4.x);
    if (b2.x)
        foo(b4, b2);

    fragColor  = vec4(b4.x && b4.y);
    fragColor -= vec4(b4.x || b4.y);
}