[Shader JIT] Add caching

This commit is contained in:
wheremyfoodat
2023-06-07 20:33:37 +03:00
parent 364443d66f
commit 4064abfdeb
9 changed files with 77 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ GPU::GPU(Memory& mem) : mem(mem), renderer(*this, regs) {
void GPU::reset() {
regs.fill(0);
shaderUnit.reset();
shaderJIT.reset();
std::memset(vram, 0, vramSize);
totalAttribCount = 0;
@@ -84,6 +85,10 @@ void GPU::drawArrays() {
log("PICA::DrawElements(vertex count = %d, index buffer config = %08X)\n", vertexCount, indexBufferConfig);
}
if constexpr (useShaderJIT) {
shaderJIT.prepare(shaderUnit.vs);
}
// Total number of input attributes to shader. Differs between GS and VS. Currently stubbed to the VS one, as we don't have geometry shaders.
const u32 inputAttrCount = (regs[PICAInternalRegs::VertexShaderInputBufferCfg] & 0xf) + 1;
const u64 inputAttrCfg = getVertexShaderInputConfig();