mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 14:30:10 +01:00
nir: Add a couple of helpers for glsl types.
This will be used by tgsi_to_nir, which needs to get vec4 types for declaring shader input/output variables. v2: Add a missing space. Reviewed-by: Matt Turner <mattst88@gmail.com> (v2) Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
765cfe9a90
commit
36c604c824
2 changed files with 16 additions and 1 deletions
|
|
@ -136,8 +136,20 @@ glsl_type_is_matrix(const struct glsl_type *type)
|
|||
return type->is_matrix();
|
||||
}
|
||||
|
||||
const glsl_type*
|
||||
const glsl_type *
|
||||
glsl_void_type(void)
|
||||
{
|
||||
return glsl_type::void_type;
|
||||
}
|
||||
|
||||
const glsl_type *
|
||||
glsl_vec4_type(void)
|
||||
{
|
||||
return glsl_type::vec4_type;
|
||||
}
|
||||
|
||||
const glsl_type *
|
||||
glsl_array_type(const glsl_type *base, unsigned elements)
|
||||
{
|
||||
return glsl_type::get_array_instance(base, elements);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ bool glsl_type_is_scalar(const struct glsl_type *type);
|
|||
bool glsl_type_is_matrix(const struct glsl_type *type);
|
||||
|
||||
const struct glsl_type *glsl_void_type(void);
|
||||
const struct glsl_type *glsl_vec4_type(void);
|
||||
const struct glsl_type *glsl_array_type(const struct glsl_type *base,
|
||||
unsigned elements);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue