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

Fix validation layer warnings #80071

Merged
merged 1 commit into from
Aug 1, 2023
Merged

Conversation

darksylinc
Copy link
Contributor

  1. Validation layers on Windows were complaining w/ VUID-VkSwapchainCreateInfoKHR-surface-01270 that we were not calling vkGetPhysicalDeviceSurfaceSupportKHR before vkCreateSwapchainKHR.

  2. Godot was only calling vkGetPhysicalDeviceSurfaceSupportKHR at startup, but it should be doing this for every window w/ a new surface it wants to create, not just the first one.

    • In practice this will likely not make a difference. If vkGetPhysicalDeviceSurfaceSupportKHR returns false after initialization, there's nothing we can do about it and it is likely because something else went terribly wrong, which is why the error message is worded like that.
    • This is mostly to shut up validation layers. Though technically, the layers are right.
  3. Do not call vkGetPhysicalDeviceSurfaceSupportKHR on queues we don't even plan on ever using. We don't know how drivers will react to that (e.g. they may preemptetively allocate resources to support presentation on exotic queues, instead of just saying no). Just behave like every other Vulkan app out there.

1. Validation layers on Windows were complaining w/
VUID-VkSwapchainCreateInfoKHR-surface-01270 that we were not calling
vkGetPhysicalDeviceSurfaceSupportKHR before vkCreateSwapchainKHR.

2. Godot was only calling vkGetPhysicalDeviceSurfaceSupportKHR at
startup, but it should be doing this for every window w/ a new surface
it wants to create, not just the first one.
- In practice this will likely not make a difference. If
vkGetPhysicalDeviceSurfaceSupportKHR returns false after initialization,
there's nothing we can do about it and it is likely because something
else went terribly wrong, which is why the error message is worded like
that.
- This is mostly to shut up validation layers. Though technically,
the layers are right.

3. Do not call vkGetPhysicalDeviceSurfaceSupportKHR on queues we don't
even plan on ever using. We don't know how drivers will react to that
(e.g. they may preemptetively allocate resources to support presentation
on exotic queues, instead of just saying no). Just behave like every
other Vulkan app out there.
@darksylinc darksylinc requested a review from a team as a code owner July 30, 2023 20:09
@clayjohn clayjohn added this to the 4.2 milestone Jul 30, 2023
@darksylinc
Copy link
Contributor Author

One of the PR checks failed because it ran out of disk space.

@YuriSizov YuriSizov merged commit eda04c5 into godotengine:master Aug 1, 2023
@YuriSizov
Copy link
Contributor

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants