[PR #2858] [MERGED] shader_recompiler: Add lowering pass for when 64-bit float is unsupported. #3032

Closed
opened 2026-02-27 22:02:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2858
Author: @squidbus
Created: 4/28/2025
Status: Merged
Merged: 4/28/2025
Merged by: @squidbus

Base: mainHead: fp64-lower


📝 Commits (3)

  • 127c442 shader_recompiler: Add lowering pass for when 64-bit float is unsupported.
  • e1ff2dc shader_recompiler: Fix PackDouble2x32/UnpackDouble2x32 type.
  • a4fb36d shader_recompiler: Remove extra bit cast implementations.

📊 Changes

14 files changed (+220 additions, -33 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp (+5 -9)
📝 src/shader_recompiler/backend/spirv/emit_spirv_instructions.h (+2 -3)
📝 src/shader_recompiler/frontend/translate/translate.cpp (+3 -4)
📝 src/shader_recompiler/ir/ir_emitter.cpp (+6 -12)
📝 src/shader_recompiler/ir/ir_emitter.h (+2 -1)
📝 src/shader_recompiler/ir/opcodes.inc (+2 -3)
📝 src/shader_recompiler/ir/passes/ir_passes.h (+1 -0)
src/shader_recompiler/ir/passes/lower_fp64_to_fp32.cpp (+186 -0)
📝 src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp (+2 -1)
📝 src/shader_recompiler/profile.h (+1 -0)
📝 src/shader_recompiler/recompiler.cpp (+3 -0)
📝 src/video_core/renderer_vulkan/vk_instance.h (+5 -0)
📝 src/video_core/renderer_vulkan/vk_pipeline_cache.cpp (+1 -0)

📄 Description

Adds a shader pass to lower 64-bit operations to 32-bit when 64-bit floats are unsupported. This will help with GPUs/drivers that do not support 64-bit floats like MoltenVK, where before shaders that use them would fail to compile.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2858 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 4/28/2025 **Status:** ✅ Merged **Merged:** 4/28/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `fp64-lower` --- ### 📝 Commits (3) - [`127c442`](https://github.com/shadps4-emu/shadPS4/commit/127c442bbc5b9fdb67305ce053a5d6b7d4f60c07) shader_recompiler: Add lowering pass for when 64-bit float is unsupported. - [`e1ff2dc`](https://github.com/shadps4-emu/shadPS4/commit/e1ff2dc231f929a5f2a5b0c13e387d5f9ed53aab) shader_recompiler: Fix PackDouble2x32/UnpackDouble2x32 type. - [`a4fb36d`](https://github.com/shadps4-emu/shadPS4/commit/a4fb36d36f5dc83fbadb552b3c61e99113ba1d87) shader_recompiler: Remove extra bit cast implementations. ### 📊 Changes **14 files changed** (+220 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp` (+5 -9) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_instructions.h` (+2 -3) 📝 `src/shader_recompiler/frontend/translate/translate.cpp` (+3 -4) 📝 `src/shader_recompiler/ir/ir_emitter.cpp` (+6 -12) 📝 `src/shader_recompiler/ir/ir_emitter.h` (+2 -1) 📝 `src/shader_recompiler/ir/opcodes.inc` (+2 -3) 📝 `src/shader_recompiler/ir/passes/ir_passes.h` (+1 -0) ➕ `src/shader_recompiler/ir/passes/lower_fp64_to_fp32.cpp` (+186 -0) 📝 `src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp` (+2 -1) 📝 `src/shader_recompiler/profile.h` (+1 -0) 📝 `src/shader_recompiler/recompiler.cpp` (+3 -0) 📝 `src/video_core/renderer_vulkan/vk_instance.h` (+5 -0) 📝 `src/video_core/renderer_vulkan/vk_pipeline_cache.cpp` (+1 -0) </details> ### 📄 Description Adds a shader pass to lower 64-bit operations to 32-bit when 64-bit floats are unsupported. This will help with GPUs/drivers that do not support 64-bit floats like MoltenVK, where before shaders that use them would fail to compile. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3032
No description provided.