mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 01:59:34 +01:00
Merge pull request #17838 from hrydgard/minor-drawengine-opt
Micro-optimize SubmitPrim, remove outdated mitigation
This commit is contained in:
1 file changed
+4
-10
@@ -802,8 +802,8 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti
|
||||
prevPrim_ = prim;
|
||||
}
|
||||
|
||||
// If vtype has changed, setup the vertex decoder.
|
||||
if (vertTypeID != lastVType_ || !dec_) {
|
||||
// If vtype has changed, setup the vertex decoder. Don't need to nullcheck dec_ since we set lastVType_ to an invalid value whenever we null it.
|
||||
if (vertTypeID != lastVType_) {
|
||||
dec_ = GetVertexDecoder(vertTypeID);
|
||||
lastVType_ = vertTypeID;
|
||||
}
|
||||
@@ -811,7 +811,7 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti
|
||||
*bytesRead = vertexCount * dec_->VertexSize();
|
||||
|
||||
// Check that we have enough vertices to form the requested primitive.
|
||||
if ((vertexCount < 2 && prim > 0) || (vertexCount < 3 && prim > GE_PRIM_LINE_STRIP && prim != GE_PRIM_RECTANGLES))
|
||||
if (vertexCount < 3 && ((vertexCount < 2 && prim > 0) || (prim > GE_PRIM_LINE_STRIP && prim != GE_PRIM_RECTANGLES)))
|
||||
return;
|
||||
|
||||
DeferredDrawCall &dc = drawCalls_[numDrawCalls_];
|
||||
@@ -832,16 +832,10 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti
|
||||
numDrawCalls_++;
|
||||
vertexCountInDrawCalls_ += vertexCount;
|
||||
|
||||
if (decOptions_.applySkinInDecode && (vertTypeID & GE_VTYPE_WEIGHT_MASK)) {
|
||||
if ((vertTypeID & GE_VTYPE_WEIGHT_MASK) && decOptions_.applySkinInDecode) {
|
||||
DecodeVertsStep(decoded_, decodeCounter_, decodedVerts_, &dc.uvScale);
|
||||
decodeCounter_++;
|
||||
}
|
||||
|
||||
if (prim == GE_PRIM_RECTANGLES && (gstate.getTextureAddress(0) & 0x3FFFFFFF) == (gstate.getFrameBufAddress() & 0x3FFFFFFF)) {
|
||||
// Rendertarget == texture? Shouldn't happen. Still, try some mitigations.
|
||||
gstate_c.Dirty(DIRTY_TEXTURE_PARAMS);
|
||||
DispatchFlush();
|
||||
}
|
||||
}
|
||||
|
||||
bool DrawEngineCommon::CanUseHardwareTransform(int prim) {
|
||||
|
||||
Reference in new issue
Block a user