Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Error in wgpu_hal::vulkan::instance when resizing window. #3451

Open
ghost opened this issue Dec 27, 2021 · 7 comments
Open

Validation Error in wgpu_hal::vulkan::instance when resizing window. #3451

ghost opened this issue Dec 27, 2021 · 7 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@ghost
Copy link

ghost commented Dec 27, 2021

Bevy version

master branch

Operating system & version

Arch Linux, fully updated.

What you did

I created a new Bevy application with the following code:

use bevy::prelude::*;

fn main {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}

What you expected to happen

No error should be logged when resizing the window.

What actually happened

This error was logged:

ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x55964e0750b0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1496,862), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1505,868), minImageExtent = (1505,868), maxImageExtent = (1505,868). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)

Additional Information

GPU is a GT 1030, with backend Vulkan.

@ghost ghost added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Dec 27, 2021
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Dec 27, 2021
@aloucks
Copy link
Contributor

aloucks commented Dec 28, 2021

@mfdorst
Copy link
Contributor

mfdorst commented Dec 28, 2021

I'm also on Arch but I'm not getting any error logged. I'm running integrated graphics on an i7-4770HQ, also Vulkan.

@JMS55
Copy link
Contributor

JMS55 commented May 26, 2023

Maybe fixed by gfx-rs/wgpu#3627? May just be a hack though, it seems like winit might need to change something?

@nezvers
Copy link

nezvers commented Jul 23, 2023

still getting with 0.11 on windows 10 build

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}
[package]
name = "test_project"
version = "0.1.0"
edition = "2021"

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.11", features = ["dynamic_linking"] }

image

@GodGotzi
Copy link

still getting with 0.11 on windows 10 build

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}
[package]
name = "test_project"
version = "0.1.0"
edition = "2021"

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.11", features = ["dynamic_linking"] }

image

same problem here

@arcashka
Copy link
Contributor

Similar issue with cargo run --example window_resizing on windows 11

C:\Users\arcashka\Documents\projects\bevy>cargo run --example window_resizing
    Finished dev [unoptimized + debuginfo] target(s) in 0.47s
     Running `target\debug\examples\window_resizing.exe`
2023-12-10T20:12:51.698240Z  INFO bevy_winit::system: Creating new window "App" (0v0)
2023-12-10T20:12:52.144808Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 2060", vendor: 4318, device: 7944, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "546.29", backend: Vulkan }
2023-12-10T20:12:52.686842Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz", core_count: "8", memory: "15.9 GiB" }
2023-12-10T20:12:58.358823Z ERROR log: VALIDATION [VUID-VkSwapchainCreateInfoKHR-pNext-07781 (0x4c8929c1)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-pNext-07781 ] | MessageID = 0x4c8929c1 | vkCreateSwapchainKHR(): pCreateInfo->imageExtent (1598, 899), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1590,895), minImageExtent = (1590,895), maxImageExtent = (1590,895). The Vulkan spec states: If a VkSwapchainPresentScalingCreateInfoEXT structure was not included in the pNext chain, or it is included and VkSwapchainPresentScalingCreateInfoEXT::scalingBehavior is zero then imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.268.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-pNext-07781)

@Icedude907
Copy link

Icedude907 commented Dec 27, 2023

Win 10, Bevy 0.12.1, Intel UHD 620, Core i5 8250u selected as follows

.set(RenderPlugin{
    render_creation: RenderCreation::Automatic(WgpuSettings{
        power_preference: PowerPreference::LowPower,
        ..default()
    })
})

Triggers both expanding and shrinking the window. No visible issues, just spitting errors.

2023-12-27T12:21:24.391921Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) UHD Graphics 620", vendor: 32902, device: 22807, device_type: IntegratedGpu, driver: "Intel Corporation", driver_info: "Intel driver", backend: Vulkan }
2023-12-27T12:21:25.971405Z ERROR log: VALIDATION [VUID-VkSwapchainCreateInfoKHR-pNext-07781 (0x4c8929c1)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-pNext-07781 ] | MessageID = 0x4c8929c1 | vkCreateSwapchainKHR() called with imageExtent = (804,600), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (849,600), minImageExtent = (849,600), maxImageExtent = (849,600). The Vulkan spec states: If a VkSwapchainPresentScalingCreateInfoEXT structure was not included in the pNext chain, or it is included and VkSwapchainPresentScalingCreateInfoEXT::scalingBehavior is zero then imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.261.1/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-pNext-07781)

From my personal experience swapchain management is a nightmare. I could never get it fully right. Great respect to whoever takes it upon themselves to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

8 participants