pub struct GBufferAttachment {
pub semantic: GBufferSemantic,
pub format: GBufferAttachmentFormat,
pub color_index: u32,
pub texture_unit: u32,
pub clear_value: ClearValue,
pub linear_filter: bool,
pub mip_levels: u32,
pub texture_handle: u64,
pub label: String,
}Expand description
Describes a single attachment in the G-Buffer.
Fields§
§semantic: GBufferSemanticSemantic role of this attachment.
format: GBufferAttachmentFormatPixel format.
color_index: u32The color attachment index (for MRT). Depth attachments use index u32::MAX.
texture_unit: u32Texture unit to bind when sampling this attachment in the lighting pass.
clear_value: ClearValueClear value for this attachment (RGBA or depth).
linear_filter: boolWhether this attachment should be sampled with linear filtering.
mip_levels: u32Mip levels (1 = no mipmaps).
texture_handle: u64Internal texture handle (opaque ID).
label: StringOptional label for debug tooling.
Implementations§
Source§impl GBufferAttachment
impl GBufferAttachment
pub fn new( semantic: GBufferSemantic, format: GBufferAttachmentFormat, color_index: u32, texture_unit: u32, ) -> Self
Sourcepub fn memory_bytes(&self, width: u32, height: u32) -> u64
pub fn memory_bytes(&self, width: u32, height: u32) -> u64
Returns the memory size in bytes for a given resolution.
Sourcepub fn with_clear_value(self, cv: ClearValue) -> Self
pub fn with_clear_value(self, cv: ClearValue) -> Self
Set a custom clear value.
Sourcepub fn with_linear_filter(self, enabled: bool) -> Self
pub fn with_linear_filter(self, enabled: bool) -> Self
Enable or disable linear filtering.
Sourcepub fn with_mip_levels(self, levels: u32) -> Self
pub fn with_mip_levels(self, levels: u32) -> Self
Set the number of mip levels.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set a debug label.
Trait Implementations§
Source§impl Clone for GBufferAttachment
impl Clone for GBufferAttachment
Source§fn clone(&self) -> GBufferAttachment
fn clone(&self) -> GBufferAttachment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GBufferAttachment
impl RefUnwindSafe for GBufferAttachment
impl Send for GBufferAttachment
impl Sync for GBufferAttachment
impl Unpin for GBufferAttachment
impl UnsafeUnpin for GBufferAttachment
impl UnwindSafe for GBufferAttachment
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.