Skip to content

Commit

Permalink
Additional minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Oct 1, 2023
1 parent 3cef04f commit bd931f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion GPU/GPUCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
// TODO: KEEP_PREVIOUS is mistakenly treated as TRIANGLE here... This isn't new.
// static const bool p[8] = { false, false, false, true, true, true, false, true };
// 10111000 = 0xB8;
return (0xB8 >> (int)prim) & 1;
return (0xB8U >> (u8)prim) & 1;
}

void SetDrawType(DrawType type, GEPrimitiveType prim) {
Expand Down
15 changes: 6 additions & 9 deletions GPU/GPUCommonHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,15 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
vfb->usageFlags |= FB_USAGE_BLUE_TO_ALPHA;
}

u32 count = op & 0xFFFF;
if (gstate_c.dirty & DIRTY_VERTEXSHADER_STATE) {
vertexCost_ = EstimatePerVertexCost();
}

u32 count = op & 0xFFFF;
// Must check this after SetRenderFrameBuffer so we know SKIPDRAW_NON_DISPLAYED_FB.
if (gstate_c.skipDrawReason & (SKIPDRAW_SKIPFRAME | SKIPDRAW_NON_DISPLAYED_FB)) {
// Rough estimate, not sure what's correct.
cyclesExecuted += EstimatePerVertexCost() * count;
cyclesExecuted += vertexCost_ * count;
if (gstate.isModeClear()) {
gpuStats.numClears++;
}
Expand All @@ -974,10 +977,6 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
inds = Memory::GetPointerUnchecked(indexAddr);
}

if (gstate_c.dirty & DIRTY_VERTEXSHADER_STATE) {
vertexCost_ = EstimatePerVertexCost();
}

int bytesRead = 0;
UpdateUVScaleOffset();

Expand All @@ -1002,9 +1001,7 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
// PRIM commands with other commands. A special case is Earth Defence Force 2 that changes culling mode
// between each prim, we just change the triangle winding right here to still be able to join draw calls.

uint32_t vtypeCheckMask = ~GE_VTYPE_WEIGHTCOUNT_MASK;
if (!g_Config.bSoftwareSkinning)
vtypeCheckMask = 0xFFFFFFFF;
uint32_t vtypeCheckMask = g_Config.bSoftwareSkinning ? (~GE_VTYPE_WEIGHTCOUNT_MASK) : 0xFFFFFFFF;

if (debugRecording_)
goto bail;
Expand Down

0 comments on commit bd931f9

Please sign in to comment.