summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-04 03:56:42 +0100
committerGitHub <noreply@github.com>2017-02-04 03:56:42 +0100
commitba7cdce46d97c4b0d604928a66dc1921b051bf4f (patch)
treec83a2ce926a542fa764d95f31d4db6debaa7660f /src
parentMerge pull request #2518 from MerryMage/coproc (diff)
parentShaderJIT: add 16 dummy bytes at the bottom of the stack (diff)
downloadyuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.gz
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.bz2
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.lz
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.xz
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.zst
yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader_jit_x64_compiler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/shader/shader_jit_x64_compiler.cpp b/src/video_core/shader/shader_jit_x64_compiler.cpp
index bef7904b0..92b35dbc0 100644
--- a/src/video_core/shader/shader_jit_x64_compiler.cpp
+++ b/src/video_core/shader/shader_jit_x64_compiler.cpp
@@ -589,7 +589,7 @@ void JitShader::Compile_RSQ(Instruction instr) {
void JitShader::Compile_NOP(Instruction instr) {}
void JitShader::Compile_END(Instruction instr) {
- ABI_PopRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8);
+ ABI_PopRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8, 16);
ret();
}
@@ -841,7 +841,10 @@ void JitShader::Compile(const std::array<u32, 1024>* program_code_,
FindReturnOffsets();
// The stack pointer is 8 modulo 16 at the entry of a procedure
- ABI_PushRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8);
+ // We reserve 16 bytes and assign a dummy value to the first 8 bytes, to catch any potential
+ // return checks (see Compile_Return) that happen in shader main routine.
+ ABI_PushRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8, 16);
+ mov(qword[rsp + 8], 0xFFFFFFFFFFFFFFFFULL);
mov(SETUP, ABI_PARAM1);
mov(STATE, ABI_PARAM2);