Skip to content

reject metal surface creation when extension not enabled#1962

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:metal-surface-ext-guard
Jul 7, 2026
Merged

reject metal surface creation when extension not enabled#1962
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:metal-surface-ext-guard

Conversation

@aizu-m

@aizu-m aizu-m commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
loader_wsi_tests.cpp: Failure
Expected equality of these values:
  VK_ERROR_EXTENSION_NOT_PRESENT
  vkCreateMetalSurfaceEXT(inst, &surf_create_info, nullptr, &surface)
    Which is: VK_SUCCESS

Went through each surface terminator's disabled-extension branch. terminator_CreateMetalSurfaceEXT logs the "extension not enabled" warning and then keeps going: it allocates the VkIcdSurface, copies the create_info and returns the handle with VK_SUCCESS. The other Create*Surface terminators refuse that branch, most returning VK_ERROR_EXTENSION_NOT_PRESENT. Metal is the only one that hands back a live surface for an extension the caller never enabled.

The vkGetInstanceProcAddr gate hides this on the usual resolution path, but the exported vkCreateMetalSurfaceEXT trampoline reaches the terminator directly, as does a layer calling down the chain. Fix sets the error and jumps to the shared cleanup so the behaviour matches the siblings. Added a regression test that drives the exported entrypoint on an instance that only enabled VK_KHR_surface.

@ci-tester-lunarg

Copy link
Copy Markdown

Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 29796.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3618 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3618 passed.

@charles-lunarg charles-lunarg merged commit 80ac6e1 into KhronosGroup:main Jul 7, 2026
51 checks passed
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.

3 participants