Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2015-01-24 16:10:03 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2015-01-26 18:35:34 +0300
commita59e590e7f113facca2fbee96529d93c781472ac (patch)
tree653a79e152d35c8c7295f5389652781e1e9c95b8 /source/blender/gpu/intern/gpu_codegen.c
parent27284e4f34d4ee0a79cbb2c4c587058b1bf7a03c (diff)
Code cleanup: remove parameter from GPU_node_link_create()
In all but one call the value 0 (aka GPU_NONE) was passed in. Clearer to just default to GPU_NONE and change the one caller that sets a real type to do it explicitly. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D1026
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 048442350cc..6a088a40a45 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -861,10 +861,10 @@ void GPU_pass_unbind(GPUPass *pass)
/* Node Link Functions */
-static GPUNodeLink *GPU_node_link_create(int type)
+static GPUNodeLink *GPU_node_link_create(void)
{
GPUNodeLink *link = MEM_callocN(sizeof(GPUNodeLink), "GPUNodeLink");
- link->type = type;
+ link->type = GPU_NONE;
link->users++;
return link;
@@ -1021,7 +1021,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock)
gpu_node_input_link(node, sock->link, sock->type);
}
else {
- link = GPU_node_link_create(0);
+ link = GPU_node_link_create();
link->ptr1 = sock->vec;
gpu_node_input_link(node, link, sock->type);
}
@@ -1035,7 +1035,8 @@ static void GPU_node_output(GPUNode *node, int type, const char *UNUSED(name), G
output->node = node;
if (link) {
- *link = output->link = GPU_node_link_create(type);
+ *link = output->link = GPU_node_link_create();
+ output->link->type = type;
output->link->output = output;
/* note: the caller owns the reference to the linkfer, GPUOutput
@@ -1145,7 +1146,7 @@ static void gpu_nodes_get_builtin_flag(ListBase *nodes, int *builtin)
GPUNodeLink *GPU_attribute(const CustomDataType type, const char *name)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->attribtype= type;
link->attribname= name;
@@ -1155,7 +1156,7 @@ GPUNodeLink *GPU_attribute(const CustomDataType type, const char *name)
GPUNodeLink *GPU_uniform(float *num)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->ptr1= num;
link->ptr2= NULL;
@@ -1165,7 +1166,7 @@ GPUNodeLink *GPU_uniform(float *num)
GPUNodeLink *GPU_dynamic_uniform(float *num, int dynamictype, void *data)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->ptr1= num;
link->ptr2= data;
@@ -1178,7 +1179,7 @@ GPUNodeLink *GPU_dynamic_uniform(float *num, int dynamictype, void *data)
GPUNodeLink *GPU_image(Image *ima, ImageUser *iuser, bool is_data)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->image = LINK_IMAGE_BLENDER;
link->ptr1 = ima;
@@ -1190,7 +1191,7 @@ GPUNodeLink *GPU_image(Image *ima, ImageUser *iuser, bool is_data)
GPUNodeLink *GPU_image_preview(PreviewImage *prv)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->image= LINK_IMAGE_PREVIEW;
link->ptr1= prv;
@@ -1201,7 +1202,7 @@ GPUNodeLink *GPU_image_preview(PreviewImage *prv)
GPUNodeLink *GPU_texture(int size, float *pixels)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->texture = 1;
link->texturesize = size;
@@ -1212,7 +1213,7 @@ GPUNodeLink *GPU_texture(int size, float *pixels)
GPUNodeLink *GPU_dynamic_texture(GPUTexture *tex, int dynamictype, void *data)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->dynamic = 1;
link->dynamictex = tex;
@@ -1224,7 +1225,7 @@ GPUNodeLink *GPU_dynamic_texture(GPUTexture *tex, int dynamictype, void *data)
GPUNodeLink *GPU_builtin(GPUBuiltin builtin)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->builtin= builtin;
@@ -1233,7 +1234,7 @@ GPUNodeLink *GPU_builtin(GPUBuiltin builtin)
GPUNodeLink *GPU_opengl_builtin(GPUOpenGLBuiltin builtin)
{
- GPUNodeLink *link = GPU_node_link_create(0);
+ GPUNodeLink *link = GPU_node_link_create();
link->oglbuiltin = builtin;