mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-22 05:15:51 +12:00
[Shader interpreter] Implement CALL
This commit is contained in:
parent
c4be91588d
commit
f9079f9dce
2 changed files with 17 additions and 0 deletions
|
@ -13,6 +13,7 @@ void PICAShader::run() {
|
|||
|
||||
switch (opcode) {
|
||||
case ShaderOpcodes::ADD: add(instruction); break;
|
||||
case ShaderOpcodes::CALL: call(instruction); break;
|
||||
case ShaderOpcodes::CALLU: callu(instruction); break;
|
||||
case ShaderOpcodes::CMP1: case ShaderOpcodes::CMP2:
|
||||
cmp(instruction);
|
||||
|
@ -393,6 +394,20 @@ void PICAShader::ifu(u32 instruction) {
|
|||
}
|
||||
}
|
||||
|
||||
void PICAShader::call(u32 instruction) {
|
||||
if (callIndex >= 4) [[unlikely]]
|
||||
Helpers::panic("[PICA] Overflowed CALL stack");
|
||||
|
||||
const u32 num = instruction & 0xff;
|
||||
const u32 dest = (instruction >> 10) & 0xfff;
|
||||
|
||||
auto& block = callInfo[callIndex++];
|
||||
block.endingPC = dest + num;
|
||||
block.returnPC = pc;
|
||||
|
||||
pc = dest;
|
||||
}
|
||||
|
||||
void PICAShader::callu(u32 instruction) {
|
||||
const u32 bit = (instruction >> 22) & 0xf; // Bit of the bool uniform to check
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue