pub struct MrtConfig {
pub draw_buffers: Vec<u32>,
pub use_explicit_locations: bool,
pub max_draw_buffers: u32,
pub blend_enabled: Vec<bool>,
pub write_masks: Vec<u8>,
}Expand description
Configuration for Multiple Render Targets output from the geometry pass.
Fields§
§draw_buffers: Vec<u32>List of draw buffer indices that the fragment shader writes to.
use_explicit_locations: boolWhether to use gl_FragData[n] or layout(location = n) out.
max_draw_buffers: u32Maximum number of draw buffers supported by the hardware.
blend_enabled: Vec<bool>Whether blending is enabled per-attachment.
write_masks: Vec<u8>Write mask per attachment (bitmask: R=1, G=2, B=4, A=8).
Implementations§
Source§impl MrtConfig
impl MrtConfig
Sourcepub fn from_layout(layout: &GBufferLayout) -> Self
pub fn from_layout(layout: &GBufferLayout) -> Self
Create an MRT configuration from a G-Buffer layout.
Sourcepub fn set_blend(&mut self, index: usize, enabled: bool)
pub fn set_blend(&mut self, index: usize, enabled: bool)
Set blend state for a specific attachment index.
Sourcepub fn set_write_mask(&mut self, index: usize, mask: u8)
pub fn set_write_mask(&mut self, index: usize, mask: u8)
Set write mask for a specific attachment.
Sourcepub fn disable_attachment(&mut self, index: usize)
pub fn disable_attachment(&mut self, index: usize)
Disable writing to a specific attachment (useful for conditional output).
Sourcepub fn enable_attachment(&mut self, index: usize)
pub fn enable_attachment(&mut self, index: usize)
Enable all channels for a specific attachment.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Returns the number of active draw buffers.
Sourcepub fn generate_glsl_outputs(&self, layout: &GBufferLayout) -> String
pub fn generate_glsl_outputs(&self, layout: &GBufferLayout) -> String
Generate GLSL output declarations for the MRT layout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MrtConfig
impl RefUnwindSafe for MrtConfig
impl Send for MrtConfig
impl Sync for MrtConfig
impl Unpin for MrtConfig
impl UnsafeUnpin for MrtConfig
impl UnwindSafe for MrtConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.