|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Caches a compiled wgpu::RenderPipeline 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 (const wgpu::Device &device, wgpu::TextureFormat colorFormat, uint32_t sampleCount=4) | |
| 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 wgpu::RenderPipeline & | pipeline () const |
| The compiled render pipeline. | |
| const wgpu::BindGroupLayout & | bindGroupLayout () const |
| Bind group layout used by the pipeline. | |
| const wgpu::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 wgpu::Sampler & | nearestSampler () const |
| Nearest-neighbor sampler, clamped to edge. Used when ImageParams::imageRenderingPixelated is true. | |
| const wgpu::Sampler & | clipMaskSampler () const |
| Linear clamp-to-edge sampler used for Phase 3b clip-mask textures. | |
| wgpu::TextureFormat | colorFormat () const |
| Color format the pipeline was built for. | |
Caches a compiled wgpu::RenderPipeline 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, in Phase 2H, by the pattern renderer: the pattern tile is rendered to an offscreen texture and then sampled with this same pipeline as a repeating fill.
Bind group layout (matches shaders/image_blit.wgsl):
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 | ( | const wgpu::Device & | device, |
| wgpu::TextureFormat | colorFormat, | ||
| uint32_t | sampleCount = 4 ) |
Create an image-blit pipeline for the given device and target format.
| device | The WebGPU device. |
| colorFormat | The pixel format of the render target this pipeline will draw into. Must match the target texture's format at draw time. |
| sampleCount | MSAA sample count (1 for alpha-coverage, 4 otherwise). |