[Impeller] Documented the 2 step in the gaussian blur. (flutter/engine#47822)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
gaaclarke
2023-11-08 13:10:47 -08:00
committed by GitHub
parent 61f09f66a5
commit 40a52fcc16

View File

@@ -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