diff options
author | Omar Emara <mail@OmarEmara.dev> | 2022-08-08 18:31:25 +0300 |
---|---|---|
committer | Omar Emara <mail@OmarEmara.dev> | 2022-08-08 18:31:25 +0300 |
commit | 8d080013f561f0084d8d937c9855c41be63170a4 (patch) | |
tree | 08a583256ece7ddf7d4be410b7549d66a2d3f207 /source/blender/gpu | |
parent | bca20c10da4f3bb92973913c953e4d58da9bd3f1 (diff) |
Fix T100285: Shader value node always outputs zero
The shader value node always outputs zero in some cases even when its
value is not zero.
This is caused by b639e6086445f20d428df1f471c73922bbd54b67. In that
commit, the behavior of GPU node linking changed such that unlinked
sockets get their value from their associated GPU node stack instead of
the socket itself. But execution node stacks do not always have their
output values initialized, and since the value node stores its value in
its output, it follows that its uniform value will be wrong.
This patch fixes that by getting the value directly from the socket.
This is also done fro the RGBA node, since it is implemented similarly.
Finally, the GPU_uniformbuf_link_out function was removed since it is no
longer used and does not make sense anymore.
Differential Revision: https://developer.blender.org/D15641
Reviewed By: Clement
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_node_graph.c | 8 |
2 files changed, 0 insertions, 12 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 12a7cf49f9d..1ab06f3369d 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -167,10 +167,6 @@ bool GPU_stack_link(GPUMaterial *mat, GPUNodeStack *in, GPUNodeStack *out, ...); -GPUNodeLink *GPU_uniformbuf_link_out(struct GPUMaterial *mat, - struct bNode *node, - struct GPUNodeStack *stack, - int index); void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link); void GPU_material_output_volume(GPUMaterial *material, GPUNodeLink *link); diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index c7b2fde492f..377cbc53893 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -738,14 +738,6 @@ bool GPU_stack_link(GPUMaterial *material, return valid; } -GPUNodeLink *GPU_uniformbuf_link_out(GPUMaterial *mat, - bNode *node, - GPUNodeStack *stack, - const int index) -{ - return gpu_uniformbuffer_link(mat, node, stack, index, SOCK_OUT); -} - /* Node Graph */ static void gpu_inputs_free(ListBase *inputs) |