pub struct BloomFeature { /* private fields */ }Expand description
Persistent bloom feature owning GPU pipelines, layouts, and pre-built static bind groups.
The Composer calls extract_and_prepare
once per frame before the render graph is built, then
add_to_graph to emit a chain of flattened
micro-passes (Extract → Downsample × N → Upsample × N → Composite)
into the RDG.
§Dual-Layer BindGroup Model
Static bind groups (Group 0) containing samplers and uniform buffers are built here and shared across all micro-pass nodes as cheap clones. Each micro-pass only assembles Group 1 (transient texture views).
Implementations§
Source§impl BloomFeature
impl BloomFeature
Sourcepub fn extract_and_prepare(
&mut self,
ctx: &mut ExtractContext<'_>,
upsample_uniform: &CpuBuffer<UpsampleUniforms>,
composite_uniform: &CpuBuffer<CompositeUniforms>,
)
pub fn extract_and_prepare( &mut self, ctx: &mut ExtractContext<'_>, upsample_uniform: &CpuBuffer<UpsampleUniforms>, composite_uniform: &CpuBuffer<CompositeUniforms>, )
Ensure all persistent GPU resources (layouts, static buffers, pipelines) are initialised. Build or rebuild static bind groups (Group 0) when the underlying GPU buffer identity changes.
upsample_uniform and composite_uniform are the CpuBuffer IDs
whose GPU mirrors have already been uploaded via ensure_buffer().
Sourcepub fn add_to_graph<'a>(
&'a self,
ctx: &mut GraphBuilderContext<'a, '_>,
input_color: TextureNodeId,
karis_average: bool,
max_mip_levels: u32,
) -> TextureNodeId
pub fn add_to_graph<'a>( &'a self, ctx: &mut GraphBuilderContext<'a, '_>, input_color: TextureNodeId, karis_average: bool, max_mip_levels: u32, ) -> TextureNodeId
Emit the full bloom pipeline as a chain of independent RDG passes.
Each downsample and upsample step is a separate pass operating on independent 2D transient textures with progressively halved resolution. The RDG compiler sees fine-grained dependencies between every mip level, enabling:
- Optimal barrier/transition insertion between individual steps.
- Aggressive memory aliasing — textures whose lifetimes don’t overlap are automatically mapped to the same physical GPU memory.
Returns the composited output TextureNodeId (scene HDR with
bloom applied) for downstream wiring (e.g. ToneMapping).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BloomFeature
impl !RefUnwindSafe for BloomFeature
impl Send for BloomFeature
impl Sync for BloomFeature
impl Unpin for BloomFeature
impl UnsafeUnpin for BloomFeature
impl !UnwindSafe for BloomFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().