diff --git a/vulkano-shaders/src/descriptor_sets.rs b/vulkano-shaders/src/descriptor_sets.rs index a9ed411a..b04f0897 100644 --- a/vulkano-shaders/src/descriptor_sets.rs +++ b/vulkano-shaders/src/descriptor_sets.rs @@ -67,7 +67,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String { Some(( "::vulkano::descriptor_set::DescriptorType::SampledImage", "::std::sync::Arc<::vulkano::image::ImageView>", - "::vulkano::descriptor_set::DescriptorBind::SampledImage(data, ::vulkano::image::Layout::ShaderReadOnlyOptimal)" // FIXME: + "::vulkano::descriptor_set::DescriptorBind::SampledImage(data)" )) }, &parse::Instruction::TypeImage { result_id, sampled_type_id, ref dim, arrayed, ms, @@ -77,7 +77,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String { Some(( "::vulkano::descriptor_set::DescriptorType::InputAttachment", // FIXME: can be `StorageImage` "::std::sync::Arc<::vulkano::image::ImageView>", - "::vulkano::descriptor_set::DescriptorBind::InputAttachment(data, ::vulkano::image::Layout::ShaderReadOnlyOptimal)" // FIXME: + "::vulkano::descriptor_set::DescriptorBind::InputAttachment(data)" )) }, &parse::Instruction::TypeSampledImage { result_id, image_type_id } @@ -86,7 +86,7 @@ pub fn write_descriptor_sets(doc: &parse::Spirv) -> String { Some(( "::vulkano::descriptor_set::DescriptorType::CombinedImageSampler", "(::std::sync::Arc<::vulkano::sampler::Sampler>, ::std::sync::Arc<::vulkano::image::ImageView>)", - "::vulkano::descriptor_set::DescriptorBind::CombinedImageSampler(data.0, data.1, ::vulkano::image::Layout::ShaderReadOnlyOptimal)" // FIXME: + "::vulkano::descriptor_set::DescriptorBind::CombinedImageSampler(data.0, data.1)" )) }, _ => None, // TODO: other types diff --git a/vulkano/src/descriptor_set/layout_def.rs b/vulkano/src/descriptor_set/layout_def.rs index b1ab3dee..e4889d9a 100644 --- a/vulkano/src/descriptor_set/layout_def.rs +++ b/vulkano/src/descriptor_set/layout_def.rs @@ -87,17 +87,17 @@ pub struct DescriptorWrite { // FIXME: incomplete #[derive(Clone)] // TODO: Debug pub enum DescriptorBind { - StorageImage(Arc, ImageLayout), + StorageImage(Arc), Sampler(Arc), - SampledImage(Arc, ImageLayout), - CombinedImageSampler(Arc, Arc, ImageLayout), + SampledImage(Arc), + CombinedImageSampler(Arc, Arc), //UniformTexelBuffer(Arc), // FIXME: requires buffer views //StorageTexelBuffer(Arc), // FIXME: requires buffer views UniformBuffer { buffer: Arc, offset: usize, size: usize }, StorageBuffer { buffer: Arc, offset: usize, size: usize }, DynamicUniformBuffer { buffer: Arc, offset: usize, size: usize }, DynamicStorageBuffer { buffer: Arc, offset: usize, size: usize }, - InputAttachment(Arc, ImageLayout), + InputAttachment(Arc), } impl DescriptorBind { @@ -106,16 +106,16 @@ impl DescriptorBind { pub fn ty(&self) -> DescriptorType { match *self { DescriptorBind::Sampler(_) => DescriptorType::Sampler, - DescriptorBind::CombinedImageSampler(_, _, _) => DescriptorType::CombinedImageSampler, - DescriptorBind::SampledImage(_, _) => DescriptorType::SampledImage, - DescriptorBind::StorageImage(_, _) => DescriptorType::StorageImage, + DescriptorBind::CombinedImageSampler(_, _) => DescriptorType::CombinedImageSampler, + DescriptorBind::SampledImage(_) => DescriptorType::SampledImage, + DescriptorBind::StorageImage(_) => DescriptorType::StorageImage, //DescriptorBind::UniformTexelBuffer(_) => DescriptorType::UniformTexelBuffer, //DescriptorBind::StorageTexelBuffer(_) => DescriptorType::StorageTexelBuffer, DescriptorBind::UniformBuffer { .. } => DescriptorType::UniformBuffer, DescriptorBind::StorageBuffer { .. } => DescriptorType::StorageBuffer, DescriptorBind::DynamicUniformBuffer { .. } => DescriptorType::UniformBufferDynamic, DescriptorBind::DynamicStorageBuffer { .. } => DescriptorType::StorageBufferDynamic, - DescriptorBind::InputAttachment(_, _) => DescriptorType::InputAttachment, + DescriptorBind::InputAttachment(_) => DescriptorType::InputAttachment, } } } diff --git a/vulkano/src/descriptor_set/vk_objects.rs b/vulkano/src/descriptor_set/vk_objects.rs index f20d6c97..b6fd7b92 100644 --- a/vulkano/src/descriptor_set/vk_objects.rs +++ b/vulkano/src/descriptor_set/vk_objects.rs @@ -164,43 +164,43 @@ impl DescriptorSet where S: SetLayout { imageLayout: 0, }) }, - DescriptorBind::CombinedImageSampler(ref sampler, ref image, layout) => { + DescriptorBind::CombinedImageSampler(ref sampler, ref image) => { assert!(image.inner_view().usage_sampled()); self_resources_samplers.push(sampler.clone()); self_resources_image_views.push(image.clone()); Some(vk::DescriptorImageInfo { sampler: sampler.internal_object(), imageView: image.inner_view().internal_object(), - imageLayout: layout as u32, + imageLayout: image.descriptor_set_combined_image_sampler_layout() as u32, }) }, - DescriptorBind::StorageImage(ref image, layout) => { + DescriptorBind::StorageImage(ref image) => { assert!(image.inner_view().usage_storage()); assert!(image.identity_swizzle()); self_resources_image_views.push(image.clone()); Some(vk::DescriptorImageInfo { sampler: 0, imageView: image.inner_view().internal_object(), - imageLayout: layout as u32, + imageLayout: image.descriptor_set_storage_image_layout() as u32, }) }, - DescriptorBind::SampledImage(ref image, layout) => { + DescriptorBind::SampledImage(ref image) => { assert!(image.inner_view().usage_sampled()); self_resources_image_views.push(image.clone()); Some(vk::DescriptorImageInfo { sampler: 0, imageView: image.inner_view().internal_object(), - imageLayout: layout as u32, + imageLayout: image.descriptor_set_sampled_image_layout() as u32, }) }, - DescriptorBind::InputAttachment(ref image, layout) => { + DescriptorBind::InputAttachment(ref image) => { assert!(image.inner_view().usage_input_attachment()); assert!(image.identity_swizzle()); self_resources_image_views.push(image.clone()); Some(vk::DescriptorImageInfo { sampler: 0, imageView: image.inner_view().internal_object(), - imageLayout: layout as u32, + imageLayout: image.descriptor_set_input_attachment_layout() as u32, }) }, _ => None @@ -213,9 +213,9 @@ impl DescriptorSet where S: SetLayout { let vk_writes = write.iter().map(|write| { let (buffer_info, image_info) = match write.content { - DescriptorBind::Sampler(_) | DescriptorBind::CombinedImageSampler(_, _ ,_) | - DescriptorBind::SampledImage(_, _) | DescriptorBind::StorageImage(_, _) | - DescriptorBind::InputAttachment(_, _) => { + DescriptorBind::Sampler(_) | DescriptorBind::CombinedImageSampler(_, _) | + DescriptorBind::SampledImage(_) | DescriptorBind::StorageImage(_) | + DescriptorBind::InputAttachment(_) => { let img = image_descriptors.as_ptr().offset(next_image_desc as isize); next_image_desc += 1; (ptr::null(), img) diff --git a/vulkano/src/image/attachment.rs b/vulkano/src/image/attachment.rs index 5d6309f4..b030d9b1 100644 --- a/vulkano/src/image/attachment.rs +++ b/vulkano/src/image/attachment.rs @@ -211,22 +211,22 @@ unsafe impl ImageView for AttachmentImage { } #[inline] - fn descriptor_set_storage_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_storage_image_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_combined_image_sampler_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_combined_image_sampler_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_sampled_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_sampled_image_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_input_attachment_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_input_attachment_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } diff --git a/vulkano/src/image/immutable.rs b/vulkano/src/image/immutable.rs index ae4295f0..0277fd63 100644 --- a/vulkano/src/image/immutable.rs +++ b/vulkano/src/image/immutable.rs @@ -178,22 +178,22 @@ unsafe impl ImageView for ImmutableImage { } #[inline] - fn descriptor_set_storage_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_storage_image_layout(&self) -> Layout { Layout::ShaderReadOnlyOptimal } #[inline] - fn descriptor_set_combined_image_sampler_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_combined_image_sampler_layout(&self) -> Layout { Layout::ShaderReadOnlyOptimal } #[inline] - fn descriptor_set_sampled_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_sampled_image_layout(&self) -> Layout { Layout::ShaderReadOnlyOptimal } #[inline] - fn descriptor_set_input_attachment_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_input_attachment_layout(&self) -> Layout { Layout::ShaderReadOnlyOptimal } diff --git a/vulkano/src/image/swapchain.rs b/vulkano/src/image/swapchain.rs index ac7c7c67..5176c7d7 100644 --- a/vulkano/src/image/swapchain.rs +++ b/vulkano/src/image/swapchain.rs @@ -173,22 +173,22 @@ unsafe impl ImageView for SwapchainImage { } #[inline] - fn descriptor_set_storage_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_storage_image_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_combined_image_sampler_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_combined_image_sampler_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_sampled_image_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_sampled_image_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } #[inline] - fn descriptor_set_input_attachment_layout(&self, _: AccessRange) -> Layout { + fn descriptor_set_input_attachment_layout(&self) -> Layout { Layout::ColorAttachmentOptimal } diff --git a/vulkano/src/image/traits.rs b/vulkano/src/image/traits.rs index b699ece9..b341bf5b 100644 --- a/vulkano/src/image/traits.rs +++ b/vulkano/src/image/traits.rs @@ -132,13 +132,13 @@ pub unsafe trait ImageView { } /// Returns the image layout to use in a descriptor with the given subresource. - fn descriptor_set_storage_image_layout(&self, AccessRange) -> Layout; + fn descriptor_set_storage_image_layout(&self) -> Layout; /// Returns the image layout to use in a descriptor with the given subresource. - fn descriptor_set_combined_image_sampler_layout(&self, AccessRange) -> Layout; + fn descriptor_set_combined_image_sampler_layout(&self) -> Layout; /// Returns the image layout to use in a descriptor with the given subresource. - fn descriptor_set_sampled_image_layout(&self, AccessRange) -> Layout; + fn descriptor_set_sampled_image_layout(&self) -> Layout; /// Returns the image layout to use in a descriptor with the given subresource. - fn descriptor_set_input_attachment_layout(&self, AccessRange) -> Layout; + fn descriptor_set_input_attachment_layout(&self) -> Layout; /// Returns true if the view doesn't use components swizzling. ///