diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-22 22:52:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-23 21:10:24 +0300 |
commit | 57609993d051dacc35794682ed6c24d6552e65a6 (patch) | |
tree | c89d8cbe11b104eafce067416dca576fd618426b /source/blender/gpu | |
parent | af061b4dac140c5acea21f69257bfc5c18b3fe1c (diff) |
GPU: fixes for string socket types in shader nodes.
These are not passed to GLSL functions, but should be used to load e.g.
a texture or attribute.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 8f1ee7ccc59..b486ff14dd1 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -136,12 +136,12 @@ typedef enum GPUBlendMode { typedef struct GPUNodeStack { GPUType type; - const char *name; float vec[4]; struct GPUNodeLink *link; bool hasinput; bool hasoutput; short sockettype; + bool end; } GPUNodeStack; diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index ce75d944747..ece78d4a5cf 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1960,16 +1960,20 @@ bool GPU_stack_link(GPUMaterial *material, bNode *bnode, const char *name, GPUNo totout = 0; if (in) { - for (i = 0; in[i].type != GPU_NONE; i++) { - gpu_node_input_socket(material, bnode, node, &in[i], i); - totin++; + for (i = 0; !in[i].end; i++) { + if (in[i].type != GPU_NONE) { + gpu_node_input_socket(material, bnode, node, &in[i], i); + totin++; + } } } if (out) { - for (i = 0; out[i].type != GPU_NONE; i++) { - gpu_node_output(node, out[i].type, &out[i].link); - totout++; + for (i = 0; !out[i].end; i++) { + if (out[i].type != GPU_NONE) { + gpu_node_output(node, out[i].type, &out[i].link); + totout++; + } } } |