Rework GPU Timing Stats - #988
Merged
Merged
Conversation
Logs can still be produced on shutdown (Vulkan validation layers), but modules are destroyed after the Lua state is torn down now, so logging in destructors won't work. Instead, we can set the log callback to NULL and implement fallback behavior, so at least the logs show up. There might be slightly better ways to handle this?
- Add a new async `lovr.graphics.getTiming` function that returns a
table of timestamps for the last GPU submission, keyed by pass.
- The timestamps are formatted like this:
{
[pass1] = {
duration = t,
start = t,
finish = t,
submit = t
},
[pass2] = {
duration = t,
start = t,
finish = t,
submit = t
}
}
- The start/finish times are in the same units/epoch as
`lovr.timer.getTime`, so you can correlate it with other CPU times.
- Not every GPU can correlate timestamps, so start/finish may be nil.
But nearly every desktop GPU supports it.
- Deprecate `gpuTime`/`submitTime` in `Pass:getStats`.
- Main goals are:
- Make it easier to get stats for multiple passes
- Use an async function to make it easier to correlate stats to a
particular submit instead of updating the pass stats asynchronously
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.
lovr.graphics.getTimingfunction that returns a table of timestamps for the last GPU submission, keyed by pass.{ [pass1] = { duration = t, start = t, finish = t, submit = t }, [pass2] = { duration = t, start = t, finish = t, submit = t } }lovr.timer.getTime, so you can correlate it with other CPU times.gpuTime/submitTimeinPass:getStats.Example: