Differential D16990 Diff 60050 source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_filter_comp.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_filter_comp.glsl
| /** | /** | ||||
| * Gather Filter pass: Filter the gather pass result to reduce noise. | * Gather Filter pass: Filter the gather pass result to reduce noise. | ||||
| * | * | ||||
| * This is a simple 3x3 median filter to avoid dilating highlights with a 3x3 max filter even if | * This is a simple 3x3 median filter to avoid dilating highlights with a 3x3 max filter even if | ||||
| * cheaper. | * cheaper. | ||||
| */ | */ | ||||
| struct FilterSample { | struct FilterSample { | ||||
| vec4 color; | vec4 color; | ||||
| float weight; | float weight; | ||||
| #ifdef GPU_METAL | |||||
| inline FilterSample() = default; | |||||
| inline FilterSample(vec4 in_color, float in_weight) : color(in_color), weight(in_weight) | |||||
| { | |||||
| } | |||||
| #endif | |||||
| }; | }; | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Pixel cache. | /** \name Pixel cache. | ||||
| * \{ */ | * \{ */ | ||||
| #define cache_size (gl_WorkGroupSize.x + 2) | |||||
| const uint cache_size = gl_WorkGroupSize.x + 2; | |||||
| shared vec4 color_cache[cache_size][cache_size]; | shared vec4 color_cache[cache_size][cache_size]; | ||||
| shared float weight_cache[cache_size][cache_size]; | shared float weight_cache[cache_size][cache_size]; | ||||
| void cache_init() | void cache_init() | ||||
| { | { | ||||
| /** | /** | ||||
| * Load enough values into LDS to perform the filter. | * Load enough values into LDS to perform the filter. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||