compiler/types: Add glsl_baseN_t_type(bit_size) helpers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6713>
This commit is contained in:

committed by
Marge Bot

parent
4cb6a8d2de
commit
de295b61da
@@ -420,6 +420,18 @@ glsl_float16_t_type(void)
|
|||||||
return glsl_type::float16_t_type;
|
return glsl_type::float16_t_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const glsl_type *
|
||||||
|
glsl_floatN_t_type(unsigned bit_size)
|
||||||
|
{
|
||||||
|
switch (bit_size) {
|
||||||
|
case 16: return glsl_type::float16_t_type;
|
||||||
|
case 32: return glsl_type::float_type;
|
||||||
|
case 64: return glsl_type::double_type;
|
||||||
|
default:
|
||||||
|
unreachable("Unsupported bit size");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const glsl_type *
|
const glsl_type *
|
||||||
glsl_vec_type(unsigned n)
|
glsl_vec_type(unsigned n)
|
||||||
{
|
{
|
||||||
@@ -492,6 +504,32 @@ glsl_uint8_t_type(void)
|
|||||||
return glsl_type::uint8_t_type;
|
return glsl_type::uint8_t_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const glsl_type *
|
||||||
|
glsl_intN_t_type(unsigned bit_size)
|
||||||
|
{
|
||||||
|
switch (bit_size) {
|
||||||
|
case 8: return glsl_type::int8_t_type;
|
||||||
|
case 16: return glsl_type::int16_t_type;
|
||||||
|
case 32: return glsl_type::int_type;
|
||||||
|
case 64: return glsl_type::int64_t_type;
|
||||||
|
default:
|
||||||
|
unreachable("Unsupported bit size");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const glsl_type *
|
||||||
|
glsl_uintN_t_type(unsigned bit_size)
|
||||||
|
{
|
||||||
|
switch (bit_size) {
|
||||||
|
case 8: return glsl_type::uint8_t_type;
|
||||||
|
case 16: return glsl_type::uint16_t_type;
|
||||||
|
case 32: return glsl_type::uint_type;
|
||||||
|
case 64: return glsl_type::uint64_t_type;
|
||||||
|
default:
|
||||||
|
unreachable("Unsupported bit size");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const glsl_type *
|
const glsl_type *
|
||||||
glsl_bool_type(void)
|
glsl_bool_type(void)
|
||||||
{
|
{
|
||||||
|
@@ -165,6 +165,7 @@ const struct glsl_type *glsl_void_type(void);
|
|||||||
const struct glsl_type *glsl_float_type(void);
|
const struct glsl_type *glsl_float_type(void);
|
||||||
const struct glsl_type *glsl_float16_t_type(void);
|
const struct glsl_type *glsl_float16_t_type(void);
|
||||||
const struct glsl_type *glsl_double_type(void);
|
const struct glsl_type *glsl_double_type(void);
|
||||||
|
const struct glsl_type *glsl_floatN_t_type(unsigned bit_size);
|
||||||
const struct glsl_type *glsl_vec_type(unsigned n);
|
const struct glsl_type *glsl_vec_type(unsigned n);
|
||||||
const struct glsl_type *glsl_dvec_type(unsigned n);
|
const struct glsl_type *glsl_dvec_type(unsigned n);
|
||||||
const struct glsl_type *glsl_vec4_type(void);
|
const struct glsl_type *glsl_vec4_type(void);
|
||||||
@@ -177,6 +178,8 @@ const struct glsl_type *glsl_int16_t_type(void);
|
|||||||
const struct glsl_type *glsl_uint16_t_type(void);
|
const struct glsl_type *glsl_uint16_t_type(void);
|
||||||
const struct glsl_type *glsl_int8_t_type(void);
|
const struct glsl_type *glsl_int8_t_type(void);
|
||||||
const struct glsl_type *glsl_uint8_t_type(void);
|
const struct glsl_type *glsl_uint8_t_type(void);
|
||||||
|
const struct glsl_type *glsl_intN_t_type(unsigned bit_size);
|
||||||
|
const struct glsl_type *glsl_uintN_t_type(unsigned bit_size);
|
||||||
const struct glsl_type *glsl_bool_type(void);
|
const struct glsl_type *glsl_bool_type(void);
|
||||||
|
|
||||||
const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type);
|
const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type);
|
||||||
|
Reference in New Issue
Block a user