[Bf-blender-cvs] [78411dc] master: Fix T44755 set_value node output in node tree not properly converted to color in GLSL

Antony Riakiotakis noreply at git.blender.org
Tue May 19 15:37:25 CEST 2015


Commit: 78411dc7d77328e6c8fb7b38f7cacd186e68171e
Author: Antony Riakiotakis
Date:   Tue May 19 15:35:33 2015 +0200
Branches: master
https://developer.blender.org/rB78411dc7d77328e6c8fb7b38f7cacd186e68171e

Fix T44755 set_value node output in node tree not properly converted to
color in GLSL

Issue here is that intermediate result was clipped as an optimization in
such nodes and thus not converted to the correct type properly. Now only
clip those values if types match.
This keeps both the optimization and the conversion. I looked at
converting uniform types always but it's more involved to compare types
at conversion time for such links because the type was getting
overridden during link duplication.

===================================================================

M	source/blender/gpu/intern/gpu_codegen.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 90e4ce6..8f07df5 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -930,8 +930,11 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, const GPUType
 	if (link->output) {
 		outnode = link->output->node;
 		name = outnode->name;
+		input = outnode->inputs.first;
 
-		if (STREQ(name, "set_value") || STREQ(name, "set_rgb")) {
+		if ((STREQ(name, "set_value") || STREQ(name, "set_rgb")) &&
+		    (input->type == type))
+		{
 			input = MEM_dupallocN(outnode->inputs.first);
 			input->type = type;
 			if (input->link)




More information about the Bf-blender-cvs mailing list