adding missing data

This commit is contained in:
2025-12-05 22:57:28 +01:00
parent f0317494ed
commit 2fa3e9310a
140 changed files with 32722 additions and 0 deletions

1812
vulkan/glsl/es310/arrays.test git.filemode.normal_file

File diff suppressed because it is too large Load Diff

223
vulkan/glsl/es310/conditionals.test git.filemode.normal_file
View File

@@ -0,0 +1,223 @@
group if "If Statements"
case single_statement
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
if (in0 >= 1.0)
out0 = 1.0;
${OUTPUT}
}
""
end
case compound_statement
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
output float out1 = [ 1.0 | 0.0 | 0.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
out1 = 1.0;
if (in0 >= 1.0)
{
out0 = 1.0;
out1 = 0.0;
}
${OUTPUT}
}
""
end
case sequence_statements
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
output float out1 = [ 1.0 | 0.0 | 0.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
out1 = 1.0;
if (in0 >= 1.0)
out0 = 1.0, out1 = 0.0;
${OUTPUT}
}
""
end
case sequence_condition
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
output float out1 = [ 1.0 | 0.0 | 0.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
out1 = 1.0;
if (false, in0 >= 1.0)
out0 = 1.0, out1 = 0.0;
${OUTPUT}
}
""
end
case complex_condition
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
output float out1 = [ 1.0 | 0.0 | 0.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
out1 = 1.0;
if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0))
out0 = 1.0, out1 = 0.0;
${OUTPUT}
}
""
end
case if_else
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 1.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
if (in0 >= 1.0)
out0 = 1.0;
else
out0 = 0.0;
${OUTPUT}
}
""
end
case if_elseif
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 2.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0.0;
if (in0 >= 2.0)
out0 = 2.0;
else if (in0 >= 1.0)
out0 = 1.0;
${OUTPUT}
}
""
end
case if_elseif_else
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 2.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
if (in0 >= 2.0)
out0 = 2.0;
else if (in0 >= 1.0)
out0 = 1.0;
else
out0 = 0.0;
${OUTPUT}
}
""
end
case mixed_if_elseif_else
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 ];
output float out0 = [ 0.0 | 1.0 | 2.0 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
if (in0 >= 2.0)
{
out0 = 2.0;
}
else if (in0 >= 1.0)
out0 = 2.0, out0 = 1.0;
else
out0 = 0.0;
${OUTPUT}
}
""
end
end # if

483
vulkan/glsl/es310/constant_expressions.test git.filemode.normal_file
View File

@@ -0,0 +1,483 @@
group trivial "Trivial expressions"
case float
version 310 es
values { output float out0 = 5.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a = 5.0;
out0 = a;
${OUTPUT}
}
""
end
case int
version 310 es
values { output int out0 = 5; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const int a = 5;
out0 = a;
${OUTPUT}
}
""
end
case bool
version 310 es
values { output bool out0 = true; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const bool a = true;
out0 = a;
${OUTPUT}
}
""
end
case cast
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a = float(int(bool(true)));
out0 = a;
${OUTPUT}
}
""
end
end # trivial
group operators "Operators"
case math_float
version 310 es
values { output float out0 = 2.19; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a = 6.0/3.5 + 1.8*2.6 - 4.2;
out0 = a;
${OUTPUT}
}
""
end
case math_vec
version 310 es
values { output float out0 = 15.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy;
out0 = a.x + a.y + a.z;
${OUTPUT}
}
""
end
case math_int
version 310 es
values { output int out0 = 7; }
both ""
#version 310 es
precision highp int;
${DECLARATIONS}
void main()
{
const int a = 25%7 + 2*3 - 9/3;
out0 = a;
${OUTPUT}
}
""
end
case math_ivec
version 310 es
values { output int out0 = 21; }
both ""
#version 310 es
precision highp int;
${DECLARATIONS}
void main()
{
const ivec3 a = ivec2(25%7, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz;
out0 = a.x + a.y + a.z;
${OUTPUT}
}
""
end
case math_mat
version 310 es
values { output float out0 = 8.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const mat3 a = mat3(3.0) * mat3(4.0);
const mat4 b = mat4(a[1][1])*2.0;
const mat2 c = mat2(b[0][0]) / 3.0;
out0 = c[0][0]+c[1][0];
${OUTPUT}
}
""
end
case bitwise
version 310 es
values { output int out0 = 678332; }
both ""
#version 310 es
precision highp int;
${DECLARATIONS}
void main()
{
const int a = (((0xABBA<<4) ^ 0xCAFE) | (0xDCBA & (0xABCD>>2))) ^ (~0xDEAD & 0xBEEF);
out0 = a;
${OUTPUT}
}
""
end
case logical
version 310 es
values { output bool out0 = true; }
both ""
#version 310 es
precision highp int;
${DECLARATIONS}
void main()
{
const bool a = (!false || false) && (true ^^ false);
out0 = a;
${OUTPUT}
}
""
end
case compare
version 310 es
values { output bool out0 = true; }
both ""
#version 310 es
precision highp int;
${DECLARATIONS}
void main()
{
const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1));
out0 = a;
${OUTPUT}
}
""
end
case selection
version 310 es
values { output float out0 = 5.3; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a = false ? 0.0 : (true ? 5.3 : 1.0);
out0 = a;
${OUTPUT}
}
""
end
end # operators
group complex_types "Arrays & Structs"
case struct
version 310 es
values { output float out0 = 260.922; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
struct S
{
vec4 a;
int b;
};
void main()
{
const S s = S(vec4(1.5), 123);
out0 = length(s.a.xy)*float(s.b);
${OUTPUT}
}
""
end
case nested_struct
version 310 es
values { output float out0 = 965.9; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
struct S
{
vec4 v;
int i;
};
struct T
{
S s;
bool b;
int i;
};
struct U
{
S s;
T t;
};
void main()
{
const S s = S(vec4(1.5), 123);
const T t = T(s, false, 3);
const U u = U(s, t);
const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6));
out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3
${OUTPUT}
}
""
end
case array_size
version 310 es
values { output int out0 = 1; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const int a[max(-1, 1)] = int[1](1);
out0 = a[0];
${OUTPUT}
}
""
end
case array_length
version 310 es
values { output int out0 = 2; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const int a[1] = int[1](1);
out0 = a.length() + a[0];
${OUTPUT}
}
""
end
case array
version 310 es
values { output float out0 = 4.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a[1+2+5] = float[8](0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0);
const float f = a[1+2+4];
out0 = f + float(a.length()-8);
${OUTPUT}
}
""
end
end # complex_types
group other "Other operations"
case switch_case
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ];
output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const int _0 = 0;
const int _1 = 1;
const int _2 = 2;
const int _3 = 3;
const int _4 = 4;
switch(int(in0))
{
case _0:
out0 = 0;
break;
case _1:
out0 = 1;
break;
case _2:
out0 = 2;
break;
case _3:
out0 = 3;
break;
case _4:
out0 = 4;
break;
case 5:
out0 = 10;
break;
default:
out0 = 100;
}
${OUTPUT}
}
""
end
case nested_builtin_funcs
version 310 es
values { output float out0 = 3.05; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/);
out0 = a;
${OUTPUT}
}
""
end
case complex
version 310 es
values
{
input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ];
output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
struct T
{
vec4 v;
};
struct S
{
T t;
int i;
bool b;
};
void main()
{
const T t = T(vec4(1.0));
const S s = S(t, 42, true);
const int _0 = int(sin(0.0));
const int _1 = int(1.0);
const int _2 = 2 + int(float(_0>_1));
const int _3 = min(gl_MaxVertexAttribs, 16)/4 - 1;
const int _4 = min(gl_MaxDrawBuffers, 4);
const ivec4 nums = ivec4(0, 1, 2, 3);
switch(int(in0))
{
case int(float(_0)):
out0 = ((true!=false) && (!false)) ? 0 : 25;
break;
case ivec3(_1).x:
out0 = 3*18/9-5;
break;
case nums[_2]:
out0 = int(length(vec4(1.0))+0.001);
break;
case _3:
out0 = 3;
break;
case clamp(_4, 1, 6):
out0 = (s.i-2)/10;
break;
case max(3, 5):
out0 = 10;
break;
default:
out0 = 100;
}
${OUTPUT}
}
""
end
end

838
vulkan/glsl/es310/constants.test git.filemode.normal_file
View File

@@ -0,0 +1,838 @@
case float_input
version 310 es
values
{
input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 | -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 | -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = in0;
${OUTPUT}
}
""
end
case float_uniform
version 310 es
values
{
uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
}
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = uni0;
${OUTPUT}
}
""
end
case float_0
version 310 es
values { output float out0 = 1.123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = +1.123;
${OUTPUT}
}
""
end
case float_1
version 310 es
values { output float out0 = -1.123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = -1.123;
${OUTPUT}
}
""
end
case float_2
version 310 es
values { output float out0 = 123.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 123.;
${OUTPUT}
}
""
end
case float_3
version 310 es
values { output float out0 = 0.123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = .123;
${OUTPUT}
}
""
end
case float_4
version 310 es
values { output float out0 = 123.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 1.23e+2;
${OUTPUT}
}
""
end
case float_5
version 310 es
values { output float out0 = -123.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = -1.23E+2;
${OUTPUT}
}
""
end
case float_6
version 310 es
values { output float out0 = -123.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = -1.23e2;
${OUTPUT}
}
""
end
case float_7
version 310 es
values { output float out0 = 0.123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 1.23e-1;
${OUTPUT}
}
""
end
case float_8
version 310 es
values { output float out0 = 1000.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 1e3;
${OUTPUT}
}
""
end
case float_f_suffix_0
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main ()
{
${SETUP}
float value = 1.0f;
out0 = value;
${OUTPUT}
}
""
end
case float_f_suffix_1
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main ()
{
${SETUP}
float value = 1.0F;
out0 = value;
${OUTPUT}
}
""
end
case int_0
version 310 es
values { output int out0 = 123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 123;
${OUTPUT}
}
""
end
case int_1
version 310 es
values { output int out0 = -321; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = -321;
${OUTPUT}
}
""
end
case int_2
version 310 es
values { output int out0 = 123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0x7B;
${OUTPUT}
}
""
end
case int_3
version 310 es
values { output int out0 = 123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0X7b;
${OUTPUT}
}
""
end
case int_4
version 310 es
values { output int out0 = 123; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = 0173;
${OUTPUT}
}
""
end
case bool_0
version 310 es
values { output bool out0 = true; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = true;
${OUTPUT}
}
""
end
case bool_1
version 310 es
values { output bool out0 = false; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
out0 = false;
${OUTPUT}
}
""
end
case const_float_global
version 310 es
values { output float out0 = 1000.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = 1000.0;
void main()
{
out0 = theConstant;
${OUTPUT}
}
""
end
case const_float_main
version 310 es
values { output float out0 = -1000.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float theConstant = -1000.0;
out0 = theConstant;
${OUTPUT}
}
""
end
case const_float_function
version 310 es
values { output float out0 = -0.012; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
float func()
{
const float theConstant = -0.012;
return theConstant;
}
void main()
{
out0 = func();
${OUTPUT}
}
""
end
case const_float_scope
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
{
const float theConstant = 1.0;
out0 = theConstant;
}
${OUTPUT}
}
""
end
case const_float_scope_shawdowing_1
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float theConstant = 100.0;
{
const float theConstant = 1.0;
out0 = theConstant;
}
${OUTPUT}
}
""
end
case const_float_scope_shawdowing_2
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = 100.0;
void main()
{
{
const float theConstant = 1.0;
out0 = theConstant;
}
${OUTPUT}
}
""
end
case const_float_scope_shawdowing_3
version 310 es
values { output float out0 = 1.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = 100.0;
void main()
{
const float theConstant = -100.0;
{
const float theConstant = 1.0;
out0 = theConstant;
}
${OUTPUT}
}
""
end
case const_float_scope_shawdowing_4
version 310 es
values { output float out0 = 2.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = 100.0;
float func()
{
const float theConstant = 2.0;
return theConstant;
}
void main()
{
const float theConstant = -100.0;
{
const float theConstant = 1.0;
out0 = func();
}
${OUTPUT}
}
""
end
case const_float_operations_with_const
version 310 es
values { output float out0 = 21.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theGlobalConstant = 10.0;
float func()
{
const float theConstant = 2.0;
return theConstant;
}
void main()
{
const float theConstant = -100.0;
{
const float theConstant = 1.0;
out0 = func() * theGlobalConstant + theConstant;
}
${OUTPUT}
}
""
end
case const_float_assignment_1
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float theConstant1 = 10.0;
const float theConstant2 = theConstant1;
out0 = theConstant2;
${OUTPUT}
}
""
end
case const_float_assignment_2
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
void main()
{
const float theConstant1 = 10.0;
{
const float theConstant2 = theConstant1;
out0 = theConstant2;
}
${OUTPUT}
}
""
end
case const_float_assignment_3
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant1 = 10.0;
void main()
{
const float theConstant2 = theConstant1;
out0 = theConstant2;
${OUTPUT}
}
""
end
case const_float_assignment_4
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant1 = 10.0;
float func()
{
const float theConstant2 = theConstant1;
return theConstant2;
}
void main()
{
out0 = func();
${OUTPUT}
}
""
end
case const_float_from_int
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = float(10);
void main()
{
out0 = theConstant;
${OUTPUT}
}
""
end
case const_float_from_vec2
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = vec2(1.0, 10.0).y;
void main()
{
out0 = theConstant;
${OUTPUT}
}
""
end
case const_float_from_vec3
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = vec3(1.0, 10.0, 20.0).y;
void main()
{
out0 = theConstant;
${OUTPUT}
}
""
end
case const_float_from_vec4
version 310 es
values { output float out0 = 10.0; }
both ""
#version 310 es
precision highp float;
${DECLARATIONS}
const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y;
void main()
{
out0 = theConstant;
${OUTPUT}
}
""
end
case int_decimal
version 310 es
values { output int out0 = 7; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
int value = 7;
out0 = value;
${OUTPUT}
}
""
end
case int_octal
version 310 es
values { output int out0 = 15; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
int value = 017;
out0 = value;
${OUTPUT}
}
""
end
case int_hexadecimal_0
version 310 es
values { output int out0 = 47; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
int value = 0x2f;
out0 = value;
${OUTPUT}
}
""
end
case int_hexadecimal_1
version 310 es
values { output int out0 = 47; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
int value = 0X2f;
out0 = value;
${OUTPUT}
}
""
end
case uint_decimal_0
version 310 es
values { output uint out0 = 7; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 7u;
out0 = value;
${OUTPUT}
}
""
end
case uint_decimal_1
version 310 es
values { output uint out0 = 7; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 7U;
out0 = value;
${OUTPUT}
}
""
end
case uint_decimal_2
version 310 es
values { output uint out0 = 0; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 0u;
out0 = value;
${OUTPUT}
}
""
end
case uint_decimal_3
version 310 es
values { output uint out0 = 0; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 0U;
out0 = value;
${OUTPUT}
}
""
end
case uint_octal_0
version 310 es
values { output uint out0 = 15; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 017u;
out0 = value;
${OUTPUT}
}
""
end
case uint_octal_1
version 310 es
values { output uint out0 = 15; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 017U;
out0 = value;
${OUTPUT}
}
""
end
case uint_hexadecimal_0
version 310 es
values { output uint out0 = 47; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 0x2fU;
out0 = value;
${OUTPUT}
}
""
end
case uint_hexadecimal_1
version 310 es
values { output uint out0 = 47; }
both ""
#version 310 es
${DECLARATIONS}
void main ()
{
${SETUP}
uint value = 0X2fu;
out0 = value;
${OUTPUT}
}
""
end

13186
vulkan/glsl/es310/conversions.test git.filemode.normal_file

File diff suppressed because it is too large Load Diff

3151
vulkan/glsl/es310/functions.test git.filemode.normal_file

File diff suppressed because it is too large Load Diff

2179
vulkan/glsl/es310/linkage.test git.filemode.normal_file

File diff suppressed because it is too large Load Diff

460
vulkan/glsl/es310/scoping.test git.filemode.normal_file
View File

@@ -0,0 +1,460 @@
group valid "Valid scoping and name redeclaration cases"
case local_variable_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = -1;
void main()
{
${SETUP}
int a = in0;
out0 = a;
${OUTPUT}
}
""
end
case block_variable_hides_local_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
void main()
{
${SETUP}
int a = in0;
{
int a = -1;
}
out0 = a;
${OUTPUT}
}
""
end
case block_variable_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = -1;
void main()
{
${SETUP}
{
int a = in0;
out0 = a;
}
${OUTPUT}
}
""
end
case for_init_statement_variable_hides_local_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
void main()
{
${SETUP}
int a = in0;
for (int a = 0; a < 10; a++)
{
}
out0 = a;
${OUTPUT}
}
""
end
case while_condition_variable_hides_local_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
void main()
{
${SETUP}
int a = in0;
int i = 0;
while (bool a = (i < 1))
{
i++;
}
out0 = a;
${OUTPUT}
}
""
end
case for_init_statement_variable_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = 5;
void main()
{
${SETUP}
for (int a = 0; a < 10; a++)
{
}
out0 = in0 + a - 5;
${OUTPUT}
}
""
end
case while_condition_variable_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = 5;
void main()
{
${SETUP}
int i = 0;
while (bool a = (i < 1))
{
i++;
}
out0 = in0 + a - 5;
${OUTPUT}
}
""
end
case variable_in_if_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = 1;
void main()
{
${SETUP}
if (true)
int a = 42;
out0 = a*in0;
${OUTPUT}
}
""
end
case variable_from_outer_scope_visible_in_initializer
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
void main()
{
${SETUP}
int a = in0;
{
int a = a+5, b = a-5;
out0 = b;
a = 42;
}
out0 = out0 + a - in0;
${OUTPUT}
}
""
end
case local_int_variable_hides_struct_type
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
struct S { int val; };
void main()
{
${SETUP}
int S = S(in0).val;
out0 = S;
${OUTPUT}
}
""
end
case local_struct_variable_hides_struct_type
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
struct S { int val; };
void main()
{
${SETUP}
S S = S(in0);
out0 = S.val;
${OUTPUT}
}
""
end
case local_variable_hides_function
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int foo (int x) { return x; }
void main()
{
${SETUP}
int foo = in0;
out0 = foo;
${OUTPUT}
}
""
end
case function_parameter_hides_global_variable
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int a = -1;
int func (int a) { return a; }
void main()
{
${SETUP}
out0 = func(in0);
${OUTPUT}
}
""
end
case function_parameter_hides_struct_type
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
struct S { int x; };
int func (int S) { return S; }
void main()
{
${SETUP}
out0 = func(in0);
${OUTPUT}
}
""
end
case function_parameter_hides_function
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int func (int func) { return func; }
void main()
{
${SETUP}
out0 = func(in0);
${OUTPUT}
}
""
end
case local_variable_in_inner_scope_hides_function_parameter
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int func (int inp, int x) { { int x = 5; return inp + x - 5; } }
void main()
{
${SETUP}
out0 = func(in0, 42);
${OUTPUT}
}
""
end
case redeclare_function
version 310 es
values
{
input int in0 = [ 1 | 2 | 3 ];
output int out0 = [ 1 | 2 | 3 ];
}
both ""
#version 310 es
precision highp float;
precision highp int;
${DECLARATIONS}
int func (int x);
int func (int);
int func (int inp) { return inp; }
void main()
{
${SETUP}
out0 = func(in0);
${OUTPUT}
}
""
end
end

7783
vulkan/glsl/es310/swizzles.test git.filemode.normal_file

File diff suppressed because it is too large Load Diff