diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-24 17:01:13 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-26 18:35:53 +0300 |
commit | 42eaf82d1083c86b9edc8af37553a4b0b2fbbc21 (patch) | |
tree | cd82778ca64cb3ed560315e55ee150ca954a0953 /source/blender/gpu | |
parent | 4c3a49ef3470d88f3da3f88b56ecece42a792cde (diff) |
Code cleanup: move struct GPUFunction and related code out of header
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 20 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.h | 16 |
2 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 42535b5663e..ed0282bd097 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 4091db8be11..0d60b85bdf5 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 |