|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
The subregion-clip compute program, expressed in the donner::gpu::shader IR.
More...
#include "donner/gpu/shader/IrModule.h"Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Enumerations | |
| enum class | donner::gpu::shader::programs::SubregionClipBinding : uint32_t { InputTexture = 0 , OutputTexture = 1 , Params = 2 } |
| Bind group indices of the subregion-clip compute program, shared by the IR builder and every host that creates its bind group layout. More... | |
Functions | |
| ShaderResult< IrModule > | donner::gpu::shader::programs::BuildSubregionClipModule () |
| Builds the subregion-clip compute program: one @compute @workgroup_size(8, 8, 1) entry point named cs_main that copies texels inside a rectangle and writes transparent black outside it. | |
The subregion-clip compute program, expressed in the donner::gpu::shader IR.
|
strong |
Bind group indices of the subregion-clip compute program, shared by the IR builder and every host that creates its bind group layout.
| ShaderResult< IrModule > donner::gpu::shader::programs::BuildSubregionClipModule | ( | ) |
Builds the subregion-clip compute program: one @compute @workgroup_size(8, 8, 1) entry point named cs_main that copies texels inside a rectangle and writes transparent black outside it.
The rectangle is axis-aligned in user space, not in the destination's pixel space, so the test runs on the pixel center mapped back through the uniform's inverse transform. That is what makes the clip correct under a rotated transform, where a pixel-space rectangle would not describe the same region. The rectangle is half-open on both axes: a coordinate equal to the low edge is inside, one equal to the high edge is outside, so abutting subregions neither overlap nor leave a seam.
Invocations outside the destination extent return without writing, so a dispatch rounded up to whole workgroups is safe.