summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-05-26 03:31:33 +0200
committerGitHub <noreply@github.com>2020-05-26 03:31:33 +0200
commit86345c126acc80a6019abb9be77359f7e6bb0f27 (patch)
tree5e983c6c1ac295bfcce992efbe623bfc0e25a329
parentMerge pull request #3905 from FernandoS27/vulkan-fix (diff)
parentshader_decompiler: Visit source nodes even when they assign to RZ (diff)
downloadyuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar.gz
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar.bz2
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar.lz
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar.xz
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.tar.zst
yuzu-86345c126acc80a6019abb9be77359f7e6bb0f27.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp7
2 files changed, 7 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 c83a08d42..84ca830f4 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/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};
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index f4ccc9848..b8169d832 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -1081,8 +1081,7 @@ private:
void VisitBasicBlock(const NodeBlock& bb) {
for (const auto& node : bb) {
- [[maybe_unused]] const Type type = Visit(node).type;
- ASSERT(type == Type::Void);
+ Visit(node);
}
}
@@ -1372,7 +1371,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};