diff --git a/GPU/GLES/GLES_GPU.cpp b/GPU/GLES/GLES_GPU.cpp index 9a9906c819..f1e2a6aaa0 100644 --- a/GPU/GLES/GLES_GPU.cpp +++ b/GPU/GLES/GLES_GPU.cpp @@ -1509,6 +1509,18 @@ void GLES_GPU::ExecuteOpInternal(u32 op, u32 diff) { } } +void GLES_GPU::FastLoadBoneMatrix(u32 target) { + if (!g_Config.bSoftwareSkinning) { + Flush(); + const int num = gstate.boneMatrixNumber & 0x7F; + shaderManager_->DirtyUniform(DIRTY_BONEMATRIX0 << (num / 12)); + if ((num % 12) != 0) { + shaderManager_->DirtyUniform((DIRTY_BONEMATRIX0 << (num / 12)) + 1); + } + } + gstate.FastLoadBoneMatrix(target); +} + void GLES_GPU::UpdateStats() { gpuStats.numVertexShaders = shaderManager_->NumVertexShaders(); gpuStats.numFragmentShaders = shaderManager_->NumFragmentShaders(); diff --git a/GPU/GLES/GLES_GPU.h b/GPU/GLES/GLES_GPU.h index 6746e77770..5742741f89 100644 --- a/GPU/GLES/GLES_GPU.h +++ b/GPU/GLES/GLES_GPU.h @@ -78,6 +78,7 @@ public: protected: virtual void FastRunLoop(DisplayList &list); virtual void ProcessEvent(GPUEvent ev); + virtual void FastLoadBoneMatrix(u32 target); private: void Flush() { diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 83ad905dc8..9647de36bf 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -736,12 +736,12 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { u32 target = gstate_c.getRelativeAddress(data); // Bone matrix optimization - many games will CALL a bone matrix (!). - if (g_Config.bSoftwareSkinning && (Memory::ReadUnchecked_U32(target) >> 24) == GE_CMD_BONEMATRIXDATA) { + if ((Memory::ReadUnchecked_U32(target) >> 24) == GE_CMD_BONEMATRIXDATA) { // Check for the end if ((Memory::ReadUnchecked_U32(target + 11 * 4) >> 24) == GE_CMD_BONEMATRIXDATA && (Memory::ReadUnchecked_U32(target + 12 * 4) >> 24) == GE_CMD_RET) { // Yep, pretty sure this is a bone matrix call. - gstate.FastLoadBoneMatrix(target); + FastLoadBoneMatrix(target); break; } } @@ -933,6 +933,10 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { } } +void GPUCommon::FastLoadBoneMatrix(u32 target) { + gstate.FastLoadBoneMatrix(target); +} + struct DisplayListOld { int id; u32 startpc; diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 769df0c94e..7ddbd39b53 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -88,6 +88,7 @@ protected: int GetNextListIndex(); void ProcessDLQueueInternal(); void ReapplyGfxStateInternal(); + virtual void FastLoadBoneMatrix(u32 target); virtual void ProcessEvent(GPUEvent ev); virtual bool ShouldExitEventLoop() { return coreState != CORE_RUNNING;