From 445d78452f64f652fb87ef5a3ab68380e1d2699e Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sun, 25 Oct 2020 19:50:24 +0300 Subject: [PATCH] [DXBC] Pop aL on loop end --- src/xenia/gpu/dxbc_shader_translator.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/dxbc_shader_translator.cc b/src/xenia/gpu/dxbc_shader_translator.cc index 5aa63020b..3f9140158 100644 --- a/src/xenia/gpu/dxbc_shader_translator.cc +++ b/src/xenia/gpu/dxbc_shader_translator.cc @@ -1862,10 +1862,14 @@ void DxbcShaderTranslator::ProcessLoopEndInstruction( } { // Break case. - // Pop the current loop off the stack, move YZW to XYZ and set W to 0. + // Pop the current loop off the loop counter and the relative address + // stacks - move YZW to XYZ and set W to 0. DxbcOpMov(DxbcDest::R(system_temp_loop_count_, 0b0111), DxbcSrc::R(system_temp_loop_count_, 0b111001)); DxbcOpMov(DxbcDest::R(system_temp_loop_count_, 0b1000), DxbcSrc::LU(0)); + DxbcOpMov(DxbcDest::R(system_temp_aL_, 0b0111), + DxbcSrc::R(system_temp_aL_, 0b111001)); + DxbcOpMov(DxbcDest::R(system_temp_aL_, 0b1000), DxbcSrc::LI(0)); // Now going to fall through to the next exec (no need to jump). } DxbcOpElse();