Fix warnings from earlier PRs (#2206)

This commit is contained in:
Rua 2023-05-12 20:26:49 +02:00 committed by GitHub
parent 56e6871da0
commit 7b8225f364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 29 additions and 32 deletions

View File

@ -84,24 +84,25 @@ use vulkano::{
sampler::{Sampler, SamplerCreateInfo},
shader::PipelineShaderStageCreateInfo,
swapchain::{
acquire_next_image, AcquireError, Swapchain, SwapchainCreateInfo, SwapchainCreationError,
SwapchainPresentInfo,
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainCreationError, SwapchainPresentInfo,
},
sync::{self, FlushError, GpuFuture},
VulkanLibrary,
};
use vulkano_win::VkSurfaceBuild;
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::{Window, WindowBuilder},
window::WindowBuilder,
};
const TRANSFER_GRANULARITY: u32 = 4096;
fn main() {
let event_loop = EventLoop::new();
let library = VulkanLibrary::new().unwrap();
let required_extensions = vulkano_win::required_extensions(&library);
let required_extensions = Surface::required_extensions(&event_loop);
let instance = Instance::new(
library,
InstanceCreateInfo {
@ -112,10 +113,8 @@ fn main() {
)
.unwrap();
let event_loop = EventLoop::new();
let surface = WindowBuilder::new()
.build_vk_surface(&event_loop, instance.clone())
.unwrap();
let window = Arc::new(WindowBuilder::new().build(&event_loop).unwrap());
let surface = Surface::from_window(instance.clone(), window.clone()).unwrap();
let device_extensions = DeviceExtensions {
khr_swapchain: true,
@ -233,11 +232,10 @@ fn main() {
.unwrap()[0]
.0,
);
let window = surface.object().unwrap().downcast_ref::<Window>().unwrap();
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,
@ -544,7 +542,6 @@ fn main() {
channel.send(()).unwrap();
}
Event::RedrawEventsCleared => {
let window = surface.object().unwrap().downcast_ref::<Window>().unwrap();
let dimensions = window.inner_size();
if dimensions.width == 0 || dimensions.height == 0 {
return;

View File

@ -139,7 +139,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -117,7 +117,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -139,7 +139,7 @@ fn main() {
let (swapchain, images) = Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -532,7 +532,7 @@ mod linux {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -143,7 +143,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -141,7 +141,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -147,7 +147,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -156,7 +156,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -155,7 +155,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -372,7 +372,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_caps.min_image_count,
image_format,

View File

@ -137,7 +137,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -137,7 +137,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -144,7 +144,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -148,7 +148,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -155,7 +155,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -144,7 +144,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -249,7 +249,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -143,7 +143,7 @@ fn main() {
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,
image_format,

View File

@ -251,7 +251,7 @@ fn main() {
// Please take a look at the docs for the meaning of the parameters we didn't mention.
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,

View File

@ -220,7 +220,7 @@ fn main() {
// Please take a look at the docs for the meaning of the parameters we didn't mention.
Swapchain::new(
device.clone(),
surface.clone(),
surface,
SwapchainCreateInfo {
min_image_count: surface_capabilities.min_image_count,