Skip to content

Fix vkGetPhysicalDeviceSurfaceSupportKHR returning an error code#1723

Merged
charles-lunarg merged 3 commits into
KhronosGroup:mainfrom
charles-lunarg:fix_vkGetPhysicalDeviceSurfaceSupportKHR
Jun 16, 2025
Merged

Fix vkGetPhysicalDeviceSurfaceSupportKHR returning an error code#1723
charles-lunarg merged 3 commits into
KhronosGroup:mainfrom
charles-lunarg:fix_vkGetPhysicalDeviceSurfaceSupportKHR

Conversation

@charles-lunarg

Copy link
Copy Markdown
Collaborator

wsi_unwrap_icd_surface() returns VK_ERROR_EXTENSION_NOT_PRESENT when the
surface extension isn't supported by an ICD. Which is a problem for
vkGetPhysicalDeviceSurfaceSupportKHR because its suppose to set the out
parameter to false, not return an error code. The fix is to not propagate VK_ERROR_EXTENSION_NOT_PRESENT
up from vkGetPhysicalDeviceSurfaceSupportKHR, simply set pSupported to false and return VK_SUCCESS.

Also makes improvements to test_icd.cpp and adds a test for this case (only valid on linux, where multiple surface extensions are easily used at the same time).

@aqnuep Not looking for a heavy review, more making sure you agree that vkGetPhysicalDeviceSurfaceSupportKHR had a bug and this is the fix for it.

wsi_unwrap_icd_surface() returns VK_ERROR_EXTENSION_NOT_PRESENT when the
surface extension isn't supported. Which is a problem for
vkGetPhysicalDeviceSurfaceSupportKHR because its suppose to set the out
parameter to false, not return an error code.
Makes the header file not contain internal helper functions that tests shouldn't
be using. Also makes test_icd.cpp use the helper functions more often.
@charles-lunarg charles-lunarg requested a review from aqnuep June 9, 2025 17:03
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 461278.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 461308.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3070 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3070 failed.

@charles-lunarg charles-lunarg force-pushed the fix_vkGetPhysicalDeviceSurfaceSupportKHR branch from c191212 to fb13979 Compare June 13, 2025 20:03
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 464216.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3078 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3078 failed.

@aqnuep

aqnuep commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

The part about ignoring the error code makes sense to me.

While the spec is quite unclear about what should happen in this case and physical device queries usually aren't supposed to "behave well" with functionality that depends on an extension that is not supported by the target ICD, considering that the surface extensions are instance extensions, I believe that this is the responsibility of the loader to deal with, because the application has no knowledge about which ICDs support the instance extension, so this fix looks good.

@charles-lunarg charles-lunarg force-pushed the fix_vkGetPhysicalDeviceSurfaceSupportKHR branch from fb13979 to 996546b Compare June 16, 2025 15:02
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 465873.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 465890.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3080 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3080 passed.

@charles-lunarg charles-lunarg merged commit 287c064 into KhronosGroup:main Jun 16, 2025
44 checks passed
@charles-lunarg charles-lunarg deleted the fix_vkGetPhysicalDeviceSurfaceSupportKHR branch June 16, 2025 15:43
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.

vkGetPhysicalDeviceSurfaceSupportKHR returns VK_ERROR_EXTENSION_NOT_PRESENT instead of false

3 participants