feat(vulkan): qualify surface adapters with present queues#267
Open
besmpl wants to merge 4 commits into
Open
Conversation
Contributor
Author
|
Stacked consumer preview: #268 at exact head The preview remains explicitly draft/non-mergeable and will be rebased to Android-only commits after this prerequisite lands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Qualify Vulkan adapters against the requested surface before opening a device:
vkGetPhysicalDeviceSurfaceSupportKHRresultsOpenThis follows the Rust wgpu shape: adapter selection for a compatible surface proves the presentation queue that device creation will actually use.
Why
The previous path could enumerate an adapter without proving surface support, then open queue family zero (or another graphics-only family). Capability-query failures could also collapse into an apparently usable adapter.
Request-local wrappers must have request-local lifetime as well; otherwise repeated surface replacement, multi-GPU selection, and failed fallback selection retain qualified adapter and surface state until the whole instance is destroyed. Serializing the snapshot with deferred GLES enumeration also prevents concurrent requests from misclassifying another request's surface-bound adapter as their own.
Validation
Go 1.25.12 and Go 1.26.5:
go test ./core ./hal/vulkan .go test -race ./core ./hal/vulkan .go vet ./core ./hal/vulkan .upstream/mainFailure-injection tests cover split queues, failed Vulkan queries, request-local ownership and cleanup, selection errors, repeated requests, and cached-adapter immutability.
Split graphics/present queues remain deliberately unsupported in this first correction.
Android preview relationship
This Android-independent prerequisite is stacked into draft #268 at exact head
a3e839f94a12edce98e2496d96e5bd8d3cdd2fc3. The draft will rebase it out after merge; Android runtime claims remain gated in that PR.