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

KTX2: Crash in D3D11 #17745

Closed
hrydgard opened this issue Jul 20, 2023 · 1 comment · Fixed by #17749
Closed

KTX2: Crash in D3D11 #17745

hrydgard opened this issue Jul 20, 2023 · 1 comment · Fixed by #17749

Comments

@hrydgard
Copy link
Owner

Reported by VeryMelon on discord:

It work well with OpenGL & Vulkan & D3D9 but when using D3D11 is got crash.

KTX2 texture pack.
https://forums.ppsspp.org/showthread.php?tid=29011

ppsspplog.zip

Still crash in latest git build v1.15.4-571-g16ee5a50c.

@hrydgard hrydgard added this to the v1.16.0 milestone Jul 20, 2023
@hrydgard
Copy link
Owner Author

Oh, I've realized what this is. For silly reasons, D3D11 restricts block-compressed textures to have a top level mip size that's an even multiple of 4x4. It'll error out on other sizes, causing a crash since we're not handling this error since it's so unexpected. This restriction even exists in D3D12 but was lifted. OpenGL and Vulkan never had it, since it doesn't make any sense.

The only thing we can do is probably to warn about it on load (so that people adjust their texture packs to compensate), and slightly expand textures. This will sometimes lead to slight misalignments due to the texture not being the expected size.

hrydgard added a commit that referenced this issue Jul 20, 2023
…e by 4

Fixes #17745 (crash when loading certain texture packs in D3D11)

This is an old unfortunate limitation. Only applies to the top mip
level, which makes it obvious that it's kinda unnecessary for the
hardware and indeed, Vulkan and OpenGL don't have this limitation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant