Clear memory when clearing drawing #8994
Merged
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 should help synchronize block transfers better.
Should improve #8973. An alternative to my earlier version in #8987:
Timing this on my Nexus 5, the cost of a full screen clear is typically around 0.000025s to 0.000056s with the average around 0.000040s or so. In other words, 0.24% of a 60fps frame - not bad. One worst case outlier was 0.000142s, or 0.85%.
I think the performance cost is not terrible and didn't notice any major performance decrease... but it could be some game does a bunch of clears per frame, I guess.
Unfortunately, this re-breaks Katamari. It seems it redraws the darn thing a couple times, so what happens with this change is:1. It draws it the first time.2. Draw downloaded and saved to memory. Flag set.
3. It clears and draws it a second time.
4. Flag is already set, so we don't redownload, of course.
True single-frame draws will still be benefited (and I'm pretty sure some games do them), but Katamari would need some buffer to not clear in the first couple frames or something... ugh.I decided to just hack it for now. Maybe we can find a better way, but I'm not sure how to do it in a generic non-performance-killing way....
-[Unknown]