Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear memory when clearing drawing #8994

Merged
merged 3 commits into from
Sep 24, 2016
Merged

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Sep 19, 2016

This should help synchronize block transfers better.

Should improve #8973. An alternative to my earlier version in #8987:

  • Corrects 16-bit clearing (need to convert the color.)
  • Optimize common case with 64-bit faux simd.
  • Fix bug in detecting memset compatible clears.
  • Make code common to all GPU backends.

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]

This should help synchronize block transfers better.

Should improve hrydgard#8973.
It textures from it in a weird way, maybe we can find a better fix.
@hrydgard
Copy link
Owner

Nice, will review this evening. Does the "Download 154000" workaround solve Katamari? If so please update the pull request description :)

I wonder if NEON/SSE is worth it - probably not as these loops should be fairly close to max bandwidth anyway..

@unknownbrackets
Copy link
Collaborator Author

Yeah, that was my assumption too, but didn't test. Maybe NEON would have some benefit...

-[Unknown]

@daniel229
Copy link
Collaborator

still some vertical lines
01

@hrydgard hrydgard merged commit 8001f7c into hrydgard:master Sep 24, 2016
@unknownbrackets unknownbrackets deleted the gpu-clear branch September 24, 2016 17:38
hrydgard added a commit that referenced this pull request Jan 28, 2017
Should remove the performance impact of #8994 which is bigger than
expected, it seems (cache pollution?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants