3 #extension GL_EXT_shader_explicit_arithmetic_types : require
\r
5 const bool bool_init = true;
\r
6 const int8_t int8_t_init = int8_t(-1);
\r
7 const int16_t int16_t_init = int16_t(-2);
\r
8 const int32_t int32_t_init = int32_t(-3);
\r
9 const int64_t int64_t_init = int64_t(-4);
\r
10 const uint8_t uint8_t_init = uint8_t(1);
\r
11 const uint16_t uint16_t_init = uint16_t(2);
\r
12 const uint32_t uint32_t_init = uint32_t(3);
\r
13 const uint64_t uint64_t_init = uint64_t(4);
\r
14 const float16_t float16_t_init = float16_t(42.0);
\r
15 const float32_t float32_t_init = float32_t(13.0);
\r
16 const float64_t float64_t_init = float64_t(4.0);
\r
18 const float16_t neg_float16_t_init = float16_t(-42.0);
\r
19 const float32_t neg_float32_t_init = float32_t(-13.0);
\r
20 const float64_t neg_float64_t_init = float64_t(-4.0);
\r
22 #define TYPE_TO_TYPE(x, y) \
\r
23 const x y##_to_##x = x(y##_init)
\r
25 #define TYPE_TO_TYPE_PREFIX(prefix, x, y) \
\r
26 const x prefix##_##y##_to_##x = x(prefix##_##y##_init)
\r
28 #define TYPE_TO(x) \
\r
29 TYPE_TO_TYPE(x, bool); \
\r
30 TYPE_TO_TYPE(x, int8_t); \
\r
31 TYPE_TO_TYPE(x, int16_t); \
\r
32 TYPE_TO_TYPE(x, int32_t); \
\r
33 TYPE_TO_TYPE(x, int64_t); \
\r
34 TYPE_TO_TYPE(x, uint8_t); \
\r
35 TYPE_TO_TYPE(x, uint16_t); \
\r
36 TYPE_TO_TYPE(x, uint32_t); \
\r
37 TYPE_TO_TYPE(x, uint64_t); \
\r
38 TYPE_TO_TYPE(x, float16_t); \
\r
39 TYPE_TO_TYPE(x, float32_t); \
\r
40 TYPE_TO_TYPE(x, float64_t)
\r
55 #define NEG_FLOAT_TO(x) \
\r
56 TYPE_TO_TYPE_PREFIX(neg, x, float16_t); \
\r
57 TYPE_TO_TYPE_PREFIX(neg, x, float32_t); \
\r
58 TYPE_TO_TYPE_PREFIX(neg, x, float64_t)
\r
61 NEG_FLOAT_TO(int8_t);
\r
62 NEG_FLOAT_TO(int16_t);
\r
63 NEG_FLOAT_TO(int32_t);
\r
64 NEG_FLOAT_TO(int64_t);
\r
65 NEG_FLOAT_TO(float16_t);
\r
66 NEG_FLOAT_TO(float32_t);
\r
67 NEG_FLOAT_TO(float64_t);
\r