Commit: 42eaf82d1083c86b9edc8af37553a4b0b2fbbc21 Author: Nicholas Bishop Date: Sat Jan 24 15:01:13 2015 +0100 Branches: master https://developer.blender.org/rB42eaf82d1083c86b9edc8af37553a4b0b2fbbc21
Code cleanup: move struct GPUFunction and related code out of header Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D1026 =================================================================== M source/blender/gpu/intern/gpu_codegen.c M source/blender/gpu/intern/gpu_codegen.h =================================================================== diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 42535b5..ed0282b 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -64,6 +64,20 @@ static char *glsl_material_library = NULL; /* structs and defines */ +#define MAX_FUNCTION_NAME 64 +#define MAX_PARAMETER 32 + +#define FUNCTION_QUAL_IN 0 +#define FUNCTION_QUAL_OUT 1 +#define FUNCTION_QUAL_INOUT 2 + +typedef struct GPUFunction { + char name[MAX_FUNCTION_NAME]; + GPUType paramtype[MAX_PARAMETER]; + int paramqual[MAX_PARAMETER]; + int totparam; +} GPUFunction; + /* Indices match the GPUType enum */ static const char *GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4", NULL, NULL, NULL, NULL, "mat3", NULL, NULL, NULL, NULL, NULL, NULL, "mat4"}; @@ -233,7 +247,7 @@ static char *gpu_generate_function_prototyps(GHash *hash) } #endif -GPUFunction *GPU_lookup_function(const char *name) +static GPUFunction *gpu_lookup_function(const char *name) { if (!FUNCTION_HASH) { FUNCTION_HASH = BLI_ghash_str_new("GPU_lookup_function gh"); @@ -1245,7 +1259,7 @@ bool GPU_link(GPUMaterial *mat, const char *name, ...) va_list params; int i; - function = GPU_lookup_function(name); + function = gpu_lookup_function(name); if (!function) { fprintf(stderr, "GPU failed to find function %s\n", name); return 0; @@ -1279,7 +1293,7 @@ bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNod va_list params; int i, totin, totout; - function = GPU_lookup_function(name); + function = gpu_lookup_function(name); if (!function) { fprintf(stderr, "GPU failed to find function %s\n", name); return 0; diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index 4091db8..0d60b85 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -46,22 +46,6 @@ struct GPUVertexAttribs; struct GPUFrameBuffer; struct PreviewImage; -#define MAX_FUNCTION_NAME 64 -#define MAX_PARAMETER 32 - -#define FUNCTION_QUAL_IN 0 -#define FUNCTION_QUAL_OUT 1 -#define FUNCTION_QUAL_INOUT 2 - -typedef struct GPUFunction { - char name[MAX_FUNCTION_NAME]; - GPUType paramtype[MAX_PARAMETER]; - int paramqual[MAX_PARAMETER]; - int totparam; -} GPUFunction; - -GPUFunction *GPU_lookup_function(const char *name); - /* Pass Generation * - Takes a list of nodes and a desired output, and makes a pass. This * will take ownership of the nodes and free them early if unused or _______________________________________________ Bf-blender-cvs mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-blender-cvs
