소스 검색

shader_decompiler: Visit source nodes even when they assign to RZ

Some operations like atomicMin were ignored because they returned were
being stored to RZ. This operations have a side effect and it was being
ignored.
ReinUsesLisp 6 년 전
부모
커밋
ed4e324991
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 1
      src/video_core/renderer_opengl/gl_shader_decompiler.cpp
  2. 3 1
      src/video_core/renderer_vulkan/vk_shader_decompiler.cpp

+ 3 - 1
src/video_core/renderer_opengl/gl_shader_decompiler.cpp

@@ -1538,7 +1538,9 @@ private:
         Expression target;
         if (const auto gpr = std::get_if<GprNode>(&*dest)) {
             if (gpr->GetIndex() == Register::ZeroIndex) {
-                // Writing to Register::ZeroIndex is a no op
+                // Writing to Register::ZeroIndex is a no op but we still have to visit the source
+                // as it might have side effects.
+                code.AddLine("{};", Visit(src).GetCode());
                 return {};
             }
             target = {GetRegister(gpr->GetIndex()), Type::Float};

+ 3 - 1
src/video_core/renderer_vulkan/vk_shader_decompiler.cpp

@@ -1361,7 +1361,9 @@ private:
         Expression target{};
         if (const auto gpr = std::get_if<GprNode>(&*dest)) {
             if (gpr->GetIndex() == Register::ZeroIndex) {
-                // Writing to Register::ZeroIndex is a no op
+                // Writing to Register::ZeroIndex is a no op but we still have to visit its source
+                // because it might have side effects.
+                Visit(src);
                 return {};
             }
             target = {registers.at(gpr->GetIndex()), Type::Float};