[Bf-blender-cvs] [c8ac1280bb7] master: EEVEE-Next: Move weight layer indexes to shader shared.
Jeroen Bakker
noreply at git.blender.org
Fri Sep 2 11:37:09 CEST 2022
Commit: c8ac1280bb7e69bffadff4cf8c8f71f9c0ec6616
Author: Jeroen Bakker
Date: Fri Sep 2 11:33:33 2022 +0200
Branches: master
https://developer.blender.org/rBc8ac1280bb7e69bffadff4cf8c8f71f9c0ec6616
EEVEE-Next: Move weight layer indexes to shader shared.
Upcoming cryptomatte patch would need access to these defines. So moving
them from film_lib to shader shared. We cannot include the film_lib as
it requires images/textures to be bound that we don't need.
At the same time fixes incorrect casing (`lAYER` => `LAYER`).
===================================================================
M source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
M source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl
===================================================================
diff --git a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
index a0829bc49aa..73c090386c9 100644
--- a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
+++ b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
@@ -194,6 +194,11 @@ BLI_STATIC_ASSERT_ALIGN(CameraData, 16)
#define FILM_PRECOMP_SAMPLE_MAX 16
+enum eFilmWeightLayerIndex : uint32_t {
+ FILM_WEIGHT_LAYER_ACCUMULATION = 0u,
+ FILM_WEIGHT_LAYER_DISTANCE = 1u,
+};
+
struct FilmSample {
int2 texel;
float weight;
diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl
index 964c078036b..087efa9100d 100644
--- a/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl
+++ b/source/blender/draw/engines/eevee_next/shaders/eevee_film_lib.glsl
@@ -164,9 +164,6 @@ void film_sample_accum_combined(FilmSample samp, inout vec4 accum, inout float w
/** \name Load/Store Data
* \{ */
-#define WEIGHT_lAYER_ACCUMULATION 0
-#define WEIGHT_lAYER_DISTANCE 1
-
/* Returns the distance used to store nearest interpolation data. */
float film_distance_load(ivec2 texel)
{
@@ -176,7 +173,7 @@ float film_distance_load(ivec2 texel)
if (!film_buf.use_history || film_buf.use_reprojection) {
return 1.0e16;
}
- return imageLoad(in_weight_img, ivec3(texel, WEIGHT_lAYER_DISTANCE)).x;
+ return imageLoad(in_weight_img, ivec3(texel, FILM_WEIGHT_LAYER_DISTANCE)).x;
}
float film_weight_load(ivec2 texel)
@@ -187,7 +184,7 @@ float film_weight_load(ivec2 texel)
if (!film_buf.use_history || film_buf.use_reprojection) {
return 0.0;
}
- return imageLoad(in_weight_img, ivec3(texel, WEIGHT_lAYER_ACCUMULATION)).x;
+ return imageLoad(in_weight_img, ivec3(texel, FILM_WEIGHT_LAYER_ACCUMULATION)).x;
}
/* Returns motion in pixel space to retrieve the pixel history. */
@@ -550,12 +547,12 @@ void film_store_depth(ivec2 texel_film, float value, out float out_depth)
void film_store_distance(ivec2 texel, float value)
{
- imageStore(out_weight_img, ivec3(texel, WEIGHT_lAYER_DISTANCE), vec4(value));
+ imageStore(out_weight_img, ivec3(texel, FILM_WEIGHT_LAYER_DISTANCE), vec4(value));
}
void film_store_weight(ivec2 texel, float value)
{
- imageStore(out_weight_img, ivec3(texel, WEIGHT_lAYER_ACCUMULATION), vec4(value));
+ imageStore(out_weight_img, ivec3(texel, FILM_WEIGHT_LAYER_ACCUMULATION), vec4(value));
}
float film_display_depth_ammend(ivec2 texel, float depth)
More information about the Bf-blender-cvs
mailing list