From 4f22bdf3e561ac9df46f0cf1e19d9f69f419f5e3 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Feb 2007 15:17:46 -0700 Subject: [PATCH] remove more slang assembly-related code --- .../shader/slang/slang_assemble_typeinfo.c | 2 +- .../shader/slang/slang_assemble_typeinfo.h | 70 ++++++++++++++++--- src/mesa/shader/slang/slang_codegen.c | 2 +- src/mesa/shader/slang/slang_compile.h | 2 +- src/mesa/shader/slang/slang_storage.h | 2 +- 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.c b/src/mesa/shader/slang/slang_assemble_typeinfo.c index 6a87ef3340b..eafc452972b 100644 --- a/src/mesa/shader/slang/slang_assemble_typeinfo.c +++ b/src/mesa/shader/slang/slang_assemble_typeinfo.c @@ -29,7 +29,7 @@ */ #include "imports.h" -#include "slang_assemble.h" +#include "slang_assemble_typeinfo.h" #include "slang_compile.h" #include "slang_error.h" #include "prog_instruction.h" diff --git a/src/mesa/shader/slang/slang_assemble_typeinfo.h b/src/mesa/shader/slang/slang_assemble_typeinfo.h index 777dc21f3a7..b2ca8b8633e 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 + * 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 diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 03562018cab..d39cdd22a55 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -30,7 +30,7 @@ #include "imports.h" #include "macros.h" -#include "slang_assemble.h" +#include "slang_assemble_typeinfo.h" #include "slang_codegen.h" #include "slang_compile.h" #include "slang_storage.h" diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index f2731cb574d..0fe5443c7c4 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -27,7 +27,7 @@ #include "imports.h" #include "mtypes.h" -#include "slang_assemble.h" +#include "slang_assemble_typeinfo.h" #include "slang_compile_variable.h" #include "slang_compile_struct.h" #include "slang_compile_operation.h" diff --git a/src/mesa/shader/slang/slang_storage.h b/src/mesa/shader/slang/slang_storage.h index b433e8bceca..642ffa38c4a 100644 --- a/src/mesa/shader/slang/slang_storage.h +++ b/src/mesa/shader/slang/slang_storage.h @@ -26,7 +26,7 @@ #define SLANG_STORAGE_H #include "slang_compile.h" -#include "slang_assemble.h" +#include "slang_assemble_typeinfo.h" #if defined __cplusplus extern "C" { -- 2.30.2