summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-04-12 22:39:57 -0300
committerGravatar ReinUsesLisp2020-04-12 22:39:59 -0300
commit05cf27083608bebd3ee4c38f2f948c8f2030f881 (patch)
treea3ce029d177cc1789ec17ecaf26e7baa0f4d53af /src
parentgl_shader_decompiler: Improve generated code in HMergeH* (diff)
downloadyuzu-05cf27083608bebd3ee4c38f2f948c8f2030f881.tar.gz
yuzu-05cf27083608bebd3ee4c38f2f948c8f2030f881.tar.xz
yuzu-05cf27083608bebd3ee4c38f2f948c8f2030f881.zip
gl_shader_decompiler: Implement merges with bitfieldInsert
This also fixes Turing issues but it avoids doing more bitcasts. This should improve the generated code while also avoiding more points where compilers can flush floats.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 59bbd1211..1f1f01313 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1821,15 +1821,13 @@ private:
1821 Expression HMergeH0(Operation operation) { 1821 Expression HMergeH0(Operation operation) {
1822 const std::string dest = VisitOperand(operation, 0).AsUint(); 1822 const std::string dest = VisitOperand(operation, 0).AsUint();
1823 const std::string src = VisitOperand(operation, 1).AsUint(); 1823 const std::string src = VisitOperand(operation, 1).AsUint();
1824 return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", src, dest), 1824 return {fmt::format("bitfieldInsert({}, {}, 0, 16)", dest, src), Type::Uint};
1825 Type::HalfFloat};
1826 } 1825 }
1827 1826
1828 Expression HMergeH1(Operation operation) { 1827 Expression HMergeH1(Operation operation) {
1829 const std::string dest = VisitOperand(operation, 0).AsUint(); 1828 const std::string dest = VisitOperand(operation, 0).AsUint();
1830 const std::string src = VisitOperand(operation, 1).AsUint(); 1829 const std::string src = VisitOperand(operation, 1).AsUint();
1831 return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", dest, src), 1830 return {fmt::format("bitfieldInsert({}, {}, 16, 16)", dest, src), Type::Uint};
1832 Type::HalfFloat};
1833 } 1831 }
1834 1832
1835 Expression HPack2(Operation operation) { 1833 Expression HPack2(Operation operation) {