Color correctness: - Unpremultiply before the sRGB OETF on the display and export blits; encoding premultiplied color corrupted antialiased/transparent edges. - Tag exported video as full-range BT.709 (matrix/primaries/transfer). - Run perception effects (invert, brightness/contrast, hue/saturation) in gamma space to match standard editors. - Interpolate gradients in gamma space across the raster and vector paths. - Render effect thumbnails in the same linear space as the live pipeline. Brush performance: - Store the raster canvas as Rgba16Float (no shadow banding from 8-bit linear), with an incremental per-tile ping-pong sync replacing the per-frame full-canvas copy. - Do the linear->sRGB readback conversion on the GPU and reuse a cached scratch texture, dropping a ~110ms-per-stroke CPU decode. Cleanup: - Single COLOR_WGSL prelude and shared CPU sRGB scalars instead of ~8 duplicated copies of the transfer functions. - Shared compute-pipeline builder; smudge folded onto the tile-sync path.
27 lines
1.0 KiB
Rust
27 lines
1.0 KiB
Rust
// GPU rendering infrastructure for HDR compositing pipeline
|
|
//
|
|
// This module provides:
|
|
// - Buffer pooling for efficient render target management
|
|
// - Compositor for layer blending with proper opacity
|
|
// - Effect pipeline for GPU shader effects
|
|
// - Color space conversion (sRGB ↔ linear)
|
|
|
|
pub mod buffer_pool;
|
|
pub mod color_convert;
|
|
pub mod compositor;
|
|
pub mod effect_processor;
|
|
pub mod yuv_converter;
|
|
|
|
// Re-export commonly used types
|
|
pub use buffer_pool::{BufferHandle, BufferPool, BufferSpec, BufferFormat};
|
|
pub use color_convert::{SrgbToLinearConverter, COLOR_WGSL, srgb_to_linear, linear_to_srgb};
|
|
pub use compositor::{Compositor, CompositorLayer, BlendMode};
|
|
pub use effect_processor::{EffectProcessor, EffectUniforms};
|
|
pub use yuv_converter::YuvConverter;
|
|
|
|
/// Standard HDR internal texture format (16-bit float per channel)
|
|
pub const HDR_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba16Float;
|
|
|
|
/// Display output format (8-bit sRGB)
|
|
pub const DISPLAY_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unorm;
|