فهرست منبع

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.
ReinUsesLisp 6 سال پیش
والد
کامیت
05cf270836
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      src/video_core/renderer_opengl/gl_shader_decompiler.cpp

+ 2 - 4
src/video_core/renderer_opengl/gl_shader_decompiler.cpp

@@ -1821,15 +1821,13 @@ private:
     Expression HMergeH0(Operation operation) {
         const std::string dest = VisitOperand(operation, 0).AsUint();
         const std::string src = VisitOperand(operation, 1).AsUint();
-        return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", src, dest),
-                Type::HalfFloat};
+        return {fmt::format("bitfieldInsert({}, {}, 0, 16)", dest, src), Type::Uint};
     }
 
     Expression HMergeH1(Operation operation) {
         const std::string dest = VisitOperand(operation, 0).AsUint();
         const std::string src = VisitOperand(operation, 1).AsUint();
-        return {fmt::format("vec2(unpackHalf2x16({}).x, unpackHalf2x16({}).y)", dest, src),
-                Type::HalfFloat};
+        return {fmt::format("bitfieldInsert({}, {}, 16, 16)", dest, src), Type::Uint};
     }
 
     Expression HPack2(Operation operation) {