From: Brian Paul Date: Fri, 12 Dec 2008 17:17:58 +0000 (-0700) Subject: mesa: more glsl type/function movement X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a174ef4090189e19831092bb2bae4bfc5396968;p=mesa.git mesa: more glsl type/function movement --- diff --git a/src/mesa/shader/slang/slang_compile.h b/src/mesa/shader/slang/slang_compile.h index 35e468b44e7..d0f0bfc8fba 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 85e69432aca..5a432d46670 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 554684b75f5..43663919955 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 a0357d7cef5..4ccd9465da6 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 171a899f64d..38371592617 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);