diff --git a/.gitignore b/.gitignore index e68133bd..807fd9c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target /Cargo.lock .cargo -examples/src/bin/triangle.png +examples/**/triangle.png +examples/**/mandelbrot.png diff --git a/examples/mandelbrot.png b/examples/mandelbrot.png deleted file mode 100644 index c80ef111..00000000 Binary files a/examples/mandelbrot.png and /dev/null differ diff --git a/examples/src/bin/buffer-pool.rs b/examples/src/bin/buffer-pool.rs index 5bc86db6..adb49a2f 100644 --- a/examples/src/bin/buffer-pool.rs +++ b/examples/src/bin/buffer-pool.rs @@ -23,7 +23,7 @@ use vulkano::buffer::CpuBufferPool; use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; @@ -86,8 +86,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; - let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -99,7 +97,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/deferred/main.rs b/examples/src/bin/deferred/main.rs index 6fd326f8..1dec457b 100644 --- a/examples/src/bin/deferred/main.rs +++ b/examples/src/bin/deferred/main.rs @@ -34,6 +34,7 @@ use vulkano::swapchain::{ }; use vulkano::sync; use vulkano::sync::{FlushError, GpuFuture}; +use vulkano::image::ImageUsage; use vulkano_win::VkSurfaceBuild; use winit::event::{Event, WindowEvent}; @@ -82,8 +83,6 @@ fn main() { let (mut swapchain, mut images) = { let caps = surface.capabilities(physical).unwrap(); - - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -95,7 +94,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/image/main.rs b/examples/src/bin/image/main.rs index 9e7732bb..2bec7987 100644 --- a/examples/src/bin/image/main.rs +++ b/examples/src/bin/image/main.rs @@ -13,7 +13,7 @@ use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; use vulkano::device::{Device, DeviceExtensions}; use vulkano::format::Format; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::{Dimensions, ImmutableImage, SwapchainImage}; +use vulkano::image::{Dimensions, ImmutableImage, SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; @@ -74,8 +74,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -87,7 +85,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/indirect.rs b/examples/src/bin/indirect.rs index 0603f368..69e1f53d 100644 --- a/examples/src/bin/indirect.rs +++ b/examples/src/bin/indirect.rs @@ -36,7 +36,7 @@ use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; use vulkano::descriptor::PipelineLayoutAbstract; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::{ComputePipeline, GraphicsPipeline}; @@ -101,7 +101,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -113,7 +112,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/instancing.rs b/examples/src/bin/instancing.rs index a4b1927a..fc7d46dc 100644 --- a/examples/src/bin/instancing.rs +++ b/examples/src/bin/instancing.rs @@ -22,7 +22,7 @@ use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::vertex::OneVertexOneInstanceDefinition; use vulkano::pipeline::viewport::Viewport; @@ -99,7 +99,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -111,7 +110,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/multi-window.rs b/examples/src/bin/multi-window.rs index ada6dd4d..4d176fee 100644 --- a/examples/src/bin/multi-window.rs +++ b/examples/src/bin/multi-window.rs @@ -20,7 +20,7 @@ use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; @@ -97,7 +97,6 @@ fn main() { // The swapchain and framebuffer images for this perticular window let (swapchain, images) = { - let usage = surface_caps.supported_usage_flags; let alpha = surface_caps .supported_composite_alpha .iter() @@ -113,7 +112,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, @@ -275,7 +274,6 @@ fn main() { .unwrap(); let window_id = surface.window().id(); let (swapchain, images) = { - let usage = surface_caps.supported_usage_flags; let alpha = surface_caps .supported_composite_alpha .iter() @@ -291,7 +289,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/runtime-shader/main.rs b/examples/src/bin/runtime-shader/main.rs index e629fa10..d7d7d363 100644 --- a/examples/src/bin/runtime-shader/main.rs +++ b/examples/src/bin/runtime-shader/main.rs @@ -32,7 +32,7 @@ use vulkano::device::Device; use vulkano::device::DeviceExtensions; use vulkano::format::Format; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::Instance; use vulkano::pipeline::shader::{ GraphicsShaderType, ShaderInterfaceDef, ShaderInterfaceDefEntry, ShaderModule, @@ -100,7 +100,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -112,7 +111,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/teapot/main.rs b/examples/src/bin/teapot/main.rs index 74c1d6f0..7bfd96a4 100644 --- a/examples/src/bin/teapot/main.rs +++ b/examples/src/bin/teapot/main.rs @@ -15,7 +15,7 @@ use vulkano::device::{Device, DeviceExtensions}; use vulkano::format::Format; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; use vulkano::image::attachment::AttachmentImage; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::Instance; use vulkano::instance::PhysicalDevice; use vulkano::pipeline::vertex::TwoBuffersDefinition; @@ -83,7 +83,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; let format = caps.supported_formats[0].0; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); @@ -94,7 +93,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/tessellation.rs b/examples/src/bin/tessellation.rs index 2e0c4e8b..476d7e87 100644 --- a/examples/src/bin/tessellation.rs +++ b/examples/src/bin/tessellation.rs @@ -22,7 +22,7 @@ use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; @@ -172,7 +172,6 @@ fn main() { let (mut swapchain, images) = { let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; let alpha = caps.supported_composite_alpha.iter().next().unwrap(); let format = caps.supported_formats[0].0; let dimensions: [u32; 2] = surface.window().inner_size().into(); @@ -184,7 +183,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index 05d190a1..918b72f7 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -20,7 +20,7 @@ use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; -use vulkano::image::SwapchainImage; +use vulkano::image::{SwapchainImage, ImageUsage}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::pipeline::viewport::Viewport; use vulkano::pipeline::GraphicsPipeline; @@ -151,7 +151,6 @@ fn main() { // Querying the capabilities of the surface. When we create the swapchain we can only // pass values that are allowed by the capabilities. let caps = surface.capabilities(physical).unwrap(); - let usage = caps.supported_usage_flags; // The alpha mode indicates how the alpha value of the final image will behave. For example // you can choose whether the window will be opaque or transparent. @@ -180,7 +179,7 @@ fn main() { format, dimensions, 1, - usage, + ImageUsage::color_attachment(), &queue, SurfaceTransform::Identity, alpha, diff --git a/examples/triangle.png b/examples/triangle.png deleted file mode 100644 index eb614292..00000000 Binary files a/examples/triangle.png and /dev/null differ