yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Wint3rNightEmit spec constant && and || as OpSpecConstantOp81f3df51

main
504 B19 linesraw
1#version 450
2
3layout(constant_id = 0) const uint a = 0u;
4
5// Right operands that are not a single operation
6
7const bool andConst    = (a == 0u) && (a + 1u == 1u);
8const bool orConst     = (a != 0u) || (a + 1u == 1u);
9const bool nestedConst = (a == 0u) && ((a == 1u) || (a + 2u == 2u));
10const bool unusedConst = (a == 0u) && (a * 2u == 0u);
11
12layout(local_size_x = 1) in;
13
14void main()
15{
16    bool b = !andConst;
17    b = b || !orConst || !nestedConst;
18    bool inlineExpr = !((a == 0u) && (a + 1u == 1u));
19}