Browse Source

Add tests for :? operator

tags/mesa-7.9-rc1
Ian Romanick 15 years ago
parent
commit
32a494586f
5 changed files with 45 additions and 0 deletions
  1. 8
    0
      tests/condition-01.glsl
  2. 8
    0
      tests/condition-02.glsl
  3. 8
    0
      tests/condition-03.glsl
  4. 8
    0
      tests/condition-04.glsl
  5. 13
    0
      tests/condition-05.glsl

+ 8
- 0
tests/condition-01.glsl View File

@@ -0,0 +1,8 @@
/* FAIL - :? condition is not bool scalar */

uniform bvec4 a;

void main()
{
gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
}

+ 8
- 0
tests/condition-02.glsl View File

@@ -0,0 +1,8 @@
/* FAIL - :? condition is not bool scalar */

uniform float a;

void main()
{
gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
}

+ 8
- 0
tests/condition-03.glsl View File

@@ -0,0 +1,8 @@
/* PASS */

uniform bool a;

void main()
{
gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
}

+ 8
- 0
tests/condition-04.glsl View File

@@ -0,0 +1,8 @@
/* FAIL - type of second two operands must match */

uniform bool a;

void main()
{
gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);
}

+ 13
- 0
tests/condition-05.glsl View File

@@ -0,0 +1,13 @@
#version 120
/* PASS */

uniform bool a;
uniform int b;

void main()
{
float x;

x = (a) ? 2.0 : b;
gl_Position = vec4(x);
}

Loading…
Cancel
Save