[Bf-blender-cvs] [e1d2485fd32] blender-v2.93-release: EEVEE: AOVs not same as cycles.

Jeroen Bakker noreply at git.blender.org
Wed Jun 9 08:54:46 CEST 2021


Commit: e1d2485fd32b7792d09a91074c51465dd0c02145
Author: Jeroen Bakker
Date:   Wed Jun 2 16:58:36 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBe1d2485fd32b7792d09a91074c51465dd0c02145

EEVEE: AOVs not same as cycles.

EEVEE uses hashing to sync aov names and types with the gpu.
For the type a hashed value was overridden making `decalA`
and `decalB` choose the same hash. This patches fixes this
by removing the most significant bit.

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

M	source/blender/draw/engines/eevee/eevee_renderpasses.c
M	source/blender/nodes/shader/nodes/node_shader_output_aov.c

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

diff --git a/source/blender/draw/engines/eevee/eevee_renderpasses.c b/source/blender/draw/engines/eevee/eevee_renderpasses.c
index 5739024993e..5ada53ab98c 100644
--- a/source/blender/draw/engines/eevee/eevee_renderpasses.c
+++ b/source/blender/draw/engines/eevee/eevee_renderpasses.c
@@ -79,7 +79,7 @@ bool EEVEE_renderpasses_only_first_sample_pass_active(EEVEE_Data *vedata)
  * type the rest of the bits are used for the name hash. */
 int EEVEE_renderpasses_aov_hash(const ViewLayerAOV *aov)
 {
-  int hash = BLI_hash_string(aov->name);
+  int hash = BLI_hash_string(aov->name) << 1;
   SET_FLAG_FROM_TEST(hash, aov->type == AOV_TYPE_COLOR, EEVEE_AOV_HASH_COLOR_TYPE_MASK);
   return hash;
 }
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 403b3e6d9d6..7e7e1b703f1 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_aov.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_aov.c
@@ -43,8 +43,9 @@ static int node_shader_gpu_output_aov(GPUMaterial *mat,
 {
   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;
+  /* Keep in sync with `renderpass_lib.glsl#render_pass_aov_hash` and
+   * `EEVEE_renderpasses_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);



More information about the Bf-blender-cvs mailing list