diff options
| author | 2019-04-15 19:48:11 -0300 | |
|---|---|---|
| committer | 2019-04-15 21:16:10 -0300 | |
| commit | f43995ec535042d24fa1af637642a2974bfa4773 (patch) | |
| tree | 9b5526da635742d96d7e3d95d6fd2e95dd5b1399 /src/video_core/renderer_vulkan | |
| parent | gl_shader_decompiler: Fix MrgH0 decompilation (diff) | |
| download | yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.gz yuzu-f43995ec535042d24fa1af637642a2974bfa4773.tar.xz yuzu-f43995ec535042d24fa1af637642a2974bfa4773.zip | |
shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmetic
Operations done before the main half float operation (like HAdd) were
managing a packed value instead of the unpacked one. Adding an unpacked
operation allows us to drop the per-operand MetaHalfArithmetic entry,
simplifying the code overall.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 6ecb0bcb0..beff33ba1 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |||
| @@ -76,14 +76,10 @@ constexpr u32 GetGenericAttributeLocation(Attribute::Index attribute) { | |||
| 76 | 76 | ||
| 77 | /// Returns true if an object has to be treated as precise | 77 | /// Returns true if an object has to be treated as precise |
| 78 | bool IsPrecise(Operation operand) { | 78 | bool IsPrecise(Operation operand) { |
| 79 | const auto& meta = operand.GetMeta(); | 79 | const auto& meta{operand.GetMeta()}; |
| 80 | |||
| 81 | if (std::holds_alternative<MetaArithmetic>(meta)) { | 80 | if (std::holds_alternative<MetaArithmetic>(meta)) { |
| 82 | return std::get<MetaArithmetic>(meta).precise; | 81 | return std::get<MetaArithmetic>(meta).precise; |
| 83 | } | 82 | } |
| 84 | if (std::holds_alternative<MetaHalfArithmetic>(meta)) { | ||
| 85 | return std::get<MetaHalfArithmetic>(meta).precise; | ||
| 86 | } | ||
| 87 | return false; | 83 | return false; |
| 88 | } | 84 | } |
| 89 | 85 | ||
| @@ -749,6 +745,11 @@ private: | |||
| 749 | return {}; | 745 | return {}; |
| 750 | } | 746 | } |
| 751 | 747 | ||
| 748 | Id HUnpack(Operation operation) { | ||
| 749 | UNIMPLEMENTED(); | ||
| 750 | return {}; | ||
| 751 | } | ||
| 752 | |||
| 752 | Id HMergeF32(Operation operation) { | 753 | Id HMergeF32(Operation operation) { |
| 753 | UNIMPLEMENTED(); | 754 | UNIMPLEMENTED(); |
| 754 | return {}; | 755 | return {}; |
| @@ -1222,6 +1223,7 @@ private: | |||
| 1222 | &SPIRVDecompiler::Unary<&Module::OpFAbs, Type::HalfFloat>, | 1223 | &SPIRVDecompiler::Unary<&Module::OpFAbs, Type::HalfFloat>, |
| 1223 | &SPIRVDecompiler::HNegate, | 1224 | &SPIRVDecompiler::HNegate, |
| 1224 | &SPIRVDecompiler::HClamp, | 1225 | &SPIRVDecompiler::HClamp, |
| 1226 | &SPIRVDecompiler::HUnpack, | ||
| 1225 | &SPIRVDecompiler::HMergeF32, | 1227 | &SPIRVDecompiler::HMergeF32, |
| 1226 | &SPIRVDecompiler::HMergeH0, | 1228 | &SPIRVDecompiler::HMergeH0, |
| 1227 | &SPIRVDecompiler::HMergeH1, | 1229 | &SPIRVDecompiler::HMergeH1, |