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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2022-01-08 07:38:35 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2022-01-08 07:53:45 +0300
commit90e5ce6ab513e733dddecddb65ed4f303c5589f7 (patch)
tree0852b993335083e9988e1a54c92b6d4084b6e596 /source/blender/nodes
parent741ed5fcd2e2ede686f2a024181cb6b769745cdb (diff)
Cleanup: Loop through socket listbase instead of array
The socket arrays will be removed when using the new socket builder. So instead we have to loop through the node outputs list.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_attribute.cc3
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_coord.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.cc b/source/blender/nodes/shader/nodes/node_shader_attribute.cc
index 780d0a72ef8..3e9c57df7cf 100644
--- a/source/blender/nodes/shader/nodes/node_shader_attribute.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_attribute.cc
@@ -76,7 +76,8 @@ static int node_shader_gpu_attribute(GPUMaterial *mat,
GPU_stack_link(mat, node, "node_attribute", in, out, cd_attr);
/* for each output. */
- for (int i = 0; sh_node_attribute_out[i].type != -1; i++) {
+ int i;
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->outputs, i) {
node_shader_gpu_bump_tex_coord(mat, node, &out[i].link);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc
index 9372d29456d..723458b7321 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc
@@ -63,8 +63,8 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat,
GPU_stack_link(
mat, node, "node_tex_coord", in, out, viewpos, worldnor, inv_obmat, texcofacs, orco, mtface);
- /* for each output. */
- for (int i = 0; sh_node_tex_coord_out[i].type != -1; i++) {
+ int i;
+ LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->outputs, i) {
node_shader_gpu_bump_tex_coord(mat, node, &out[i].link);
/* Normalize some vectors after dFdx/dFdy offsets.
* This is the case for interpolated, non linear functions.