From 6e578c4fdedbd392aea43b9d7d26b435162d433c Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 26 Jun 2017 16:41:14 +0300 Subject: [PATCH] rsx: Initialize declared but unset varying variables to all ones --- rpcs3/Emu/RSX/GL/GLVertexProgram.cpp | 6 ++++++ rpcs3/Emu/RSX/VK/VKVertexProgram.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index 49b83eb0d2..6874b9ef00 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -385,6 +385,12 @@ void GLVertexDecompilerThread::insertMainEnd(std::stringstream & OS) OS << " " << name << " = " << condition << "? " << i.src_reg << i.src_reg_mask << ": " << i.default_val << ";" << std::endl; } } + else if (i.need_declare && (rsx_vertex_program.output_mask & i.check_mask_value) > 0) + { + //An output was declared but nothing was written to it + //Set it to all ones (Atelier Escha) + OS << " " << i.name << " = vec4(1.);" << std::endl; + } } if (insert_back_diffuse && insert_front_diffuse) diff --git a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp index cecc019a22..47c5c250aa 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp @@ -349,6 +349,12 @@ void VKVertexDecompilerThread::insertMainEnd(std::stringstream & OS) OS << " " << i.name << " = " << condition << "? " << i.src_reg << i.src_reg_mask << ": " << i.default_val << ";" << std::endl; } } + else if (i.need_declare && (rsx_vertex_program.output_mask & i.check_mask_value) > 0) + { + //An output was declared but nothing was written to it + //Set it to all ones (Atelier Escha) + OS << " " << i.name << " = vec4(1.);" << std::endl; + } } if (insert_back_diffuse && insert_front_diffuse)