Skip to content

Commit

Permalink
ValidationError-ify samplers (vulkano-rs#2245)
Browse files Browse the repository at this point in the history
* ValidationError-ify samplers

* Fix doctests
  • Loading branch information
Rua authored and hakolao committed Feb 20, 2024
1 parent c01fd32 commit cebcc62
Show file tree
Hide file tree
Showing 22 changed files with 986 additions and 930 deletions.
5 changes: 3 additions & 2 deletions examples/src/bin/async-update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, StorageImage, SwapchainImage,
sampler::{Sampler, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, StorageImage, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -82,7 +84,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Sampler, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
7 changes: 5 additions & 2 deletions examples/src/bin/gl-interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ mod linux {
QueueCreateInfo, QueueFlags,
},
format::Format,
image::{view::ImageView, ImageCreateFlags, ImageUsage, StorageImage, SwapchainImage},
image::{
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageCreateFlags, ImageUsage, StorageImage, SwapchainImage,
},
instance::{
debug::{DebugUtilsMessenger, DebugUtilsMessengerCreateInfo},
Instance, InstanceCreateFlags, InstanceCreateInfo, InstanceExtensions,
Expand All @@ -49,7 +53,6 @@ mod linux {
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{AcquireError, Surface, Swapchain, SwapchainCreateInfo, SwapchainPresentInfo},
sync::{
now,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/image-self-copy-blit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageLayout, ImageUsage, StorageImage,
SwapchainImage,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageLayout, ImageUsage, StorageImage, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -45,7 +46,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/image/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount,
SwapchainImage,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -43,7 +44,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/immutable-sampler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount,
SwapchainImage,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -52,7 +53,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
6 changes: 4 additions & 2 deletions examples/src/bin/interactive_fractal/pixels_draw_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use vulkano::{
allocator::StandardDescriptorSetAllocator, PersistentDescriptorSet, WriteDescriptorSet,
},
device::Queue,
image::ImageViewAbstract,
image::{
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo, SamplerMipmapMode},
ImageViewAbstract,
},
memory::allocator::{AllocationCreateInfo, MemoryAllocator, MemoryUsage},
pipeline::{
graphics::{
Expand All @@ -35,7 +38,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo, SamplerMipmapMode},
};

/// Vertex for textured quads.
Expand Down
6 changes: 4 additions & 2 deletions examples/src/bin/multi_window_game_of_life/pixels_draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ use vulkano::{
allocator::StandardDescriptorSetAllocator, PersistentDescriptorSet, WriteDescriptorSet,
},
device::Queue,
image::ImageViewAbstract,
image::{
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo, SamplerMipmapMode},
ImageViewAbstract,
},
memory::allocator::{AllocationCreateInfo, MemoryUsage},
pipeline::{
graphics::{
Expand All @@ -36,7 +39,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo, SamplerMipmapMode},
};

/// Vertex for textured quads.
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/push-descriptors/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount,
SwapchainImage,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -41,7 +42,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/runtime_array/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount,
SwapchainImage,
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -44,7 +45,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/bin/texture_array/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use vulkano::{
},
format::Format,
image::{
view::ImageView, ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount,
SwapchainImage,
sampler::{Sampler, SamplerCreateInfo},
view::ImageView,
ImageAccess, ImageDimensions, ImageUsage, ImmutableImage, MipmapsCount, SwapchainImage,
},
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
Expand All @@ -43,7 +44,6 @@ use vulkano::{
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Sampler, SamplerCreateInfo},
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainPresentInfo,
Expand Down
2 changes: 1 addition & 1 deletion vulkano/src/command_buffer/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ mod tests {
PersistentDescriptorSet, WriteDescriptorSet,
},
device::{Device, DeviceCreateInfo, QueueCreateInfo},
image::sampler::{Sampler, SamplerCreateInfo},
memory::allocator::{AllocationCreateInfo, MemoryUsage, StandardMemoryAllocator},
pipeline::{layout::PipelineLayoutCreateInfo, PipelineBindPoint, PipelineLayout},
sampler::{Sampler, SamplerCreateInfo},
shader::ShaderStages,
sync::GpuFuture,
};
Expand Down
5 changes: 2 additions & 3 deletions vulkano/src/command_buffer/commands/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ use crate::{
device::{DeviceOwned, QueueFlags},
format::{Format, FormatFeatures, NumericType},
image::{
ImageAccess, ImageAspects, ImageDimensions, ImageLayout, ImageSubresourceLayers, ImageType,
ImageUsage, SampleCount, SampleCounts,
sampler::Filter, ImageAccess, ImageAspects, ImageDimensions, ImageLayout,
ImageSubresourceLayers, ImageType, ImageUsage, SampleCount, SampleCounts,
},
sampler::Filter,
sync::PipelineStageAccessFlags,
DeviceSize, RequirementNotMet, RequiresOneOf, Version, VulkanObject,
};
Expand Down
4 changes: 2 additions & 2 deletions vulkano/src/command_buffer/commands/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use crate::{
device::{DeviceOwned, QueueFlags},
format::{Format, FormatFeatures},
image::{
view::ImageViewType, ImageAccess, ImageAspects, ImageLayout, ImageViewAbstract, SampleCount,
sampler::Sampler, view::ImageViewType, ImageAccess, ImageAspects, ImageLayout,
ImageViewAbstract, SampleCount,
},
pipeline::{
graphics::{
Expand All @@ -34,7 +35,6 @@ use crate::{
},
DynamicState, GraphicsPipeline, PartialStateMode, Pipeline, PipelineLayout,
},
sampler::Sampler,
shader::{DescriptorBindingRequirements, ShaderScalarType, ShaderStage, ShaderStages},
sync::{PipelineStageAccess, PipelineStageAccessFlags},
DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject,
Expand Down
3 changes: 1 addition & 2 deletions vulkano/src/descriptor_set/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
use crate::{
device::{Device, DeviceOwned},
image::ImageLayout,
image::{sampler::Sampler, ImageLayout},
macros::{impl_id_counter, vulkan_bitflags, vulkan_enum},
sampler::Sampler,
shader::{DescriptorBindingRequirements, ShaderStages},
Requires, RequiresAllOf, RequiresOneOf, RuntimeError, ValidationError, Version, VulkanError,
VulkanObject,
Expand Down
3 changes: 1 addition & 2 deletions vulkano/src/descriptor_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ use crate::{
DescriptorBindingFlags, DescriptorSetLayoutCreateFlags, DescriptorType,
},
device::DeviceOwned,
image::ImageLayout,
sampler::Sampler,
image::{sampler::Sampler, ImageLayout},
ValidationError, VulkanObject,
};
use ahash::HashMap;
Expand Down
4 changes: 2 additions & 2 deletions vulkano/src/descriptor_set/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use crate::{
descriptor_set::layout::{DescriptorBindingFlags, DescriptorSetLayoutCreateFlags},
device::DeviceOwned,
image::{
view::ImageViewType, ImageAspects, ImageLayout, ImageType, ImageUsage, ImageViewAbstract,
sampler::Sampler, view::ImageViewType, ImageAspects, ImageLayout, ImageType, ImageUsage,
ImageViewAbstract,
},
sampler::Sampler,
DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError, VulkanObject,
};
use smallvec::SmallVec;
Expand Down
3 changes: 1 addition & 2 deletions vulkano/src/image/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ use crate::{
},
device::{Device, DeviceOwned},
format::Format,
image::sys::ImageCreateInfo,
image::{sampler::Filter, sys::ImageCreateInfo},
memory::{
allocator::{
AllocationCreateInfo, AllocationType, MemoryAllocatePreference, MemoryAllocator,
MemoryAllocatorError, MemoryUsage,
},
is_aligned, DedicatedAllocation,
},
sampler::Filter,
sync::Sharing,
DeviceSize, RuntimeError,
};
Expand Down
1 change: 1 addition & 0 deletions vulkano/src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ mod aspect;
pub mod attachment; // TODO: make private
pub mod immutable; // TODO: make private
mod layout;
pub mod sampler;
mod storage;
pub mod swapchain; // TODO: make private
pub mod sys;
Expand Down
Loading

0 comments on commit cebcc62

Please # to comment.