pub unsafe trait ImageAccess: DeviceOwned + Send + Sync {
Show 16 methods
fn inner(&self) -> ImageInner<'_>;
fn initial_layout_requirement(&self) -> ImageLayout;
fn final_layout_requirement(&self) -> ImageLayout;
fn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>;
fn dimensions(&self) -> ImageDimensions { ... }
fn format(&self) -> Format { ... }
fn format_features(&self) -> &FormatFeatures { ... }
fn mip_levels(&self) -> u32 { ... }
fn samples(&self) -> SampleCount { ... }
fn usage(&self) -> &ImageUsage { ... }
fn subresource_layers(&self) -> ImageSubresourceLayers { ... }
fn subresource_range(&self) -> ImageSubresourceRange { ... }
unsafe fn layout_initialized(&self) { ... }
fn is_layout_initialized(&self) -> bool { ... }
fn initial_layout(&self) -> ImageLayout { ... }
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> Arc<ImageAccessFromUndefinedLayout<Self>>
where
Self: Sized,
{ ... }
}
Expand description
Trait for types that represent the way a GPU can access an image.
Required Methods
fn inner(&self) -> ImageInner<'_>
fn inner(&self) -> ImageInner<'_>
Returns the inner unsafe image object used by this image.
fn initial_layout_requirement(&self) -> ImageLayout
fn initial_layout_requirement(&self) -> ImageLayout
Returns the layout that the image has when it is first used in a primary command buffer.
The first time you use an image in an AutoCommandBufferBuilder
, vulkano will suppose that
the image is in the layout returned by this function. Later when the command buffer is
submitted vulkano will check whether the image is actually in this layout, and if it is not
the case then an error will be returned.
TODO: ^ that check is not yet implemented
fn final_layout_requirement(&self) -> ImageLayout
fn final_layout_requirement(&self) -> ImageLayout
Returns the layout that the image must be returned to before the end of the command buffer.
When an image is used in an AutoCommandBufferBuilder
vulkano will automatically
transition this image to the layout returned by this function at the end of the command
buffer, if necessary.
Except for special cases, this value should likely be the same as the one returned by
initial_layout_requirement
so that the user can submit multiple command buffers that use
this image one after the other.
fn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
fn descriptor_layouts(&self) -> Option<ImageDescriptorLayouts>
Returns an ImageDescriptorLayouts
structure specifying the image layout to use
in descriptors of various kinds.
This must return Some
if the image is to be used to create an image view.
Provided Methods
fn dimensions(&self) -> ImageDimensions
fn dimensions(&self) -> ImageDimensions
Returns the dimensions of the image.
fn format_features(&self) -> &FormatFeatures
fn format_features(&self) -> &FormatFeatures
Returns the features supported by the image’s format.
fn mip_levels(&self) -> u32
fn mip_levels(&self) -> u32
Returns the number of mipmap levels of this image.
fn samples(&self) -> SampleCount
fn samples(&self) -> SampleCount
Returns the number of samples of this image.
fn usage(&self) -> &ImageUsage
fn usage(&self) -> &ImageUsage
Returns the usage the image was created with.
fn subresource_layers(&self) -> ImageSubresourceLayers
fn subresource_layers(&self) -> ImageSubresourceLayers
Returns an ImageSubresourceLayers
covering the first mip level of the image. All aspects
of the image are selected, or plane0
if the image is multi-planar.
fn subresource_range(&self) -> ImageSubresourceRange
fn subresource_range(&self) -> ImageSubresourceRange
Returns an ImageSubresourceRange
covering the whole image. If the image is multi-planar,
only the color
aspect is selected.
unsafe fn layout_initialized(&self)
unsafe fn layout_initialized(&self)
When images are created their memory layout is initially Undefined
or Preinitialized
.
This method allows the image memory barrier creation process to signal when an image
has been transitioned out of its initial Undefined
or Preinitialized
state. This
allows vulkano to avoid creating unnecessary image memory barriers between future
uses of the image.
Unsafe
If a user calls this method outside of the intended context and signals that the layout
is no longer Undefined
or Preinitialized
when it is still in an Undefined
or
Preinitialized
state, this may result in the vulkan implementation attempting to use
an image in an invalid layout. The same problem must be considered by the implementer
of the method.
fn is_layout_initialized(&self) -> bool
fn initial_layout(&self) -> ImageLayout
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> Arc<ImageAccessFromUndefinedLayout<Self>> where
Self: Sized,
unsafe fn forced_undefined_initial_layout(
self,
preinitialized: bool
) -> Arc<ImageAccessFromUndefinedLayout<Self>> where
Self: Sized,
Wraps around this ImageAccess
and returns an identical ImageAccess
but whose initial
layout requirement is either Undefined
or Preinitialized
.