Skip to content
New issue

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

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

Already on GitHub? # to your account

Surface-capabilities queries return out of date information due to caching #2026

Closed
lilly-lizard opened this issue Oct 6, 2022 · 1 comment · Fixed by #2027
Closed

Surface-capabilities queries return out of date information due to caching #2026

lilly-lizard opened this issue Oct 6, 2022 · 1 comment · Fixed by #2027

Comments

@lilly-lizard
Copy link
Contributor

Issue

PhysicalDevice::surface_capabilities and PhysicalDevice::surface_capabilities_unchecked return out of date information after they're first called due to the new caching functionality introduced in #2006.

Reproduce

Run an example (e.g. triangle) and resize the window. Swapchain recreation always fails due to SwapchainCreationError::ImageExtentNotSupported because the surface capabilities in Swapchain::validate are out of date after the first call to surface_capabilities_unchecked.

This means caching surface queries is unfortunately not viable as surface properties can change at runtime for a given surface and physical device.

@lilly-lizard
Copy link
Contributor Author

not present in 0.31.1 btw

Rua pushed a commit that referenced this issue Oct 6, 2022
…face caching (#2027)

* removed cache check for PhysicalDevice::surface_capabilities_unchecked, fixing window resize bug

* Fixed bug where new caching functionality caused surface queries to be
out of date. surface_capabilities, surface_formats,
surface_present_modes and surface_support are no longer cached as it is
proven that surface properties can change at runtime for a given
surface/physical device.

* Re-added caching for VK_KHR_surface structs surface_formats, surface_present_modes and surface_support, because unlike surface_capabilities, it is almost certain they won't change at runtime.

* remove surface_capabilities cache from macos/ios to fix builds
@Rua Rua closed this as completed in #2027 Oct 6, 2022
fayalalebrun pushed a commit to VideowindoW/vulkano that referenced this issue Oct 22, 2022
…moving surface caching (vulkano-rs#2027)

* removed cache check for PhysicalDevice::surface_capabilities_unchecked, fixing window resize bug

* Fixed bug where new caching functionality caused surface queries to be
out of date. surface_capabilities, surface_formats,
surface_present_modes and surface_support are no longer cached as it is
proven that surface properties can change at runtime for a given
surface/physical device.

* Re-added caching for VK_KHR_surface structs surface_formats, surface_present_modes and surface_support, because unlike surface_capabilities, it is almost certain they won't change at runtime.

* remove surface_capabilities cache from macos/ios to fix builds
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant