diff options
Diffstat (limited to 'src/mesa/shader/slang/slang_assemble_typeinfo.h')
-rw-r--r-- | src/mesa/shader/slang/slang_assemble_typeinfo.h | 70 |
1 files changed, 61 insertions, 9 deletions
diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h index 777dc21f3a..b2ca8b8633 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.h +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.h @@ -22,12 +22,68 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#if !defined SLANG_ASSEMBLE_TYPEINFO_H -#define SLANG_ASSEMBLE_TYPEINFO_H +#ifndef SLANG_ASSEMBLE_TYPEINFO_H +#define SLANG_ASSEMBLE_TYPEINFO_H 1 -#if defined __cplusplus -extern "C" { -#endif +#include "imports.h" +#include "mtypes.h" +#include "slang_utility.h" +#include "slang_vartable.h" + + +struct slang_operation_; + + +/** + * Holds complete information about vector swizzle - the <swizzle> + * array contains vector component source indices, where 0 is "x", 1 + * is "y", 2 is "z" and 3 is "w". + * Example: "xwz" --> { 3, { 0, 3, 2, not used } }. + */ +typedef struct slang_swizzle_ +{ + GLuint num_components; + GLuint swizzle[4]; +} slang_swizzle; + +typedef struct slang_assembly_name_space_ +{ + struct slang_function_scope_ *funcs; + struct slang_struct_scope_ *structs; + struct slang_variable_scope_ *vars; +} slang_assembly_name_space; + + +typedef struct slang_assemble_ctx_ +{ + slang_atom_pool *atoms; + slang_assembly_name_space space; + slang_swizzle swz; + struct gl_program *program; + slang_var_table *vartable; + + struct slang_function_ *CurFunction; + slang_atom CurLoopBreak; + slang_atom CurLoopCont; +} slang_assemble_ctx; + +extern struct slang_function_ * +_slang_locate_function(const struct slang_function_scope_ *funcs, + slang_atom name, const struct slang_operation_ *params, + GLuint num_params, + const slang_assembly_name_space *space, + slang_atom_pool *); + + +extern GLboolean +_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle *swz); + +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 *); /** @@ -144,9 +200,5 @@ _slang_type_dim(slang_type_specifier_type); -#ifdef __cplusplus -} -#endif - #endif |