pub struct Attachment {
pub kind: AttachmentKind,
pub texture: GpuTexture,
/* private fields */
}Expand description
A frame buffer attachment that tells the frame buffer object where to store the results of rendering.
Fields§
§kind: AttachmentKindCurrent kind of attachment. Tells the renderer how the texture should be used when rendering to the frame buffer. For example, is it color or depth?
texture: GpuTextureA texture the renderer writes to. It may be writing the actual image, or it may just be writing
the depth, or stencil, depending on kind.
Implementations§
Source§impl Attachment
impl Attachment
Sourcepub fn level(&self) -> usize
pub fn level(&self) -> usize
Mip level of the texture where the rendering should happen. In most cases, it can be zero.
Sourcepub fn cube_map_face(&self) -> Option<CubeMapFace>
pub fn cube_map_face(&self) -> Option<CubeMapFace>
Face of the cube map, this field is used only if the texture is a cube map.
This indicates which face of the cube will be rendered to.
Sourcepub fn set_level(&self, level: usize)
pub fn set_level(&self, level: usize)
Mip level of the texture where the rendering should happen. In most cases, it can be zero.
Sourcepub fn set_cube_map_face(&self, face: Option<CubeMapFace>)
pub fn set_cube_map_face(&self, face: Option<CubeMapFace>)
Face of the cube map, this field is used only if the texture is a cube map.
This indicates which face of the cube will be rendered to.
Sourcepub fn color(texture: GpuTexture) -> Self
pub fn color(texture: GpuTexture) -> Self
Creates a new AttachmentKind::Color attachment with the given texture.
Sourcepub fn color_with_level(texture: GpuTexture, level: usize) -> Self
pub fn color_with_level(texture: GpuTexture, level: usize) -> Self
Creates a new AttachmentKind::Color attachment with the given texture and the mip level.
Sourcepub fn color_with_face(texture: GpuTexture, cube_map_face: CubeMapFace) -> Self
pub fn color_with_face(texture: GpuTexture, cube_map_face: CubeMapFace) -> Self
Creates a new AttachmentKind::Color attachment with the given texture and the cube map
face. The texture must be a cube map.
Sourcepub fn depth(texture: GpuTexture) -> Self
pub fn depth(texture: GpuTexture) -> Self
Creates a new AttachmentKind::Depth attachment with the given texture.
Sourcepub fn depth_stencil(texture: GpuTexture) -> Self
pub fn depth_stencil(texture: GpuTexture) -> Self
Creates a new AttachmentKind::DepthStencil attachment with the given texture.
Auto Trait Implementations§
impl !Freeze for Attachment
impl !RefUnwindSafe for Attachment
impl !Send for Attachment
impl !Sync for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
impl !UnwindSafe for Attachment
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<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.