mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
softgpu: Optimize out texture proj for UVs.
Seen in NFS Most Wanted 5-1-0.
This commit is contained in:
1 parent
d7224a8401
commit
33abbca464
1 file changed
+6
-1
@@ -132,7 +132,12 @@ void ComputeRasterizerState(RasterizerState *state, std::function<void()> flushF
|
||||
state->textureProj = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
|
||||
if (state->textureProj) {
|
||||
// We may be able to optimize this off. This is actually kinda common.
|
||||
if (gstate.tgenMatrix[2] == 0.0f && gstate.tgenMatrix[5] == 0.0f && gstate.tgenMatrix[8] == 0.0f && gstate.tgenMatrix[11] == 1.0f) {
|
||||
const bool qZeroST = gstate.tgenMatrix[2] == 0.0f && gstate.tgenMatrix[5] == 0.0f;
|
||||
const bool qZeroQ = gstate.tgenMatrix[8] == 0.0f;
|
||||
|
||||
// Two common cases: the source q factor is zero, OR source is UV.
|
||||
const bool qFactorZero = gstate.getUVProjMode() == GE_PROJMAP_UV;
|
||||
if (qZeroST && (qZeroQ || qFactorZero) && gstate.tgenMatrix[11] == 1.0f) {
|
||||
state->textureProj = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user