Trait sierra::Attachment
source · pub trait Attachment {
fn samples(&self) -> Option<Samples>;
fn format(&self) -> Format;
fn eq(&self, view: &ImageView) -> bool;
fn max_extent(&self) -> Extent2;
fn get_view(
&self,
device: &Device,
usage: ImageUsage,
extent: Extent2
) -> Result<ImageView, OutOfMemory>;
}
Expand description
Trait for types that can be used for attachments in declarative render-pass.
Required Methods§
sourcefn eq(&self, view: &ImageView) -> bool
fn eq(&self, view: &ImageView) -> bool
Returns if this attachment is equivalent to image view.
They are considered equivalent if replacing image view with new one from this attachment will make no difference.
Mainly there are thee possibilities:
- Attachment is
ImageView
, in which case they equivalent only if same. - Attachment is
Image
, in which case anyImageView
with same sub-resource from this image is equivalent. - Attachment is just bunch of properties (e.g.
Format
), in which case anyImageView
with matching properties is equivalent.
sourcefn max_extent(&self) -> Extent2
fn max_extent(&self) -> Extent2
Maximum extend of the image view that can be make for this attachment.
sourcefn get_view(
&self,
device: &Device,
usage: ImageUsage,
extent: Extent2
) -> Result<ImageView, OutOfMemory>
fn get_view(
&self,
device: &Device,
usage: ImageUsage,
extent: Extent2
) -> Result<ImageView, OutOfMemory>
Returns image view with specified usage and extent for this attachment.