[PICA] Fix more shader bugs

This commit is contained in:
wheremyfoodat 2022-09-27 02:27:41 +03:00
parent f90dd2d60b
commit 4d1bb6f866
4 changed files with 10 additions and 4 deletions

View file

@ -113,6 +113,10 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
shaderUnit.vs.uploadWord(value);
break;
case VertexShaderEntrypoint:
shaderUnit.vs.entrypoint = value & 0xffff;
break;
case VertexShaderTransferEnd:
if (value != 0) shaderUnit.vs.finalize();
break;

View file

@ -2,7 +2,7 @@
#include <cmath>
void PICAShader::run() {
pc = 0;
pc = entrypoint;
loopIndex = 0;
ifIndex = 0;
callIndex = 0;
@ -63,7 +63,7 @@ void PICAShader::run() {
// Handle calls
if (callIndex != 0) {
auto& info = callInfo[callIndex - 1];
if (pc == info.endingPC) { // Check if the IF block ended
if (pc == info.endingPC) { // Check if the CALL block ended
pc = info.returnPC;
callIndex -= 1;
}
@ -121,7 +121,7 @@ bool PICAShader::isCondTrue(u32 instruction) {
return cmpRegister[0] == refX && cmpRegister[1] == refY;
case 2: // At least cmp.x matches
return cmpRegister[0] == refX;
case 3: // At least cmp.y matches
default: // At least cmp.y matches
return cmpRegister[1] == refY;
}
}