From d56eb5e4c223f5c89117cda8dfb1527e02b6a90c Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 8 Aug 2026 05:32:41 -0700 Subject: remove physical_device from ForReinit Vulkanalia tracks it for us in Device. it's used in Model, so it wasn't strictly in-scope for ForReinit; this solves the problem and simplifies some stuff. Force-Push: yes Change-Id: I8e38c236b3dc4c112671382a062c9ada2f34fbb1 --- src/graphics/permanent.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/graphics/permanent.rs') diff --git a/src/graphics/permanent.rs b/src/graphics/permanent.rs index 5282e21..beda3fe 100644 --- a/src/graphics/permanent.rs +++ b/src/graphics/permanent.rs @@ -123,8 +123,8 @@ impl PermanentGraphicsState { vulkanalia::window::create_surface(&instance, &window, &window) }?; - let (physical_device, device, indices, sample_count, graphics_queue, - presentation_queue, enable_anisotropy, enable_swapchain) + let (device, indices, sample_count, graphics_queue, presentation_queue, + enable_anisotropy, enable_swapchain) = init_vulkan_device(&instance, &surface, enable_validation, enable_portability)?; @@ -134,7 +134,7 @@ impl PermanentGraphicsState { window, entry, instance, debug_messager, surface, device, graphics_queue, presentation_queue }, GraphicsStateForReinit { - physical_device, indices, sample_count, descriptor_set_layout, + indices, sample_count, descriptor_set_layout, }, enable_anisotropy, enable_swapchain)) } @@ -215,7 +215,6 @@ impl PermanentGraphicsState { // initial startup, and again any time the window-dressing needs to be // reinitialized. Most notably, they are not needed when rendering. pub struct GraphicsStateForReinit { - pub physical_device: vk::PhysicalDevice, pub indices: QueueFamilyIndices, pub sample_count: vk::SampleCountFlags, pub descriptor_set_layout: vk::DescriptorSetLayout, @@ -416,9 +415,8 @@ fn init_vulkan(window: &Window) fn init_vulkan_device(instance: &Instance, surface: &vk::SurfaceKHR, enable_validation: EnableValidation, enable_portability: EnablePortability) - -> Result<(vk::PhysicalDevice, Device, QueueFamilyIndices, - vk::SampleCountFlags, vk::Queue, vk::Queue, EnableAnisotropy, - EnableSwapchain)> + -> Result<(Device, QueueFamilyIndices, vk::SampleCountFlags, vk::Queue, + vk::Queue, EnableAnisotropy, EnableSwapchain)> { let (physical_device, indices, sample_count) = pick_vulkan_device(instance, surface)?; @@ -541,8 +539,8 @@ fn init_vulkan_device(instance: &Instance, surface: &vk::SurfaceKHR, device.get_device_queue(indices.presentation, 0) }; - Ok((physical_device, device, indices, sample_count, graphics_queue, - presentation_queue, enable_anisotropy, enable_swapchain)) + Ok((device, indices, sample_count, graphics_queue, presentation_queue, + enable_anisotropy, enable_swapchain)) } -- cgit 1.4.1