Update shader JIT to work with latest oaknut

This commit is contained in:
wheremyfoodat 2024-03-07 14:28:24 +00:00 committed by GitHub
parent 5fbfea2837
commit 199241ba64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -119,7 +119,7 @@ class ShaderEmitter : private oaknut::CodeBlock, public oaknut::CodeGenerator {
// PC must be a valid entrypoint here. It doesn't have that much overhead in this case, so we use std::array<>::at() to assert it does
InstructionCallback getInstructionCallback(u32 pc) {
// Cast away the constness because casting to a function pointer is hard otherwise. Legal as long as we don't write to *ptr
uint8_t* ptr = instructionLabels.at(pc).ptr<u8*>();
uint8_t* ptr = instructionLabels.at(pc).xptr<u8*>();
return reinterpret_cast<InstructionCallback>(ptr);
}

View file

@ -39,7 +39,7 @@ void ShaderEmitter::compile(const PICAShader& shaderUnit) {
align(16);
l(prologueLabel);
prologueCb = prologueLabel.ptr<PrologueCallback>();
prologueCb = prologueLabel.xptr<PrologueCallback>();
// Set state pointer to the proper pointer
// state pointer is volatile, no need to preserve it
@ -408,7 +408,7 @@ void ShaderEmitter::storeRegister(QReg source, const PICAShader& shader, u32 des
STR(source, statePointer, offset);
} else {
LDR(scratch1, statePointer, offset); // Load current value
LDR(scratch2, blendMasks.ptr<u8*>() + writeMask * 16); // Load write mask for blending
LDR(scratch2, blendMasks.xptr<u8*>() + writeMask * 16); // Load write mask for blending
BSL(scratch2.B16(), source.B16(), scratch1.B16()); // Scratch2 = (Source & mask) | (original & ~mask)
STR(scratch2, statePointer, offset); // Write it back