mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #1869] [MERGED] shader_recompiler: Add swizzle support for unsupported formats. #2358
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2358
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/1869
Author: @squidbus
Created: 12/25/2024
Status: ✅ Merged
Merged: 12/31/2024
Merged by: @georgemoralis
Base:
main← Head:swizzle-fmt📝 Commits (8)
8a006a2shader_recompiler: Add swizzle support for unsupported formats.4e6a7e5renderer_vulkan: Rework MRT swizzles and add unsupported format swizzle support.070c4afshader_recompiler: Clean up swizzle handling and handle ImageRead storage swizzle.0fe50e2shader_recompiler: Fix type errors4d81b41liverpool_to_vk: Remove redundant clear color swizzles.11eb741shader_recompiler: Reduce CompositeConstruct to constants where possible.4702b53shader_recompiler: Fix ImageRead/Write and StoreBufferFormatF32 types.03e8e99amdgpu: Add a few more unsupported format remaps.📊 Changes
22 files changed (+522 additions, -282 deletions)
View changed files
📝
CMakeLists.txt(+1 -0)📝
src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp(+80 -18)📝
src/shader_recompiler/backend/spirv/emit_spirv_image.cpp(+3 -3)📝
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h(+29 -9)📝
src/shader_recompiler/frontend/translate/export.cpp(+13 -19)📝
src/shader_recompiler/frontend/translate/translate.cpp(+6 -19)📝
src/shader_recompiler/frontend/translate/vector_memory.cpp(+2 -2)📝
src/shader_recompiler/ir/ir_emitter.cpp(+80 -0)📝
src/shader_recompiler/ir/ir_emitter.h(+7 -0)📝
src/shader_recompiler/ir/opcodes.inc(+15 -3)📝
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp(+58 -42)➕
src/shader_recompiler/ir/reinterpret.h(+24 -0)📝
src/shader_recompiler/runtime_info.h(+1 -1)📝
src/shader_recompiler/specialization.h(+3 -7)📝
src/video_core/amdgpu/liverpool.h(+47 -3)📝
src/video_core/amdgpu/resource.h(+104 -52)📝
src/video_core/renderer_vulkan/liverpool_to_vk.cpp(+35 -62)📝
src/video_core/renderer_vulkan/liverpool_to_vk.h(+4 -3)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.h(+1 -1)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+5 -9)...and 2 more files
📄 Description
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_10toFormat10_11_11since the former is not supported by Vulkan.Needs testing with a game that uses this format.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.