The blur utilities have recently been shuffled around and are now in src/gpu/BlurUtils instead of src/gpu/ganesh/GrBlurUtils. However, these are not functions that we'd want to have in the public API. Since we're open source, though, you can definitely look at them to see how we are calculating the values. The Compute2DBlurKernel(
https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/gpu/BlurUtils.cpp;bpv=1;bpt=1;l=18?) function actually computes the full kernel assuming you're doing a pixel sampler for each element in the convolution matrix (i.e. no linear filtering optimization). This is used to calculate ground truth values that we can use in the 1D linear-filtered passes and it's also used directly when the blur sigma is small enough that a heuristic says it's better to do more texture samples within one pass than pay the cost of render pass switches on the GPU.
The function Compute1DBlurLinearKernel (
https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/gpu/BlurUtils.cpp;l=76) shows how to derive the sampling offsets and adjusted kernel weights from the original full 1D kernel. One thing to note is that if you're using the linear filtering optimization and your offsets are being added to the `coord` passed into the SkShader, you need to carefully control that these coords are 1-to-1 with the actual fragment coords (e.g. your canvas matrix is just the identity or integer translation). Otherwise the actual coordinate passed to the input of the blur will end up with texture coords that don't work out to the intended weighting for the 1D blur.
Lastly, another piece of SKia's blurs is that when the sigmas are large (currently > 4, but we can likely push this up to 9 pretty soon), we will do progressive downsampling so we can evaluate a lower resolution image, and then we upscale that blurred image to simulate the larger blur. For variable blurs that won't be an option.
I haven't worked through the math yet, but given that the kernel weights are calculated with functions that put the sigma (function input) into the exponent *and* there's a normalization step that sums the neighboring weights for the denominator, it seems highly likely that the weight function is not linear in terms of sigma, so linearly interpolating them will not produce exact results. I would recommend playing around on desmos or with your demo to see if linear interpolation is acceptable, or if you can get away with a piecewise linear interpolation between several pre-defined sigma values.