Skip to content

Commit

Permalink
[Impeller] Documented the 2 step in the gaussian blur. (#47822)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaaclarke committed Nov 8, 2023
1 parent b3af5d6 commit b67259c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions impeller/entity/shaders/gaussian_blur/gaussian_blur.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ void main() {
f16vec4 total_color = f16vec4(0.0hf);
float16_t gaussian_integral = 0.0hf;

// Step by 2.0 as a performance optimization, relying on bilinear filtering in
// the sampler to blend the texels. Typically the space between pixels is
// calculated so their blended amounts match the gaussian coefficients. This
// just uses 0.5 as an optimization until the gaussian coefficients are
// calculated and passed in from the cpu.
for (float16_t i = -blur_info.blur_radius; i <= blur_info.blur_radius;
i += 2.0hf) {
// Use the 32 bit Gaussian function because the 16 bit variation results in
Expand Down

0 comments on commit b67259c

Please sign in to comment.