diff options
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 34 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.h | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 6 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 |
4 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 34cf62462a7..62a7d399377 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -76,13 +76,13 @@ typedef enum GPUDataSource { GPU_SOURCE_ATTRIB } GPUDataSource; -static char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4", +static const char* GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4", 0, 0, 0, 0, "mat3", 0, 0, 0, 0, 0, 0, "mat4"}; struct GPUNode { struct GPUNode *next, *prev; - char *name; + const char *name; int tag; ListBase inputs; @@ -93,7 +93,7 @@ struct GPUNodeLink { GPUNodeStack *socket; int attribtype; - char *attribname; + const char *attribname; int image; @@ -188,7 +188,7 @@ static GHash *FUNCTION_HASH= NULL; /*static char *FUNCTION_PROTOTYPES= NULL; static GPUShader *FUNCTION_LIB= NULL;*/ -static int gpu_str_prefix(char *str, char *prefix) +static int gpu_str_prefix(const char *str, const char *prefix) { while(*str && *prefix) { if(*str != *prefix) @@ -346,7 +346,7 @@ static char *gpu_generate_function_prototyps(GHash *hash) } #endif -GPUFunction *GPU_lookup_function(char *name) +GPUFunction *GPU_lookup_function(const char *name) { if(!FUNCTION_HASH) { FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "GPU_lookup_function gh"); @@ -355,7 +355,7 @@ GPUFunction *GPU_lookup_function(char *name) FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);*/ } - return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, name); + return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, (void *)name); } void GPU_extensions_exit(void) @@ -381,7 +381,7 @@ void GPU_extensions_exit(void) /* GLSL code generation */ -static void codegen_convert_datatype(DynStr *ds, int from, int to, char *tmp, int id) +static void codegen_convert_datatype(DynStr *ds, int from, int to, const char *tmp, int id) { char name[1024]; @@ -449,7 +449,7 @@ static int codegen_input_has_texture(GPUInput *input) return input->tex != 0; } -char *GPU_builtin_name(GPUBuiltin builtin) +const char *GPU_builtin_name(GPUBuiltin builtin) { if(builtin == GPU_VIEW_MATRIX) return "unfviewmat"; @@ -554,7 +554,7 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes) { GPUNode *node; GPUInput *input; - char *name; + const char *name; int builtins = 0; /* print uniforms */ @@ -907,11 +907,11 @@ void GPU_node_link_free(GPUNodeLink *link) /* Node Functions */ -GPUNode *GPU_node_begin(char *name) +GPUNode *GPU_node_begin(const char *name) { GPUNode *node = MEM_callocN(sizeof(GPUNode), "GPUNode"); - node->name = name; + node->name= name; return node; } @@ -925,7 +925,7 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type) { GPUInput *input; GPUNode *outnode; - char *name; + const char *name; if(link->output) { outnode = link->output->node; @@ -1036,7 +1036,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock) } } -void GPU_node_output(GPUNode *node, int type, char *UNUSED(name), GPUNodeLink **link) +static void GPU_node_output(GPUNode *node, int type, const char *UNUSED(name), GPUNodeLink **link) { GPUOutput *output = MEM_callocN(sizeof(GPUOutput), "GPUOutput"); @@ -1149,7 +1149,7 @@ void gpu_nodes_get_builtin_flag(ListBase *nodes, int *builtin) /* varargs linking */ -GPUNodeLink *GPU_attribute(int type, char *name) +GPUNodeLink *GPU_attribute(int type, const char *name) { GPUNodeLink *link = GPU_node_link_create(0); @@ -1230,7 +1230,7 @@ GPUNodeLink *GPU_builtin(GPUBuiltin builtin) return link; } -int GPU_link(GPUMaterial *mat, char *name, ...) +int GPU_link(GPUMaterial *mat, const char *name, ...) { GPUNode *node; GPUFunction *function; @@ -1266,7 +1266,7 @@ int GPU_link(GPUMaterial *mat, char *name, ...) return 1; } -int GPU_stack_link(GPUMaterial *mat, char *name, GPUNodeStack *in, GPUNodeStack *out, ...) +int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...) { GPUNode *node; GPUFunction *function; @@ -1333,7 +1333,7 @@ int GPU_link_changed(GPUNodeLink *link) { GPUNode *node; GPUInput *input; - char *name; + const char *name; if(link->output) { node = link->output->node; diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index 3272f0fa1a9..968e679af0e 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -55,7 +55,7 @@ typedef struct GPUFunction { int totparam; } GPUFunction; -GPUFunction *GPU_lookup_function(char *name); +GPUFunction *GPU_lookup_function(const char *name); /* Pass Generation - Takes a list of nodes and a desired output, and makes a pass. This @@ -79,7 +79,7 @@ void GPU_pass_free(GPUPass *pass); /* Material calls */ -char *GPU_builtin_name(GPUBuiltin builtin); +const char *GPU_builtin_name(GPUBuiltin builtin); void gpu_material_add_node(struct GPUMaterial *material, struct GPUNode *node); int GPU_link_changed(struct GPUNodeLink *link); diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 70cc6436702..82a8ac8a62a 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -206,7 +206,7 @@ int GPU_color_depth() return GG.colordepth; } -int GPU_print_error(char *str) +int GPU_print_error(const char *str) { GLenum errCode; @@ -921,7 +921,7 @@ struct GPUShader { int totattrib; /* total number of attributes */ }; -static void shader_print_errors(char *task, char *log, const char *code) +static void shader_print_errors(const char *task, char *log, const char *code) { const char *c, *pos, *end = code + strlen(code); int line = 1; @@ -1090,7 +1090,7 @@ void GPU_shader_free(GPUShader *shader) MEM_freeN(shader); } -int GPU_shader_get_uniform(GPUShader *shader, char *name) +int GPU_shader_get_uniform(GPUShader *shader, const char *name) { return glGetUniformLocationARB(shader->object, name); } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 32754615bf0..592cf809a4f 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -464,7 +464,7 @@ static void area_lamp_vectors(LampRen *lar) static void ramp_blend(GPUMaterial *mat, GPUNodeLink *fac, GPUNodeLink *col1, GPUNodeLink *col2, int type, GPUNodeLink **outcol) { - static char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub", + static const char *names[] = {"mix_blend", "mix_add", "mix_mult", "mix_sub", "mix_screen", "mix_div", "mix_diff", "mix_dark", "mix_light", "mix_overlay", "mix_dodge", "mix_burn", "mix_hue", "mix_sat", "mix_val", "mix_color", "mix_soft", "mix_linear"}; |