Skip to content

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

Merged
hrydgard merged 3 commits into
hrydgard:masterfrom
unknownbrackets:texture-dxt
Sep 2, 2018
Merged

hrydgard merged 3 commits into
hrydgard:masterfrom
unknownbrackets:texture-dxt

Conversation

@unknownbrackets

Copy link
Copy Markdown
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

marosis commented Sep 2, 2018

Copy link
Copy Markdown

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
Copy Markdown
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

hrydgard commented Sep 2, 2018

Copy link
Copy Markdown
Owner

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

marosis commented Sep 4, 2018

Copy link
Copy Markdown

Not helped! Same status!!!

@marosis

marosis commented Sep 4, 2018

Copy link
Copy Markdown

OpenGL

@hrydgard

hrydgard commented Sep 4, 2018

Copy link
Copy Markdown
Owner

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

marosis commented Feb 28, 2019

Copy link
Copy Markdown

Yeah it fixed Vulkan but not OGL

@hrydgard

Copy link
Copy Markdown
Owner

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

@marosis

marosis commented Feb 28, 2019 •

Copy link
Copy Markdown

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