-
Notifications
You must be signed in to change notification settings - Fork 2.3k
DDS texture support in texture replacer #17083
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
Conversation
Reworked this again. Still only works in Vulkan, will add DDS support for the other ones later, possibly. Next step will be to load multiple mipmaps from the same file, which will take some refactoring. After that, will try to add support to the other backends, as much as possible. Then once raw block compressed format loading is working, will add support for additional formats like KTX, Basis, UASTC, haven't chosen yet.
|
if (actualFmt != VULKAN_8888_FORMAT) { | ||
actualFmt = actualFmt; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something must be wrong here. Should one of these sides be dstFmt
?
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh I don't know what happened here, might be some kind of copy paste mistake. I'll clean it up in some near future commit.
default: | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces lost in a bustling world of tabs.
-[Unknown]
// TODO: Add sanity checks here for other formats? | ||
// Just gonna do a memcpy, slightly scared of the parallel ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may cause some contention but it should be fine for large amounts of data. If the game is showing one large 512x512 texture as a background, and it's upscaled to 2048x2048, the parallel is likely to be worth it. At most, could adjust the heuristics on when.
It would mostly not be worth it if we had a ton of textures to load and it starved them.
-[Unknown]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, but with the compressed texture formats, the data size is drastically smaller, 0.5 or 1 byte per pixel instead of four. But yeah, I'll have another look at the heuristics and probably activate here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still very likely worth it for copying 2MB (0.5 of 2048x2048.) Ideal might be to only use a few threads for it, but especially on a device with 12+ threads, it's practically wasting them not to...
-[Unknown]
Supports the various BC formats that can be stored in a DDS file, single mipmap only for now (will be extended later).
Work-in-progress, currently only works with Vulkan.