Repository navigation
fix(agc): let a native multisample depth clear supersede one no use retired yet - #124
Merged
Merged
Conversation
…etired yet A second whole-HTILE clear (an HTILE clear dispatch or a metadata fill) of a native multisample depth target before any draw or sampling retired the first was refused as "overlapping native multisample depth clear transitions are not implemented", which killed Plants vs. Zombies: Replanted about two minutes in (issue #123). Both clears cover the whole HTILE and run in command order, and every use of the surface retires its clear first (settlePendingHtileClear, then CheckCurrent), so nothing saw the earlier clear: the later one supersedes it, as on the GPU. The transition now starts over with the newer clear, which needs the same proof at its use as a first clear. - clearPending counts the noted dispatches not yet recorded, so two noted before either is armed both arm, and the clear generation is the newest recorded one. - clearCompletions counts the recorded dispatches whose completion has not run, so a use waits for every one still in flight, not only for the first to finish. - A fill over an unretired fill only counts a store made after the earlier fill was noted, and does not take the earlier fill's queued write (or one of another word) as its own. A fill over a pending dispatch and overlapping stencil plane fills stay refused. Tests (agc_driver_native_depth_clears): a dispatch over a recorded dispatch, two dispatches noted before either is recorded, a dispatch recorded while the first is in flight and completes first, a dispatch over a fill, and a fill (CPU-stored and queued on the GPU) over a fill of the other value. agc_driver_native_depth_stencil: a fill of the other value, then the real fill noted twice. Each used to be refused.
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.
Plants vs. Zombies: Replanted (PPSA29802) stopped about two minutes in with
AGC graphics: overlapping native multisample depth clear transitions are not implemented(issue #123).Cause
NoteHtileDepthClearandNoteDepthMetadataFillinGraphics/src/DepthSurface.cpprefused a second whole-HTILE clear of a native multisample depth target while the first was still pending (noted, recorded or filled, but not yet retired by a draw or a sampling).What changes
Both clears cover the whole HTILE and run in command order, and every use of the surface retires its clear first (
settlePendingHtileClear, thenCheckCurrent). So nothing saw the earlier clear, and the later one supersedes it, as on the GPU. The transition starts over with the newer clear, which needs the same proof at its use as a first clear.clearPendingcounts the noted dispatches not yet recorded, so two noted before either is armed both arm, and the clear generation is the newest recorded one.clearCompletionsreplacesclearCompletionQueuedand counts the recorded dispatches whose completion has not run. A use waits for every dispatch still in flight, not only for the first to finish.A fill over a pending dispatch and overlapping stencil plane fills stay refused, as before.
Tests
agc_driver_native_depth_clears: a dispatch over a recorded dispatch, two dispatches noted before either is recorded, a dispatch recorded while the first is in flight and completes first, a dispatch over a fill, and a fill (stored by the CPU and queued on the GPU) over a fill of the other value. Clear values 0 and 1, three clears each.agc_driver_native_depth_stencil: a fill of the other value, then the real fill noted twice.agc_driver_native_depth_clear_refusalsand the stencil refusals no longer list the overlap, which is now accepted.Each of these sequences was refused before this change. The engine is shared by the macOS, Windows and Linux builds, and the change uses no platform API. The Vulkan cases run on the Linux lavapipe job.