3 #extension GL_EXT_shader_explicit_arithmetic_types: enable
4 #extension GL_EXT_shader_explicit_arithmetic_types_int8: require
5 #extension GL_EXT_shader_explicit_arithmetic_types_int16: require
6 #extension GL_EXT_shader_explicit_arithmetic_types_int32: require
7 #extension GL_EXT_shader_explicit_arithmetic_types_int64: require
8 #extension GL_EXT_shader_explicit_arithmetic_types_float16: require
9 #extension GL_EXT_shader_explicit_arithmetic_types_float32: require
10 #extension GL_EXT_shader_explicit_arithmetic_types_float64: require
12 layout(binding = 0) uniform Uniforms
17 layout(std140, binding = 1) uniform Block
36 const int32_t i32Const[3] =
43 int32_t i32 = i32Const[index];
45 const uint32_t u32Const[] =
52 uint32_t u32 = u32Const[index];
70 u32v = i32v; // int32_t -> uint32_t
71 i64v = i32v; // int32_t -> int64_t
72 u64v = i32v; // int32_t -> uint64_t
73 i64v = u32v; // uint32_t -> int64_t
74 u64v = u32v; // uint32_t -> uint64_t
75 f32v = i32v; // int32_t -> float32_t
76 f64v = i32v; // int32_t -> float64_t
77 f32v = u32v; // uint32_t -> float32_t
78 f64v = u32v; // uint32_t -> float64_t
80 i8v = i8vec2(i32v); // int32_t -> int8_t
81 i8v = i8vec2(u32v); // uint32_t -> int8_t
82 i16v = i16vec2(i32v); // int32_t -> int16_t
83 i16v = i16vec2(u32v); // uint32_t -> int16_t
84 i32v = i32vec2(i32v); // int32_t -> int32_t
85 i32v = i32vec2(u32v); // uint32_t -> int32_t
86 i64v = i64vec2(i32v); // int32_t -> int64_t
87 i64v = i64vec2(u32v); // uint32_t -> int64_t
88 u8v = u8vec2(i32v); // int32_t -> uint8_t
89 u8v = u8vec2(u32v); // uint32_t -> uint8_t
90 u16v = u16vec2(i32v); // int32_t -> uint16_t
91 u16v = u16vec2(u32v); // uint32_t -> uint16_t
92 u32v = u32vec2(i32v); // int32_t -> uint32_t
93 u32v = u32vec2(u32v); // uint32_t -> uint32_t
94 u64v = u64vec2(i32v); // int32_t -> uint64_t
95 u64v = u64vec2(u32v); // uint32_t -> uint64_t
97 f16v = f16vec2(i32v); // int32_t -> float16_t
98 f32v = f32vec2(i32v); // int32_t -> float32_t
99 f64v = f64vec2(i32v); // int32_t -> float64_t
100 f16v = f16vec2(u32v); // uint32_t -> float16_t
101 f32v = f32vec2(u32v); // uint32_t -> float32_t
102 f64v = f64vec2(u32v); // uint32_t -> float64_t
104 i32v = i32vec2(bv); // bool -> int32
105 u32v = u32vec2(bv); // bool -> uint32
106 bv = bvec2(i32v); // int32 -> bool
107 bv = bvec2(u32v); // uint32 -> bool
155 b = (u32v.y >= uv.x);
191 i32v = min(i32v, i32);
192 i32v = min(i32v, i32vec2(-1));
193 u32v = min(u32v, u32);
194 u32v = min(u32v, u32vec3(0));
197 i32v = max(i32v, i32);
198 i32v = max(i32v, i32vec2(-1));
199 u32v = max(u32v, u32);
200 u32v = max(u32v, u32vec3(0));
203 i32v = clamp(i32v, -i32, i32);
204 i32v = clamp(i32v, -i32v, i32v);
205 u32v = clamp(u32v, -u32, u32);
206 u32v = clamp(u32v, -u32v, u32v);
209 i32 = mix(i32v.x, i32v.y, true);
210 i32v = mix(i32vec2(i32), i32vec2(-i32), bvec2(false));
211 u32 = mix(u32v.x, u32v.y, true);
212 u32v = mix(u32vec3(u32), u32vec3(-u32), bvec3(false));
220 i32v = unpack32(i64);
221 u32v2 = unpack32(u64);
224 bv = lessThan(u32v, u32vec3(u32));
225 bv.xy = lessThan(i32v, i32vec2(i32));
228 bv = lessThanEqual(u32v, u32vec3(u32));
229 bv.xy = lessThanEqual(i32v, i32vec2(i32));
232 bv = greaterThan(u32v, u32vec3(u32));
233 bv.xy = greaterThan(i32v, i32vec2(i32));
235 // greaterThanEqual()
236 bv = greaterThanEqual(u32v, u32vec3(u32));
237 bv.xy = greaterThanEqual(i32v, i32vec2(i32));
240 bv = equal(u32v, u32vec3(u32));
241 bv.xy = equal(i32v, i32vec2(i32));
244 bv = notEqual(u32v, u32vec3(u32));
245 bv.xy = notEqual(i32v, i32vec2(i32));
248 // Type conversion for specialization constant
249 layout(constant_id = 100) const int32_t si32 = -10;
250 layout(constant_id = 101) const uint32_t su32 = 20U;
251 layout(constant_id = 102) const int si = -5;
252 layout(constant_id = 103) const uint su = 4;
253 layout(constant_id = 104) const bool sb = true;
255 #define UINT32_MAX 4294967295u
256 uint32_t u32Max = UINT32_MAX;