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§

Samples for this attachment. None if unspecified.

Format for this attachment.

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:

  1. Attachment is ImageView, in which case they equivalent only if same.
  2. Attachment is Image, in which case any ImageView with same sub-resource from this image is equivalent.
  3. Attachment is just bunch of properties (e.g. Format), in which case any ImageView with matching properties is equivalent.

Maximum extend of the image view that can be make for this attachment.

Returns image view with specified usage and extent for this attachment.

Implementors§