[PICA] Get vertex attributes being semi-properly read

This commit is contained in:
wheremyfoodat
2022-09-22 16:48:43 +03:00
parent 1bbd377ee7
commit 434c840aeb
6 changed files with 135 additions and 14 deletions

View File

@@ -40,7 +40,11 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
// We currently use the unmasked value like Citra does
switch (index) {
case SignalDrawArrays:
if (value != 0) drawArrays();
if (value != 0) drawArrays(false);
break;
case SignalDrawElements:
if (value != 0) drawArrays(true);
break;
case VertexShaderTransferEnd:
@@ -57,7 +61,22 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
break;
default:
printf("GPU: Wrote to unimplemented internal reg: %X, value: %08X\n", index, newValue);
// Vertex attribute registers
if (index >= AttribInfoStart && index <= AttribInfoEnd) {
uint attributeIndex = (index - AttribInfoStart) / 3; // Which attribute are we writing to
uint reg = (index - AttribInfoStart) % 3; // Which of this attribute's registers are we writing to?
auto& attr = attributeInfo[attributeIndex];
switch (reg) {
case 0: attr.offset = value & 0xfffffff; break; // Attribute offset
case 1: break; // We don't handle this yet
case 2: // We don't handle most of this yet
attr.size = (value >> 16) & 0xff;
break;
}
} else {
printf("GPU: Wrote to unimplemented internal reg: %X, value: %08X\n", index, newValue);
}
break;
}
}