Allow fast bone mtx loads w/o software skinning.

This commit is contained in:
Unknown W. Brackets 2014-03-02 18:12:40 -08:00
parent 8aceba732a
commit 0a880b09ad
4 changed files with 20 additions and 2 deletions

View File

@ -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();

View File

@ -78,6 +78,7 @@ public:
protected:
virtual void FastRunLoop(DisplayList &list);
virtual void ProcessEvent(GPUEvent ev);
virtual void FastLoadBoneMatrix(u32 target);
private:
void Flush() {

View File

@ -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;

View File

@ -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;