pub fn make_texture_resample_shader_source(
filter: TextureFilterMethod,
dst_fmt: TextureFormat,
) -> StringExpand description
Generate WGSL source for a texture-based resampling compute shader.
The shader binds:
binding 0: a sampleabletexture_2d<f32>(the source raster).binding 1: asamplerconfigured with the requested filter mode.binding 2: a write-onlytexture_storage_2d<{dst_fmt}, write>(the destination raster).
Each invocation maps its destination pixel (gid.x, gid.y) to a normalised
uv coordinate at the pixel centre, samples the source texture with
textureSampleLevel(..., 0.0), and writes the result to the storage
texture.
The filter parameter is not baked into the shader text — the wgpu
Sampler binding determines the actual filtering behaviour. The parameter
is accepted here for documentation purposes and to enable future shader
specialisations.