From 9fc529bcff1de621de3f9cb6bf7e2b4f00b26d3a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Dec 2008 10:17:58 -0700 Subject: [PATCH] mesa: more glsl type/function movement (cherry picked from commit 9a174ef4090189e19831092bb2bae4bfc5396968) --- src/mesa/shader/slang/slang_compile.h | 7 +++++++ src/mesa/shader/slang/slang_compile_function.h | 2 +- src/mesa/shader/slang/slang_compile_variable.h | 8 -------- src/mesa/shader/slang/slang_typeinfo.c | 4 ++-- src/mesa/shader/slang/slang_typeinfo.h | 23 ++++------------------- 5 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index 35e468b..d0f0bfc 100644 --- a/src/mesa/shader/slang/slang_compile.h +++ b/src/mesa/shader/slang/slang_compile.h @@ -37,6 +37,13 @@ extern "C" { #endif +typedef struct slang_name_space_ +{ + struct slang_function_scope_ *funcs; + struct slang_struct_scope_ *structs; + struct slang_variable_scope_ *vars; +} slang_name_space; + typedef enum slang_unit_type_ { SLANG_UNIT_FRAGMENT_SHADER, diff --git a/src/mesa/shader/slang/slang_compile_function.h b/src/mesa/shader/slang/slang_compile_function.h index 85e6943..5a432d4 100644 --- a/src/mesa/shader/slang/slang_compile_function.h +++ b/src/mesa/shader/slang/slang_compile_function.h @@ -84,7 +84,7 @@ 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, + const struct slang_name_space_ *space, slang_atom_pool *atoms, slang_info_log *log, GLboolean *error); diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h index 554684b..4366391 100644 --- a/src/mesa/shader/slang/slang_compile_variable.h +++ b/src/mesa/shader/slang/slang_compile_variable.h @@ -25,10 +25,6 @@ #ifndef SLANG_COMPILE_VARIABLE_H #define SLANG_COMPILE_VARIABLE_H -#if defined __cplusplus -extern "C" { -#endif - struct slang_ir_storage_; @@ -91,8 +87,4 @@ _slang_locate_variable(const slang_variable_scope *, const slang_atom a_name, GLboolean all); -#ifdef __cplusplus -} -#endif - #endif /* SLANG_COMPILE_VARIABLE_H */ diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index a0357d7..4ccd946 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -130,7 +130,7 @@ _slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz) * do not have duplicated fields. Returns GL_TRUE if this is a * swizzle mask. Returns GL_FALSE otherwise */ -GLboolean +static GLboolean _slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows) { GLuint i, c = 0; @@ -154,7 +154,7 @@ _slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows) * Combines (multiplies) two swizzles to form single swizzle. * Example: "vec.wzyx.yx" --> "vec.zw". */ -GLvoid +static void _slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left, const slang_swizzle * right) { diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index 171a899..3837159 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -34,6 +34,9 @@ struct slang_operation_; +struct slang_name_space_; + + /** * Holds complete information about vector swizzle - the @@ -47,27 +50,9 @@ 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; - - -struct slang_assemble_ctx_; - - 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 *); - typedef enum slang_type_variant_ { @@ -229,7 +214,7 @@ slang_typeinfo_destruct(slang_typeinfo *); extern GLboolean _slang_typeof_operation_(struct slang_operation_ *, - const slang_name_space *, + const struct slang_name_space_ *, slang_typeinfo *, slang_atom_pool *, slang_info_log *log); -- 2.7.4