fix(device): drain GPU work before teardown#264
Open
besmpl wants to merge 1 commit into
Open
Conversation
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
Device.Releasewait for the HAL device to become idle before releasing pending writes, flushing deferred destruction, destroying pooled encoders, and finally destroying the core/HAL device.The public
WaitIdlemethod still rejects calls after release. Teardown uses a privatewaitIdlepath becauseReleasemarks the device unavailable first, preventing concurrent new work while the final submission is drained.Why
The previous order set the released bit and then called the public
WaitIdle, which immediately returnedErrReleased. Deferred encoder-recycling callbacks could therefore remain queued while HAL destruction reclaimed the same command pools.Validation
go test ./...go test -race .WaitIdlehappens before HALDestroyThis is intentionally separate from the Android work; it fixes native teardown ordering on every backend.
Android preview relationship
This Android-independent prerequisite is stacked into draft #268 at exact head
0ed17064f8c977f35d9b49b5cde0d0c69e867ecf. The draft will rebase it out after merge; Android runtime claims remain gated in that PR.