forked from bartvdbraak/blender
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`).
This commit is contained in:
parent
0a85288462
commit
c8ac1280bb
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user