Make FLAG_FLUSHBEFORE a no-op, move flushes into the execution functions.

It would only be necessary if we needed the previous value, which we
don't do in any of these.
This commit is contained in:
Henrik Rydgård 2017-08-17 13:05:13 +02:00
parent cd43049788
commit 71baecabd6
5 changed files with 27 additions and 6 deletions

View File

@ -397,7 +397,7 @@ void GPU_D3D11::FastRunLoop(DisplayList &list) {
const u8 cmdFlags = info.flags; // If we stashed the cmdFlags in the top bits of the cmdmem, we could get away with one table lookup instead of two
const u32 diff = op ^ gstate.cmdmem[cmd];
// Inlined CheckFlushOp here to get rid of the dumpThisFrame_ check.
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
drawEngine_.Flush();
}
gstate.cmdmem[cmd] = op; // TODO: no need to write if diff==0...
@ -546,6 +546,8 @@ void GPU_D3D11::Execute_Prim(u32 op, u32 diff) {
}
void GPU_D3D11::Execute_Bezier(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
@ -608,6 +610,8 @@ void GPU_D3D11::Execute_Bezier(u32 op, u32 diff) {
}
void GPU_D3D11::Execute_Spline(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);

View File

@ -364,7 +364,7 @@ void GPU_DX9::FastRunLoop(DisplayList &list) {
const u8 cmdFlags = info.flags; // If we stashed the cmdFlags in the top bits of the cmdmem, we could get away with one table lookup instead of two
const u32 diff = op ^ gstate.cmdmem[cmd];
// Inlined CheckFlushOp here to get rid of the dumpThisFrame_ check.
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
drawEngine_.Flush();
}
gstate.cmdmem[cmd] = op; // TODO: no need to write if diff==0...
@ -386,7 +386,7 @@ void GPU_DX9::FinishDeferred() {
inline void GPU_DX9::CheckFlushOp(int cmd, u32 diff) {
const u8 cmdFlags = cmdInfo_[cmd].flags;
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
if (dumpThisFrame_) {
NOTICE_LOG(G3D, "================ FLUSH ================");
}
@ -512,6 +512,8 @@ void GPU_DX9::Execute_Prim(u32 op, u32 diff) {
}
void GPU_DX9::Execute_Bezier(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
@ -559,6 +561,8 @@ void GPU_DX9::Execute_Bezier(u32 op, u32 diff) {
}
void GPU_DX9::Execute_Spline(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);

View File

@ -571,7 +571,7 @@ void GPU_GLES::FastRunLoop(DisplayList &list) {
const u8 cmdFlags = info.flags; // If we stashed the cmdFlags in the top bits of the cmdmem, we could get away with one table lookup instead of two
const u32 diff = op ^ gstate.cmdmem[cmd];
// Inlined CheckFlushOp here to get rid of the dumpThisFrame_ check.
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
drawEngine_.Flush();
}
gstate.cmdmem[cmd] = op; // TODO: no need to write if diff==0...
@ -596,7 +596,7 @@ void GPU_GLES::FinishDeferred() {
inline void GPU_GLES::CheckFlushOp(int cmd, u32 diff) {
const u8 cmdFlags = cmdInfo_[cmd].flags;
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
if (dumpThisFrame_) {
NOTICE_LOG(G3D, "================ FLUSH ================");
}
@ -720,6 +720,8 @@ void GPU_GLES::Execute_VertexTypeSkinning(u32 op, u32 diff) {
}
void GPU_GLES::Execute_Bezier(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
@ -782,6 +784,8 @@ void GPU_GLES::Execute_Bezier(u32 op, u32 diff) {
}
void GPU_GLES::Execute_Spline(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);

View File

@ -1267,6 +1267,8 @@ void GPUCommon::Execute_Ret(u32 op, u32 diff) {
}
void GPUCommon::Execute_End(u32 op, u32 diff) {
Flush();
easy_guard guard(listLock);
const u32 prev = Memory::ReadUnchecked_U32(currentList->pc - 4);
UpdatePC(currentList->pc, currentList->pc);
@ -1451,6 +1453,7 @@ void GPUCommon::Execute_TexLevel(u32 op, u32 diff) {
}
void GPUCommon::Execute_Bezier(u32 op, u32 diff) {
Flush();
// This also make skipping drawing very effective.
framebufferManager_->SetRenderFrameBuffer(gstate_c.IsDirty(DIRTY_FRAMEBUF), gstate_c.skipDrawReason);
if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) {
@ -1494,6 +1497,7 @@ void GPUCommon::Execute_Bezier(u32 op, u32 diff) {
}
void GPUCommon::Execute_Spline(u32 op, u32 diff) {
Flush();
// This also make skipping drawing very effective.
framebufferManager_->SetRenderFrameBuffer(gstate_c.IsDirty(DIRTY_FRAMEBUF), gstate_c.skipDrawReason);
if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) {
@ -1568,6 +1572,7 @@ void GPUCommon::Execute_BoundingBox(u32 op, u32 diff) {
}
void GPUCommon::Execute_BlockTransferStart(u32 op, u32 diff) {
Flush();
// and take appropriate action. This is a block transfer between RAM and VRAM, or vice versa.
// Can we skip this on SkipDraw?
DoBlockTransfer(gstate_c.skipDrawReason);

View File

@ -402,7 +402,7 @@ void GPU_Vulkan::FastRunLoop(DisplayList &list) {
const u8 cmdFlags = info.flags; // If we stashed the cmdFlags in the top bits of the cmdmem, we could get away with one table lookup instead of two
const u32 diff = op ^ gstate.cmdmem[cmd];
// Inlined CheckFlushOp here to get rid of the dumpThisFrame_ check.
if ((cmdFlags & FLAG_FLUSHBEFORE) || (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE))) {
if (diff && (cmdFlags & FLAG_FLUSHBEFOREONCHANGE)) {
drawEngine_.Flush();
}
gstate.cmdmem[cmd] = op; // TODO: no need to write if diff==0...
@ -551,6 +551,8 @@ void GPU_Vulkan::Execute_VertexTypeSkinning(u32 op, u32 diff) {
}
void GPU_Vulkan::Execute_Bezier(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
@ -613,6 +615,8 @@ void GPU_Vulkan::Execute_Bezier(u32 op, u32 diff) {
}
void GPU_Vulkan::Execute_Spline(u32 op, u32 diff) {
Flush();
// We don't dirty on normal changes anymore as we prescale, but it's needed for splines/bezier.
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);