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:
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_output_aov.c')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output_aov.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_aov.c b/source/blender/nodes/shader/nodes/node_shader_output_aov.c
index 8e73a547bf7..403b3e6d9d6 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_aov.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_aov.c
@@ -19,6 +19,8 @@
#include "../node_shader_util.h"
+#include "BLI_hash.h"
+
/* **************** OUTPUT ******************** */
static bNodeSocketTemplate sh_node_output_aov_in[] = {
@@ -33,6 +35,22 @@ static void node_shader_init_output_aov(bNodeTree *UNUSED(ntree), bNode *node)
node->storage = aov;
}
+static int node_shader_gpu_output_aov(GPUMaterial *mat,
+ bNode *node,
+ bNodeExecData *UNUSED(execdata),
+ GPUNodeStack *in,
+ GPUNodeStack *out)
+{
+ GPUNodeLink *outlink;
+ NodeShaderOutputAOV *aov = (NodeShaderOutputAOV *)node->storage;
+ /* Keep in sync with `renderpass_lib.glsl#render_pass_aov_hash`. */
+ unsigned int hash = BLI_hash_string(aov->name) & ~1;
+ GPU_stack_link(mat, node, "node_output_aov", in, out, &outlink);
+ GPU_material_add_output_link_aov(mat, outlink, hash);
+
+ return true;
+}
+
/* node type definition */
void register_node_type_sh_output_aov(void)
{
@@ -43,6 +61,7 @@ void register_node_type_sh_output_aov(void)
node_type_init(&ntype, node_shader_init_output_aov);
node_type_storage(
&ntype, "NodeShaderOutputAOV", node_free_standard_storage, node_copy_standard_storage);
+ node_type_gpu(&ntype, node_shader_gpu_output_aov);
/* Do not allow muting output node. */
node_type_internal_links(&ntype, NULL);