X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fshader%2Fslang%2Fslang_typeinfo.h;h=e6fecd350af05b2766ea5d302b15bf7f8fddede7;hb=cd8614b0287dc5a69725ec4ee0208fad61f7789e;hp=ad5aa3e195e7e6a2b878ad01c20dd75163e170b9;hpb=8fed2466e4056668a76a87cf935b5fbff8ae15ca;p=mesa.git diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index ad5aa3e195e..e6fecd350af 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -25,8 +25,8 @@ #ifndef SLANG_TYPEINFO_H #define SLANG_TYPEINFO_H 1 -#include "imports.h" -#include "mtypes.h" +#include "main/imports.h" +#include "main/mtypes.h" #include "slang_log.h" #include "slang_utility.h" #include "slang_vartable.h" @@ -34,6 +34,9 @@ struct slang_operation_; +struct slang_name_space_; + + /** * Holds complete information about vector swizzle - the @@ -47,45 +50,45 @@ typedef struct slang_swizzle_ GLuint swizzle[4]; } slang_swizzle; -typedef struct slang_name_space_ -{ - struct slang_function_scope_ *funcs; - struct slang_struct_scope_ *structs; - struct slang_variable_scope_ *vars; -} slang_name_space; +extern GLboolean +_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz); -typedef struct slang_assemble_ctx_ +typedef enum slang_type_variant_ { - slang_atom_pool *atoms; - slang_name_space space; - struct gl_program *program; - slang_var_table *vartable; - slang_info_log *log; - struct slang_label_ *curFuncEndLabel; - struct slang_ir_node_ *CurLoop; - struct slang_function_ *CurFunction; - GLuint numSamplers; -} slang_assemble_ctx; - - -extern struct slang_function_ * -_slang_locate_function(const struct slang_function_scope_ *funcs, - slang_atom name, struct slang_operation_ *params, - GLuint num_params, - const slang_name_space *space, - slang_atom_pool *atoms, slang_info_log *log); + SLANG_VARIANT, /* the default */ + SLANG_INVARIANT /* indicates the "invariant" keyword */ +} slang_type_variant; -extern GLboolean -_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz); +typedef enum slang_type_centroid_ +{ + SLANG_CENTER, /* the default */ + SLANG_CENTROID /* indicates the "centroid" keyword */ +} slang_type_centroid; -extern GLboolean -_slang_is_swizzle_mask(const slang_swizzle *swz, GLuint rows); -extern GLvoid -_slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *, - const slang_swizzle *); +typedef enum slang_type_qualifier_ +{ + SLANG_QUAL_NONE, + SLANG_QUAL_CONST, + SLANG_QUAL_ATTRIBUTE, + SLANG_QUAL_VARYING, + SLANG_QUAL_UNIFORM, + SLANG_QUAL_OUT, + SLANG_QUAL_INOUT, + SLANG_QUAL_FIXEDOUTPUT, /* internal */ + SLANG_QUAL_FIXEDINPUT /* internal */ +} slang_type_qualifier; + + +typedef enum slang_type_precision_ +{ + SLANG_PREC_DEFAULT, + SLANG_PREC_LOW, + SLANG_PREC_MEDIUM, + SLANG_PREC_HIGH +} slang_type_precision; /** @@ -128,14 +131,21 @@ typedef enum slang_type_specifier_type_ } slang_type_specifier_type; +extern slang_type_specifier_type +slang_type_specifier_type_from_string(const char *); + +extern const char * +slang_type_specifier_type_to_string(slang_type_specifier_type); + + /** * Describes more sophisticated types, like structs and arrays. */ typedef struct slang_type_specifier_ { slang_type_specifier_type type; - struct slang_struct_ *_struct; /**< used if type == spec_struct */ - struct slang_type_specifier_ *_array; /**< used if type == spec_array */ + struct slang_struct_ *_struct; /**< if type == SLANG_SPEC_STRUCT */ + struct slang_type_specifier_ *_array; /**< if type == SLANG_SPEC_ARRAY */ } slang_type_specifier; @@ -145,6 +155,12 @@ slang_type_specifier_ctr(slang_type_specifier *); extern GLvoid slang_type_specifier_dtr(slang_type_specifier *); +extern slang_type_specifier * +slang_type_specifier_new(slang_type_specifier_type type, + struct slang_struct_ *_struct, + struct slang_type_specifier_ *_array); + + extern GLboolean slang_type_specifier_copy(slang_type_specifier *, const slang_type_specifier *); @@ -153,6 +169,33 @@ slang_type_specifier_equal(const slang_type_specifier *, const slang_type_specifier *); +extern GLboolean +slang_type_specifier_compatible(const slang_type_specifier * x, + const slang_type_specifier * y); + + +typedef struct slang_fully_specified_type_ +{ + slang_type_qualifier qualifier; + slang_type_specifier specifier; + slang_type_precision precision; + slang_type_variant variant; + slang_type_centroid centroid; + GLint array_len; /**< -1 if not an array type */ +} slang_fully_specified_type; + +extern int +slang_fully_specified_type_construct(slang_fully_specified_type *); + +extern void +slang_fully_specified_type_destruct(slang_fully_specified_type *); + +extern int +slang_fully_specified_type_copy(slang_fully_specified_type *, + const slang_fully_specified_type *); + + + typedef struct slang_typeinfo_ { GLboolean can_be_referenced; @@ -169,19 +212,9 @@ extern GLvoid slang_typeinfo_destruct(slang_typeinfo *); -/** - * Retrieves type information about an operation. - * Returns GL_TRUE on success. - * Returns GL_FALSE otherwise. - */ -extern GLboolean -_slang_typeof_operation(const slang_assemble_ctx *, - struct slang_operation_ *, - slang_typeinfo *); - extern GLboolean -_slang_typeof_operation_(struct slang_operation_ *, - const slang_name_space *, +_slang_typeof_operation(struct slang_operation_ *, + const struct slang_name_space_ *, slang_typeinfo *, slang_atom_pool *, slang_info_log *log); @@ -191,6 +224,9 @@ _slang_type_is_matrix(slang_type_specifier_type); extern GLboolean _slang_type_is_vector(slang_type_specifier_type); +extern GLboolean +_slang_type_is_float_vec_mat(slang_type_specifier_type); + extern slang_type_specifier_type _slang_type_base(slang_type_specifier_type);