Skip to content

windowSize / currentExtent vkGetPhysicalDeviceSurfaceCapabilitiesKHR #43

@buhman

Description

@buhman

Swapchain

This wording (emphasis added)

First step is getting the correct extent of the swapchain.

Is confusing.

docs.vulkan.org/VkSwapchainCreateInfoKHR says:

imageExtent [...] The behavior is platform-dependent if the image extent does not match the surface’s currentExtent as returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR.

However, later, in the if (updateSwapchain) block, imageExtent is changed to windowSize on a window resize.

Suggestion: do one of these things:

  • delete the if (surfaceCaps.currentExtent.width == 0xFFFFFFFF) block and set the value of swapchainExtent to the value of windowSize (both in the tutorial text and in the source code); remove the entire paragraph that starts with the sentence "First step is getting the correct extent of the swapchain."
  • improve the explanation in "Swapchain" and/or "Recreate swapchain" with more detail on the reason for apparent inconsistency in (not) comparing currentExtent as returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR with the window size as returned by SDL_GetWindowSize.
  • if the current "Recreate swapchain" implementation is incorrect, and it should indeed use the extent values from vkGetPhysicalDeviceSurfaceCapabilitiesKHR when possible, modify the "Recreate swapchain" implementation to do so (both in the tutorial text and in the source code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions