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

TexCache: Optimize DXT3/DXT5 decode to single pass #11350

Merged
merged 3 commits into from
Sep 2, 2018

Conversation

unknownbrackets
Copy link
Collaborator

I expect this to fix #10795, although I haven't tested that particular game.

Basically, because we previously decoded DXT1 first, then read that back and applied alpha data to it. On Vulkan we should only write to memory, and the read was killing performance.

This refactors and writes out colors with alpha data just once. To test, I made it rebuild the texture each frame, and decode 10 times in a loop - this made that take 1% as long.

Most games don't use DXT, but those that do should get better load times.

-[Unknown]

This is significantly faster on Vulkan, and in other situations where
we're decoding directly to uncached memory.
A little faster.  Also refactor colors a bit to be more readable.
@unknownbrackets unknownbrackets added this to the v1.7.0 milestone Sep 2, 2018
This makes the overall DXT5 decode about 8% faster.
@marosis
Copy link

marosis commented Sep 2, 2018

Cool!! Iam So happy when i see fixed issues. You write here how DXT1? Killing performance? So this can improve it in this game?

@unknownbrackets
Copy link
Collaborator Author

This won't help OpenGL much - maybe just a tiny bit. It mostly helps Vulkan. Most games do not use DXT3/DXT5, so most games will not change at all because of this pull.

But that particular game should get a lot faster in Vulkan, yes.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 2, 2018

Wow, good catch! Just goes to show how important it is to never read from our pushbuffers....

@hrydgard hrydgard merged commit e4562cc into hrydgard:master Sep 2, 2018
@unknownbrackets unknownbrackets deleted the texture-dxt branch September 2, 2018 21:38
@marosis
Copy link

marosis commented Sep 4, 2018

Not helped! Same status!!!

@marosis
Copy link

marosis commented Sep 4, 2018

OpenGL

@hrydgard
Copy link
Owner

hrydgard commented Sep 4, 2018

This should definitely have fixed the Vulkan perf issue, but if you had a crash in GL, I guess that might remain @marosis . I'll reopen the issue #10795 .

@marosis
Copy link

marosis commented Feb 28, 2019

Yeah it fixed Vulkan but not OGL

@hrydgard
Copy link
Owner

You mean OGL still crashes, or OGL is still slow?

@marosis
Copy link

marosis commented Feb 28, 2019

I have tested on Xiaomi redmi note 5. OPENGL no crashes. Vulkan No crashes.
Lenovo K10a40 OpenGL crashing. Vulkan not supported(THIS WHAT IM WRITING IS FOR MOH HEROES 2)

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.

Medal of honor Heroes 2 crashing after mission
3 participants