GPU: D3D12: remove NewFrame() API, and introduce a timeout to Collect()#1316
Draft
slomp wants to merge 15 commits intowolfpld:masterfrom
Draft
GPU: D3D12: remove NewFrame() API, and introduce a timeout to Collect()#1316slomp wants to merge 15 commits intowolfpld:masterfrom
slomp wants to merge 15 commits intowolfpld:masterfrom
Conversation
0cb1d81 to
0e62844
Compare
…t makeshift timestamps for dropped timestamps
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.
This PR removes the need for calling
NewFrame()periodically.Some applications may run "headless" or may use the GPU for compute-only purposes, and do not have the concept of a frame boundary. Timestamp queries are now produced and collected in a circular buffer.
In addition,
Collect()now operates on a fixed range of queries (4K window) and applies a timeout to the collect window to mitigate ambiguous timestamp resolves and race conditions with the GPU command processor writing to the timestamp heap.The follow scenarios have been identified and verified:
The only scenario where ambiguity can happen is as follows:
While technically possible, it is quite a contrived case. There does not seem to be a proper solution for the case above without some amount of costly query tracking along with some CPU-GPU synchronization on top of it. The existing implementation is also prone to the same "bad-timing" problem.