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

wgpu example fails with "Swap-chain error: Outdated" #721

Open
phoekz opened this issue Oct 9, 2021 · 7 comments
Open

wgpu example fails with "Swap-chain error: Outdated" #721

phoekz opened this issue Oct 9, 2021 · 7 comments

Comments

@phoekz
Copy link

phoekz commented Oct 9, 2021

[2021-10-09T11:21:53Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
        Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x298c3aa6018, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (800,800), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (800,600), minImageExtent = (800,600), maxImageExtent = (800,600). 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://vulkan.lunarg.com/doc/view/1.2.176.1/windows/1.2-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
[2021-10-09T11:21:53Z ERROR wgpu_hal::vulkan::instance]         objects: (type: DEVICE, hndl: 0x298c3aa6018, name: ?)

This happens on Windows 10. Changing the window sizes to 800,600 works though.

@@ -85,7 +85,7 @@ unsafe impl bytemuck::Pod for BgPoint {}
 unsafe impl bytemuck::Zeroable for BgPoint {}

 const DEFAULT_WINDOW_WIDTH: f32 = 800.0;
-const DEFAULT_WINDOW_HEIGHT: f32 = 800.0;
+const DEFAULT_WINDOW_HEIGHT: f32 = 600.0;
@nical
Copy link
Owner

nical commented Oct 10, 2021

Thanks for filing this. I've seen something like that on some GPUs and not others, I suspect that it is related to resizing the window. I'll spend some time looking into how people handle that with wgpu some time soon-ish.

@nical
Copy link
Owner

nical commented Oct 12, 2021

Could you try again with the latest changes of the master branch? I made a few changes which might have fixed this issue (it wasn't happening on my laptop so I couldn't test).

@phoekz
Copy link
Author

phoekz commented Oct 12, 2021

I pulled a5744af7 and did cargo run --bin wgpu. I got the exact same error. And changing the resolution to 800 x 600 fixes it again 🤔.

@nical
Copy link
Owner

nical commented Oct 13, 2021

Is it only printing the error in the terminal or also crashing the example?

@phoekz
Copy link
Author

phoekz commented Oct 13, 2021

It prints the error once per frame, which is a lot of times when your monitor has high refresh rate. The window stays white.

@nical
Copy link
Owner

nical commented Oct 14, 2021

OK goog to know thanks, I'll keep digging.

@jprochazk
Copy link

This is most likely a bug in Vulkan validation layers. See KhronosGroup/Vulkan-ValidationLayers#1340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants