From 3603ee1e131317aecc73d7e9a799deeb9c870b3d Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:50:10 +0300 Subject: [PATCH] [ShaderJIT] Move prepare call to top of DrawArrays --- src/core/PICA/gpu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/PICA/gpu.cpp b/src/core/PICA/gpu.cpp index e9fada68..d0c90825 100644 --- a/src/core/PICA/gpu.cpp +++ b/src/core/PICA/gpu.cpp @@ -97,6 +97,10 @@ static std::array vertices; template void GPU::drawArrays() { + if constexpr (useShaderJIT) { + shaderJIT.prepare(shaderUnit.vs); + } + // Base address for vertex attributes // The vertex base is always on a quadword boundary because the PICA does weird alignment shit any time possible const u32 vertexBase = ((regs[PICA::InternalRegs::VertexAttribLoc] >> 1) & 0xfffffff) * 16; @@ -129,10 +133,6 @@ 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[PICA::InternalRegs::VertexShaderInputBufferCfg] & 0xf) + 1; const u64 inputAttrCfg = getVertexShaderInputConfig();