Caches a compiled render pipeline for the image-blit shader plus its bind group layout and two reusable samplers (linear and nearest). More...
#include "donner/svg/renderer/geode/GeodeImagePipeline.h"
Public Member Functions | |
| GeodeImagePipeline (gpu::Device &device, gpu::TextureFormat colorFormat) | |
| Create an image-blit pipeline for the given device and target format. | |
| GeodeImagePipeline (const GeodeImagePipeline &)=delete | |
| GeodeImagePipeline & | operator= (const GeodeImagePipeline &)=delete |
| GeodeImagePipeline (GeodeImagePipeline &&) noexcept=default | |
| Move constructor. | |
| GeodeImagePipeline & | operator= (GeodeImagePipeline &&) noexcept=default |
| Move assignment operator. | |
| const gpu::RenderPipeline & | pipeline () const |
| The compiled render pipeline. | |
| const gpu::BindGroupLayout & | bindGroupLayout () const |
| Bind group layout used by the pipeline. | |
| const gpu::Sampler & | linearSampler () const |
| Bilinear (mag/min filter = Linear) sampler, clamped to edge. Used for the default image-rendering and the SVG spec's "smooth" image sampling. | |
| const gpu::Sampler & | nearestSampler () const |
| Nearest-neighbor sampler, clamped to edge. Used when ImageRendering::CrispEdges or its legacy alias is selected. | |
| gpu::TextureFormat | colorFormat () const |
| Color format the pipeline was built for. | |
Caches a compiled render pipeline for the image-blit shader plus its bind group layout and two reusable samplers (linear and nearest).
One GeodeImagePipeline is sufficient per (device, render-target-format) pair. It is used both by drawImage (SVG <image> elements) and by the pattern renderer: the pattern tile is rendered to an offscreen texture and then sampled with this same pipeline as a repeating fill.
The pipeline and samplers are created through the donner::gpu runtime, which owns them through RAII handles.
Resource bindings and entry names come from the compiled shader interface. Optional texture inputs receive valid placeholder views when their corresponding feature is disabled.
The pipeline takes no vertex buffer - the shader generates quad corners from @builtin(vertex_index). A draw call is pass.Draw(6, 1, 0, 0).
| donner::geode::GeodeImagePipeline::GeodeImagePipeline | ( | gpu::Device & | device, |
| gpu::TextureFormat | colorFormat ) |
Create an image-blit pipeline for the given device and target format.
| device | Runtime device the pipeline, its layouts, and its samplers are created on. |
| colorFormat | The pixel format of the render target this pipeline will draw into. Must match the target texture's format at draw time. |