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

shader_recompiler: Add swizzle support for unsupported formats. #1869

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

squidbus
Copy link
Contributor

Adds in implicit format and swizzle remapping in sharps for formats that are not commonly supported by graphics APIs but can be trivially supported by swapping components. This was the simplest way I arrived at to accomplish this for both non-storage image views and storage swizzles done within the shader, without introducing additional Vulkan-specific code inside the general AMDGPU resource and shader code. I've also left the door open here to remapping number formats, which can then be reinterpreted to the correct format in the shader.

For now this just remaps Format11_11_10 to Format10_11_11 since the former is not supported by Vulkan.

Needs testing with a game that uses this format.

@squidbus squidbus marked this pull request as draft December 25, 2024 10:39
@squidbus
Copy link
Contributor Author

Draft until render targets also supported.

@squidbus
Copy link
Contributor Author

Added in render target swizzles, still needs testing.

@squidbus squidbus marked this pull request as ready for review December 25, 2024 15:21
@chronicer
Copy link

chronicer commented Dec 25, 2024

In DW 8 XLCE [CUSA00365]

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xe88da41da59d9ad3
[Debug] liverpool.h:unhandled_exception:1449: Unreachable code!
Unhandled exception: invalid unordered_map<K, T> key

when game tries to render models and many messages like shaderBinarySize -1 is not equal

[Lib.SysModule] sysmodule.cpp:sceSysmoduleUnloadModule:86: (STUBBED) called
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0xfaf125f72d552e45 (permutation)
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:478: Compiling fs shader 0x3cabf0647f14b1ed (permutation)
[Render.Vulkan] sampler.cpp:Sampler:12: Texture requires gamma correction
[Tty] logger.cpp:log_flush:60: [stdout] Error: shaderBinarySize -1 is not equal to Program size 860
[Tty] logger.cpp:log_flush:60: [stdout] Error: shaderBinarySize -1 is not equal to Program size 560
[Tty] logger.cpp:log_flush:60: [stdout] Error: shaderBinarySize -1 is not equal to Program size 3208

But this has been also in previous builds, maybe you know anything about this?

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