File: bit-logic-assign-10.frag

package info (click to toggle)
piglit 0~git20180515-62ef6b0db-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 102,084 kB
  • sloc: ansic: 244,201; xml: 47,485; python: 28,308; lisp: 19,320; cpp: 10,678; sh: 301; makefile: 33; pascal: 5
file content (40 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (5)
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
32
33
34
35
36
37
38
39
40
// [config]
// expect_result: pass
// glsl_version: 1.30
//
// [end config]

// Expected: PASS, glsl == 1.30
//
// Description: bit-logic assignment ops with argument types:
//     - (ivecN, int)
//     - (uvecN, uint)
//
// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
// "If one operand is a scalar and the other a vector, the scalar is applied
// component-wise to the vector, resulting in the same type as the vector."

#version 130
void main() {
    // (ivecN, int) --------------------------

    ivec2 v00 = ivec2(0, 1);
    v00 &= int(7);

    ivec3 v01 = ivec3(0, 1, 2);
    v01 |= int(7);

    ivec4 v02 = ivec4(0, 1, 2, 3);
    v02 ^= int(7);

    // (uvecN, uint) --------------------------

    uvec2 v10 = uvec2(0, 1);
    v10 &= uint(7);

    uvec3 v11 = uvec3(0, 1, 2);
    v11 |= uint(7);

    uvec4 v12 = uvec4(0, 1, 2, 3);
    v12 ^= uint(7);
}