diff options
| author | 2017-02-03 18:56:42 -0800 | |
|---|---|---|
| committer | 2017-02-03 18:56:42 -0800 | |
| commit | ba7cdce46d97c4b0d604928a66dc1921b051bf4f (patch) | |
| tree | c83a2ce926a542fa764d95f31d4db6debaa7660f /src | |
| parent | Merge pull request #2518 from MerryMage/coproc (diff) | |
| parent | ShaderJIT: add 16 dummy bytes at the bottom of the stack (diff) | |
| download | yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.gz yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.tar.xz yuzu-ba7cdce46d97c4b0d604928a66dc1921b051bf4f.zip | |
Merge pull request #2520 from wwylele/shader-stack-boundary
ShaderJIT: add 16 dummy bytes at the bottom of the stack
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_jit_x64_compiler.cpp | 7 |
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) { | |||
| 589 | void JitShader::Compile_NOP(Instruction instr) {} | 589 | void JitShader::Compile_NOP(Instruction instr) {} |
| 590 | 590 | ||
| 591 | void JitShader::Compile_END(Instruction instr) { | 591 | void JitShader::Compile_END(Instruction instr) { |
| 592 | ABI_PopRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8); | 592 | ABI_PopRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8, 16); |
| 593 | ret(); | 593 | ret(); |
| 594 | } | 594 | } |
| 595 | 595 | ||
| @@ -841,7 +841,10 @@ void JitShader::Compile(const std::array<u32, 1024>* program_code_, | |||
| 841 | FindReturnOffsets(); | 841 | FindReturnOffsets(); |
| 842 | 842 | ||
| 843 | // The stack pointer is 8 modulo 16 at the entry of a procedure | 843 | // The stack pointer is 8 modulo 16 at the entry of a procedure |
| 844 | ABI_PushRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8); | 844 | // We reserve 16 bytes and assign a dummy value to the first 8 bytes, to catch any potential |
| 845 | // return checks (see Compile_Return) that happen in shader main routine. | ||
| 846 | ABI_PushRegistersAndAdjustStack(*this, ABI_ALL_CALLEE_SAVED, 8, 16); | ||
| 847 | mov(qword[rsp + 8], 0xFFFFFFFFFFFFFFFFULL); | ||
| 845 | 848 | ||
| 846 | mov(SETUP, ABI_PARAM1); | 849 | mov(SETUP, ABI_PARAM1); |
| 847 | mov(STATE, ABI_PARAM2); | 850 | mov(STATE, ABI_PARAM2); |