mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #2739] [MERGED] shader_recompiler: Use VK_AMD_shader_trinary_minmax when available. #2945
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#2945
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/2739
Author: @squidbus
Created: 4/1/2025
Status: ✅ Merged
Merged: 4/2/2025
Merged by: @raphaelthegreat
Base:
main← Head:trinary📝 Commits (2)
8e56bbashader_recompiler: Use VK_AMD_shader_trinary_minmax when available.81b290ashader_recompiler: Simplify signed/unsigned trinary instruction variants.📊 Changes
13 files changed (+168 additions, -34 deletions)
View changed files
📝
externals/sirit(+1 -1)📝
src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp(+22 -0)📝
src/shader_recompiler/backend/spirv/emit_spirv_instructions.h(+9 -0)📝
src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp(+44 -0)📝
src/shader_recompiler/frontend/translate/translate.h(+2 -4)📝
src/shader_recompiler/frontend/translate/vector_alu.cpp(+12 -29)📝
src/shader_recompiler/ir/ir_emitter.cpp(+48 -0)📝
src/shader_recompiler/ir/ir_emitter.h(+12 -0)📝
src/shader_recompiler/ir/opcodes.inc(+9 -0)📝
src/shader_recompiler/profile.h(+1 -0)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+1 -0)📝
src/video_core/renderer_vulkan/vk_instance.h(+6 -0)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+1 -0)📄 Description
Implements use of
VK_AMD_shader_trinary_minmaxinstructions for trinary min/max/median when available. Specifically this PR introduces separate IR instructions for these trinary operations, then determines whether to emit a trinary instruction or a compatibility fill based on what is available. This should reduce the number of instructions needed and possibly improve performance on supported drivers.Note that these new IR instructions are named with the
Trisuffix for trinary to avoid awkward naming with numbers likeFPMin332when the bit suffix is added.Tested this with a few games on MoltenVK, which supports this extension.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.