From a5cd8fef91edf1d23888d0dc074ace91ef3f147a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Dec 2008 10:11:41 -0700 Subject: mesa: move some glsl compiler functions to different files to be more consistant (cherry picked from commit aeeb9bca2712dbf8540486fc584e214a8af4c7c4) --- src/mesa/shader/slang/slang_typeinfo.h | 88 ++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 21 deletions(-) (limited to 'src/mesa/shader/slang/slang_typeinfo.h') diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index 5e57fbb03e..171a899f64 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -55,17 +55,7 @@ typedef struct slang_name_space_ } slang_name_space; -typedef struct slang_assemble_ctx_ -{ - 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; -} slang_assemble_ctx; +struct slang_assemble_ctx_; extern GLboolean @@ -79,6 +69,43 @@ _slang_multiply_swizzles(slang_swizzle *, const slang_swizzle *, const slang_swizzle *); +typedef enum slang_type_variant_ +{ + SLANG_VARIANT, /* the default */ + SLANG_INVARIANT /* indicates the "invariant" keyword */ +} slang_type_variant; + + +typedef enum slang_type_centroid_ +{ + SLANG_CENTER, /* the default */ + SLANG_CENTROID /* indicates the "centroid" keyword */ +} slang_type_centroid; + + +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; + + /** * The basic shading language types (float, vec4, mat3, etc) */ @@ -119,6 +146,13 @@ 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. */ @@ -155,6 +189,28 @@ 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; @@ -171,16 +227,6 @@ 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 *, -- cgit v1.2.3