mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
nir: Add glsl_base_type unsigned -> signed version helper
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>
This commit is contained in:
parent
93db59e066
commit
2826a5a923
1 changed files with 21 additions and 0 deletions
|
|
@ -218,6 +218,27 @@ glsl_unsigned_base_type_of(enum glsl_base_type type)
|
|||
}
|
||||
}
|
||||
|
||||
static inline enum glsl_base_type
|
||||
glsl_signed_base_type_of(enum glsl_base_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
return GLSL_TYPE_INT;
|
||||
case GLSL_TYPE_UINT8:
|
||||
return GLSL_TYPE_INT8;
|
||||
case GLSL_TYPE_UINT16:
|
||||
return GLSL_TYPE_INT16;
|
||||
case GLSL_TYPE_UINT64:
|
||||
return GLSL_TYPE_INT64;
|
||||
default:
|
||||
assert(type == GLSL_TYPE_INT ||
|
||||
type == GLSL_TYPE_INT8 ||
|
||||
type == GLSL_TYPE_INT16 ||
|
||||
type == GLSL_TYPE_INT64);
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
enum glsl_sampler_dim {
|
||||
GLSL_SAMPLER_DIM_1D = 0,
|
||||
GLSL_SAMPLER_DIM_2D,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue