mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2025-02-17 09:33:00 +00:00
Rename ImageView to ImageViewAccess
This commit is contained in:
parent
a94ca9c3c5
commit
9182d44d0a
@ -481,7 +481,7 @@ pub struct SimpleDescriptorSetImg<I> {
|
||||
}
|
||||
|
||||
/*unsafe impl<I> SimpleDescriptorSetResourcesCollection for SimpleDescriptorSetImg<I>
|
||||
where I: ImageView
|
||||
where I: ImageViewAccess
|
||||
{
|
||||
#[inline]
|
||||
fn add_transition<'a>(&'a self, sink: &mut CommandsListSink<'a>) {
|
||||
|
@ -24,7 +24,7 @@ use descriptor::descriptor::DescriptorType;
|
||||
use descriptor::descriptor_set::UnsafeDescriptorSetLayout;
|
||||
use device::Device;
|
||||
use device::DeviceOwned;
|
||||
use image::ImageView;
|
||||
use image::ImageViewAccess;
|
||||
use sampler::Sampler;
|
||||
|
||||
use check_errors;
|
||||
@ -740,7 +740,7 @@ macro_rules! smallvec {
|
||||
impl DescriptorWrite {
|
||||
#[inline]
|
||||
pub fn storage_image<I>(binding: u32, array_element: u32, image: &I) -> DescriptorWrite
|
||||
where I: ImageView
|
||||
where I: ImageViewAccess
|
||||
{
|
||||
DescriptorWrite {
|
||||
binding: binding,
|
||||
@ -763,7 +763,7 @@ impl DescriptorWrite {
|
||||
|
||||
#[inline]
|
||||
pub fn sampled_image<I>(binding: u32, array_element: u32, image: &I) -> DescriptorWrite
|
||||
where I: ImageView
|
||||
where I: ImageViewAccess
|
||||
{
|
||||
DescriptorWrite {
|
||||
binding: binding,
|
||||
@ -777,7 +777,7 @@ impl DescriptorWrite {
|
||||
|
||||
#[inline]
|
||||
pub fn combined_image_sampler<I>(binding: u32, array_element: u32, sampler: &Arc<Sampler>, image: &I) -> DescriptorWrite
|
||||
where I: ImageView
|
||||
where I: ImageViewAccess
|
||||
{
|
||||
DescriptorWrite {
|
||||
binding: binding,
|
||||
@ -881,7 +881,7 @@ impl DescriptorWrite {
|
||||
|
||||
#[inline]
|
||||
pub fn input_attachment<I>(binding: u32, array_element: u32, image: &I) -> DescriptorWrite
|
||||
where I: ImageView
|
||||
where I: ImageViewAccess
|
||||
{
|
||||
DescriptorWrite {
|
||||
binding: binding,
|
||||
|
@ -10,7 +10,7 @@
|
||||
use std::cmp;
|
||||
use std::sync::Arc;
|
||||
use SafeDeref;
|
||||
use image::ImageView;
|
||||
use image::ImageViewAccess;
|
||||
use image::sys::UnsafeImageView;
|
||||
//use sync::AccessFlagBits;
|
||||
//use sync::PipelineStages;
|
||||
@ -54,7 +54,7 @@ unsafe impl AttachmentsList for () {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl AttachmentsList for Vec<Arc<ImageView + Send + Sync>> {
|
||||
unsafe impl AttachmentsList for Vec<Arc<ImageViewAccess + Send + Sync>> {
|
||||
#[inline]
|
||||
fn raw_image_view_handles(&self) -> Vec<&UnsafeImageView> {
|
||||
self.iter().map(|img| img.inner()).collect()
|
||||
@ -90,8 +90,8 @@ unsafe impl AttachmentsList for Vec<Arc<ImageView + Send + Sync>> {
|
||||
macro_rules! impl_into_atch_list {
|
||||
($first:ident $(, $rest:ident)*) => (
|
||||
unsafe impl<$first $(, $rest)*> AttachmentsList for ($first, $($rest),*)
|
||||
where $first: ImageView,
|
||||
$($rest: ImageView,)*
|
||||
where $first: ImageViewAccess,
|
||||
$($rest: ImageViewAccess,)*
|
||||
{
|
||||
#[inline]
|
||||
#[allow(non_snake_case)]
|
||||
|
@ -19,7 +19,7 @@ use framebuffer::RenderPassDescClearValues;
|
||||
use framebuffer::RenderPassCompatible;
|
||||
use framebuffer::RenderPassCreationError;
|
||||
use image::Layout as ImageLayout;
|
||||
use image::ImageView;
|
||||
use image::ImageViewAccess;
|
||||
use sync::AccessFlagBits;
|
||||
use sync::PipelineStages;
|
||||
|
||||
@ -45,7 +45,7 @@ use vk;
|
||||
/// `build_render_pass` must build a render pass from the description and not a different one.
|
||||
///
|
||||
pub unsafe trait RenderPassDesc: RenderPassDescClearValues<Vec<ClearValue>> +
|
||||
RenderPassDescAttachmentsList<Vec<Arc<ImageView + Send + Sync>>>
|
||||
RenderPassDescAttachmentsList<Vec<Arc<ImageViewAccess + Send + Sync>>>
|
||||
{
|
||||
/// Returns the number of attachments of the render pass.
|
||||
fn num_attachments(&self) -> usize;
|
||||
|
@ -18,7 +18,7 @@ use framebuffer::RenderPassDescClearValues;
|
||||
use framebuffer::LayoutAttachmentDescription;
|
||||
use framebuffer::LayoutPassDescription;
|
||||
use framebuffer::LayoutPassDependencyDescription;
|
||||
use image::ImageView;
|
||||
use image::ImageViewAccess;
|
||||
|
||||
/// Description of an empty render pass.
|
||||
///
|
||||
@ -143,9 +143,9 @@ unsafe impl RenderPassDesc for EmptySinglePassRenderPassDesc {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl RenderPassDescAttachmentsList<Vec<Arc<ImageView + Send + Sync>>> for EmptySinglePassRenderPassDesc {
|
||||
unsafe impl RenderPassDescAttachmentsList<Vec<Arc<ImageViewAccess + Send + Sync>>> for EmptySinglePassRenderPassDesc {
|
||||
#[inline]
|
||||
fn check_attachments_list(&self, list: Vec<Arc<ImageView + Send + Sync>>) -> Result<Box<AttachmentsList + Send + Sync>, FramebufferCreationError> {
|
||||
fn check_attachments_list(&self, list: Vec<Arc<ImageViewAccess + Send + Sync>>) -> Result<Box<AttachmentsList + Send + Sync>, FramebufferCreationError> {
|
||||
if list.is_empty() {
|
||||
Ok(Box::new(()) as Box<_>)
|
||||
} else {
|
||||
|
@ -62,7 +62,7 @@ use vk;
|
||||
/// use vulkano::framebuffer::Framebuffer;
|
||||
///
|
||||
/// # let render_pass: Arc<RenderPassAbstract + Send + Sync> = return;
|
||||
/// # let my_image: Arc<vulkano::image::ImageView> = return;
|
||||
/// # let my_image: Arc<vulkano::image::ImageViewAccess> = return;
|
||||
/// // let render_pass: Arc<RenderPassAbstract + Send + Sync> = ...;
|
||||
/// let framebuffer = Framebuffer::new(render_pass.clone(), [1024, 768, 1],
|
||||
/// vec![my_image.clone() as Arc<_>]).unwrap();
|
||||
@ -78,7 +78,7 @@ use vk;
|
||||
///
|
||||
/// > **Note**: The reason why `Vec<Arc<ImageView + Send + Sync>>` always works (see previous section) is that
|
||||
/// > render pass descriptions are required to always implement
|
||||
/// > `RenderPassDescAttachmentsList<Vec<Arc<ImageView + Send + Sync>>>`.
|
||||
/// > `RenderPassDescAttachmentsList<Vec<Arc<ImageViewAccess + Send + Sync>>>`.
|
||||
///
|
||||
/// When it comes to the `single_pass_renderpass!` and `ordered_passes_renderpass!` macros, you can
|
||||
/// build a list of attachments by calling `start_attachments()` on the render pass description,
|
||||
@ -111,7 +111,7 @@ use vk;
|
||||
/// }
|
||||
/// ).unwrap();
|
||||
///
|
||||
/// # let my_image: Arc<vulkano::image::ImageView> = return;
|
||||
/// # let my_image: Arc<vulkano::image::ImageViewAccess> = return;
|
||||
/// let framebuffer = {
|
||||
/// let atch = render_pass.desc().start_attachments().foo(my_image.clone() as Arc<_>);
|
||||
/// Framebuffer::new(render_pass, [1024, 768, 1], atch).unwrap()
|
||||
|
@ -77,7 +77,7 @@ macro_rules! ordered_passes_renderpass {
|
||||
use $crate::framebuffer::LayoutPassDescription;
|
||||
use $crate::framebuffer::LayoutPassDependencyDescription;
|
||||
use $crate::image::Layout;
|
||||
use $crate::image::ImageView;
|
||||
use $crate::image::ImageViewAccess;
|
||||
use $crate::sync::AccessFlagBits;
|
||||
use $crate::sync::PipelineStages;
|
||||
|
||||
@ -103,7 +103,7 @@ macro_rules! ordered_passes_renderpass {
|
||||
use $crate::framebuffer::AttachmentsList;
|
||||
use $crate::framebuffer::FramebufferCreationError;
|
||||
use $crate::framebuffer::RenderPassDescAttachmentsList;
|
||||
use $crate::image::traits::ImageView;
|
||||
use $crate::image::traits::ImageViewAccess;
|
||||
use super::CustomRenderPassDesc;
|
||||
pub struct AttachmentsStart;
|
||||
ordered_passes_renderpass!{[] __impl_attachments__ [] [] [$($atch_name),*] [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]}
|
||||
@ -158,8 +158,8 @@ macro_rules! ordered_passes_renderpass {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl RenderPassDescAttachmentsList<Vec<Arc<ImageView + Send + Sync>>> for CustomRenderPassDesc {
|
||||
fn check_attachments_list(&self, list: Vec<Arc<ImageView + Send + Sync>>) -> Result<Box<AttachmentsList + Send + Sync>, FramebufferCreationError> {
|
||||
unsafe impl RenderPassDescAttachmentsList<Vec<Arc<ImageViewAccess + Send + Sync>>> for CustomRenderPassDesc {
|
||||
fn check_attachments_list(&self, list: Vec<Arc<ImageViewAccess + Send + Sync>>) -> Result<Box<AttachmentsList + Send + Sync>, FramebufferCreationError> {
|
||||
// FIXME: correct safety checks
|
||||
assert_eq!(list.len(), self.num_attachments());
|
||||
Ok(Box::new(list) as Box<_>)
|
||||
@ -388,7 +388,7 @@ macro_rules! ordered_passes_renderpass {
|
||||
|
||||
([] __impl_attachments__ [$prev:ident] [$($prev_params:ident),*] [] [$($params:ident),*]) => {
|
||||
unsafe impl<$($prev_params),*> RenderPassDescAttachmentsList<$prev<$($prev_params),*>> for CustomRenderPassDesc
|
||||
where $($prev_params: ImageView + Send + Sync + 'static),*
|
||||
where $($prev_params: ImageViewAccess + Send + Sync + 'static),*
|
||||
{
|
||||
//type List = ($($prev_params,)*);
|
||||
|
||||
|
@ -29,7 +29,7 @@ use image::sys::Usage;
|
||||
use image::traits::ImageAccess;
|
||||
use image::traits::ImageClearValue;
|
||||
use image::traits::ImageContent;
|
||||
use image::traits::ImageView;
|
||||
use image::traits::ImageViewAccess;
|
||||
use image::traits::Image;
|
||||
use image::traits::IntoImageView;
|
||||
use memory::pool::AllocLayout;
|
||||
@ -305,7 +305,7 @@ unsafe impl<F, A> IntoImageView for Arc<AttachmentImage<F, A>>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<F, A> ImageView for AttachmentImageAccess<F, A>
|
||||
unsafe impl<F, A> ImageViewAccess for AttachmentImageAccess<F, A>
|
||||
where F: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
#[inline]
|
||||
|
@ -22,7 +22,7 @@ use image::sys::UnsafeImageView;
|
||||
use image::sys::Usage;
|
||||
use image::traits::ImageAccess;
|
||||
use image::traits::ImageContent;
|
||||
use image::traits::ImageView;
|
||||
use image::traits::ImageViewAccess;
|
||||
use image::traits::Image;
|
||||
use image::traits::IntoImageView;
|
||||
use instance::QueueFamily;
|
||||
@ -185,7 +185,7 @@ unsafe impl<P, F, A> ImageContent<P> for ImmutableImage<F, A>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<F: 'static, A> ImageView for ImmutableImage<F, A>
|
||||
unsafe impl<F: 'static, A> ImageViewAccess for ImmutableImage<F, A>
|
||||
where F: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
#[inline]
|
||||
|
@ -54,7 +54,7 @@ pub use self::sys::ImageCreationError;
|
||||
pub use self::sys::Layout;
|
||||
pub use self::sys::Usage;
|
||||
pub use self::traits::ImageAccess;
|
||||
pub use self::traits::ImageView;
|
||||
pub use self::traits::ImageViewAccess;
|
||||
pub use self::traits::Image;
|
||||
pub use self::traits::IntoImageView;
|
||||
|
||||
|
@ -27,7 +27,7 @@ use image::sys::Usage;
|
||||
use image::traits::ImageAccess;
|
||||
use image::traits::ImageClearValue;
|
||||
use image::traits::ImageContent;
|
||||
use image::traits::ImageView;
|
||||
use image::traits::ImageViewAccess;
|
||||
use image::traits::Image;
|
||||
use image::traits::IntoImageView;
|
||||
use instance::QueueFamily;
|
||||
@ -218,7 +218,7 @@ unsafe impl<P, F, A> ImageContent<P> for StorageImage<F, A>
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<F, A> ImageView for StorageImage<F, A>
|
||||
unsafe impl<F, A> ImageViewAccess for StorageImage<F, A>
|
||||
where F: 'static + Send + Sync, A: MemoryPool
|
||||
{
|
||||
#[inline]
|
||||
|
@ -18,7 +18,7 @@ use image::ViewType;
|
||||
use image::traits::ImageAccess;
|
||||
use image::traits::ImageClearValue;
|
||||
use image::traits::ImageContent;
|
||||
use image::traits::ImageView;
|
||||
use image::traits::ImageViewAccess;
|
||||
use image::traits::Image;
|
||||
use image::traits::IntoImageView;
|
||||
use image::sys::Layout;
|
||||
@ -133,7 +133,7 @@ unsafe impl<P> ImageContent<P> for SwapchainImage {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl ImageView for SwapchainImage {
|
||||
unsafe impl ImageViewAccess for SwapchainImage {
|
||||
#[inline]
|
||||
fn parent(&self) -> &ImageAccess {
|
||||
self
|
||||
|
@ -208,13 +208,13 @@ pub unsafe trait ImageContent<P>: ImageAccess {
|
||||
|
||||
/// Utility trait.
|
||||
pub unsafe trait IntoImageView {
|
||||
type Target: ImageView;
|
||||
type Target: ImageViewAccess;
|
||||
|
||||
fn into_image_view(self) -> Self::Target;
|
||||
}
|
||||
|
||||
/// Trait for types that represent image views.
|
||||
pub unsafe trait ImageView {
|
||||
pub unsafe trait ImageViewAccess {
|
||||
fn parent(&self) -> &ImageAccess;
|
||||
|
||||
/// Returns the dimensions of the image view.
|
||||
@ -259,7 +259,7 @@ pub unsafe trait ImageView {
|
||||
//fn usable_as_render_pass_attachment(&self, ???) -> Result<(), ???>;
|
||||
}
|
||||
|
||||
unsafe impl<T> ImageView for T where T: SafeDeref, T::Target: ImageView {
|
||||
unsafe impl<T> ImageViewAccess for T where T: SafeDeref, T::Target: ImageViewAccess {
|
||||
#[inline]
|
||||
fn parent(&self) -> &ImageAccess {
|
||||
(**self).parent()
|
||||
@ -303,6 +303,6 @@ unsafe impl<T> ImageView for T where T: SafeDeref, T::Target: ImageView {
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe trait AttachmentImageView: ImageView {
|
||||
pub unsafe trait AttachmentImageView: ImageViewAccess {
|
||||
fn accept(&self, initial_layout: Layout, final_layout: Layout) -> bool;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user