fix(vulkan): fail closed on swapchain capability and sync errors#265
Open
besmpl wants to merge 2 commits into
Open
fix(vulkan): fail closed on swapchain capability and sync errors#265besmpl wants to merge 2 commits into
besmpl wants to merge 2 commits into
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
Make Vulkan swapchain negotiation, reconfiguration, synchronization, and teardown fail closed:
Destroy()APIThe implementation mirrors the defensive lifecycle used by Rust wgpu-hal while keeping the existing Go HAL surface.
Why
The old path accepted partial/fabricated capability state, assumed requested image counts, and could continue after synchronization or layout failures. A failed reconfigure could also tear down the working swapchain before the replacement was usable.
Validation
Go 1.25.12 and Go 1.26.5:
go test ./hal/vulkan .go test -race ./hal/vulkan .go vet ./hal/vulkan .upstream/mainFailure-injection tests cover unstable counts, unsupported requests, actual image counts, lifecycle guards, broken-state rejection, transactional reconfigure, and idempotent destruction.
This correction is platform-independent and intentionally separate from the Android preview.
Android preview relationship
This Android-independent prerequisite is stacked into draft #268 at exact head
a8ff52e340f0a06c8e1b6599a03856d7fc74d1a2. The draft will rebase it out after merge; Android runtime claims remain gated in that PR.