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

Vulkan: Match Vulkan Device Version and Shaders Targets #1496

Closed
wants to merge 1 commit into from

Conversation

Xphalnos
Copy link
Contributor

@Xphalnos Xphalnos commented Feb 13, 2025

Instead of using Vulkan 1.1 and Spir-V 1.3 targets by default, It detect the Vulkan Version of the device and and matches them to the glslang targets.
To see which Spir-V version matches with which Vulkan version, I've used glslang --help command.

glslang

PS: Vulkan 1.4 devices uses Vulkan 1.3 and Spir-V 1.6 targets.

Tested on: Zelda Breath of the Wild, Mario Kart 8, Splatoon, Zelda Wind Waker HD, Zelda Twilight Princess HD, Super Mario 3D World and Wii U Menu
Tested with a Vulkan 1.4 device and no issues are visible.
Ready for modifications!

@amayra

This comment was marked as off-topic.

@Exzap
Copy link
Member

Exzap commented Feb 14, 2025

SPIR-V binaries get cached so its possible for someone to copy over the cache to a machine which has a lower Vulkan version, which then wouldn't be able to compile the shaders. So adjustments would have to be made to how caching works. I am also not super happy with how verbose the code is and I think a lookup table would be more compact. If there ever is a Vulkan 2.x version then this code would stop calling Shader.setEnvClient/Shader.setEnvTarget at all.

Newer SPIR-V features are mostly irrelevant to us and I prefer the simplicity of the original code. If there is an actual improvement to FPS then feel free to reopen.

@Exzap Exzap closed this Feb 14, 2025
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