Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ConvolveMatrix.h File Reference

SVG matrix-convolution compute program expressed in the shader IR. More...

Include dependency graph for ConvolveMatrix.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

ShaderResult< IrModule > donner::gpu::shader::programs::BuildConvolveMatrixModule ()
 Applies a bounded row-major kernel to premultiplied float texels.

Detailed Description

SVG matrix-convolution compute program expressed in the shader IR.

Function Documentation

◆ BuildConvolveMatrixModule()

ShaderResult< IrModule > donner::gpu::shader::programs::BuildConvolveMatrixModule ( )

Applies a bounded row-major kernel to premultiplied float texels.

The host validates positive orders, a coefficient count equal to their product, targets inside the kernel, a finite nonzero divisor, and the fixed kernel capacity before dispatch. Edge mode 0 duplicates, 1 wraps, and 2 samples transparent black. The kernel is rotated 180 degrees as required by SVG. With preserveAlpha set, RGB is convolved in straight-alpha space and then associated with the unchanged source alpha.