|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Caches the compiled render pipeline that draws the transparency checkerboard behind see-through document regions, plus its bind group layout. More...
#include "donner/svg/renderer/geode/GeodeCheckerboardPipeline.h"
Classes | |
| struct | Uniforms |
| Uniform block consumed by the checkerboard shader. More... | |
Public Types | |
| enum class | BlendMode { Replace , DestinationOver } |
| How the emitted checkerboard combines with whatever is already in the target. More... | |
Public Member Functions | |
| GeodeCheckerboardPipeline (GeodeWgpuAdapterDevice &adapterDevice, gpu::TextureFormat colorFormat, BlendMode blendMode=BlendMode::Replace) | |
| Create the checkerboard pipeline for the given device and target format. | |
| GeodeCheckerboardPipeline (const GeodeCheckerboardPipeline &)=delete | |
| GeodeCheckerboardPipeline & | operator= (const GeodeCheckerboardPipeline &)=delete |
| GeodeCheckerboardPipeline (GeodeCheckerboardPipeline &&) noexcept=default | |
| Move constructor. | |
| GeodeCheckerboardPipeline & | operator= (GeodeCheckerboardPipeline &&) noexcept=default |
| Move assignment operator. | |
| bool | valid () const |
| True when the shader, bind group layout, and pipeline all compiled. | |
| const gpu::RenderPipeline & | pipeline () const |
| The compiled render pipeline. | |
| const gpu::BindGroupLayout & | bindGroupLayout () const |
| Bind group layout used by the pipeline. | |
Caches the compiled render pipeline that draws the transparency checkerboard behind see-through document regions, plus its bind group layout.
Owned by GeodeDevice (lazily, via GeodeDevice::checkerboardPipeline() and GeodeDevice::checkerboardUnderlayPipeline()) so every consumer sharing the device reuses one compiled pipeline per blend mode - the backend retains every pipeline ever constructed, so per-consumer construction leaks (issue #575).
Bind group layout:
The pipeline takes no vertex buffer - the shader emits a fullscreen triangle from @builtin(vertex_index). A draw call is pass.draw(3, 1, 0, 0). The caller owns its uniform buffer and bind group; Uniforms pins the layout contract between the two.
| struct donner::geode::GeodeCheckerboardPipeline::Uniforms |
Uniform block consumed by the checkerboard shader.
|
strong |
How the emitted checkerboard combines with whatever is already in the target.
| donner::geode::GeodeCheckerboardPipeline::GeodeCheckerboardPipeline | ( | GeodeWgpuAdapterDevice & | adapterDevice, |
| gpu::TextureFormat | colorFormat, | ||
| BlendMode | blendMode = BlendMode::Replace ) |
Create the checkerboard pipeline for the given device and target format.
| adapterDevice | The Donner GPU device owned by the GeodeDevice. |
| colorFormat | The pixel format of the render target this pipeline will draw into. Must match the target texture's format at draw time. |
| blendMode | How the emitted checkerboard combines with the target. |