gsdx hw: extra trick for the mipmap

Ratchet & Clank (the third) uses an address of 0 for invalid mipmap.

It would be very awkward to put the middle layer of texture in start of
memory. So let's use this information to correct the lod.

It make the game more robust on the lod rounding
This commit is contained in:
Gregory Hainaut 2016-09-25 11:54:00 +02:00
parent 78b2848622
commit ef9a144437
1 changed files with 8 additions and 0 deletions

View File

@ -514,6 +514,14 @@ void GSRendererHW::Draw()
TEX0 = GetTex0Layer(lod);
// Ratchet & Clank set an address of 0 on invalid layer. Address 0 will be really awkward
// for a mipmap layer. So use it to avoid invalid data
if (TEX0.TBP0 == 0) {
GL_INS("Warning invalid lod %d", lod);
lod++;
TEX0 = GetTex0Layer(lod);
}
MIP_CLAMP.MINU >>= lod;
MIP_CLAMP.MINV >>= lod;
MIP_CLAMP.MAXU >>= lod;