pub trait BloomEncoder {
type Rec;
type Args;
// Required methods
fn bloom_mip_count(&self) -> usize;
fn begin_bloom(&self, rec: &Self::Rec, args: &Self::Args);
fn bloom_prefilter(&self, rec: &Self::Rec, args: &Self::Args);
fn bloom_downsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize);
fn bloom_upsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize);
}Expand description
Per-backend hooks the shared bloom driver encodes through.
Required Associated Types§
Required Methods§
Sourcefn bloom_mip_count(&self) -> usize
fn bloom_mip_count(&self) -> usize
Number of bloom mips; zero means bloom is off and the driver no-ops.
Sourcefn begin_bloom(&self, rec: &Self::Rec, args: &Self::Args)
fn begin_bloom(&self, rec: &Self::Rec, args: &Self::Args)
One-time per-encode preamble, run once before the sub-passes and on the same recorder: state every sub-pass shares belongs here, not in the per-mip hooks (DX root signature / heap / IA state and the post-process root constants; VK the post-process push constants).
Sourcefn bloom_prefilter(&self, rec: &Self::Rec, args: &Self::Args)
fn bloom_prefilter(&self, rec: &Self::Rec, args: &Self::Args)
Prefilter: scene colour -> mip 0 (soft-knee threshold + Karis average).
Sourcefn bloom_downsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize)
fn bloom_downsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize)
Downsample: mip dst - 1 -> mip dst.
Sourcefn bloom_upsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize)
fn bloom_upsample(&self, rec: &Self::Rec, args: &Self::Args, dst: usize)
Upsample: mip dst + 1 -> mip dst, additively blended.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".