Skip to content

Conversation

@zeozeozeo
Copy link

Previously, when I tried to resize the swapchain on X11 with 125% window scale, the app would crash with this error:

ERROR (SwapChainVK.hpp:110) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create: swapChainDesc.width is out of [2698, 2698] range

Interestingly this only happens if I try resizing by dragging one of the window corners: if I doubleclick on the window decoration to fullscreen it, it works fine.

With this fix, the app will just print tons of warnings instead of crashing, resizing works fine:

WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2442, 1362]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2412, 1352]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2380, 1340]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2230, 1294]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2188, 1280]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [2100, 1240]
WARNING (SwapChainVK.hpp:123) - VK::AMD Radeon Vega 8 Graphics (RADV RAVEN) - Create(): swapChainDesc dimensions clamped to [1360, 738]
...

This is kind of a dirty fix, but I really have no other idea how to prevent this. Could it be an incorrect configuration of VkSwapchainPresentScalingCreateInfoEXT? It could also be an issue of XWayland or the Linux AMD drivers...

@dzhdanNV
Copy link
Collaborator

dzhdanNV commented Jan 12, 2026

Thanks. Before integrating (and polishing - m_Width/Height seem to be redundant), it's worth discussing it:

  • is DeviceDesc::features.resizableSwapChain supported on your device?
  • if no, AcquireNextTexture, WaitForPresent and QueuePresent may return Result::OUT_OF_DATE. Resizing, switching mode or entering/leaving fullscreen mode cause this

With this fix, the app will just print tons of warnings instead of crashing, resizing works fine

It implies that you re-create swapchain on OUT_OF_DATE (?). Why does it get called multiple times? NRI doesn't provide the info about a monitor. GLFW/SDL may be used to query needed info and adjust the swap chain props for just moved/changed window. Resize sample does show how to do it. Currently I think (but I'm not sure) that this fix is a specific fix for your use case.

@zeozeozeo
Copy link
Author

Oh, didn't see the resize sample, my code could very well be wrong. I'll have to test it later.

@zeozeozeo zeozeozeo marked this pull request as draft January 12, 2026 15:50
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

Successfully merging this pull request may close these issues.

2 participants