Try to adjust texture size for fbo dimension

This commit is contained in:
Henrik Rydgard committed 2013-02-02 12:37:41 +01:00
1 parent a0c0d6a977
commit 76acd62e6e
2 files changed
+10 -4

No files matched your search

+9 -3
View File
@@ -660,11 +660,20 @@ void TextureCache::SetTexture() {
cachekey |= (u64) clutaddr << 32;
}
int w = 1 << (gstate.texsize[0] & 0xf);
int h = 1 << ((gstate.texsize[0]>>8) & 0xf);
// Check for FBO - slow!
TexCacheEntry *fboEntry = GetEntryAt(texaddr);
if (fboEntry && fboEntry->fbo) {
fbo_bind_color_as_texture(fboEntry->fbo, 0);
UpdateSamplingParams(*fboEntry, false);
int fbow, fboh;
fbo_get_dimensions(fboEntry->fbo, &fbow, &fboh);
gstate_c.curTextureWidth = w / fbow; // except not -
gstate_c.curTextureHeight = h / fboh;
return;
}
@@ -742,9 +751,6 @@ void TextureCache::SetTexture() {
entry.dim = gstate.texsize[0] & 0xF0F;
int w = 1 << (gstate.texsize[0] & 0xf);
int h = 1 << ((gstate.texsize[0]>>8) & 0xf);
// This would overestimate the size in many case so we underestimate instead
// to avoid excessive clearing caused by cache invalidations.
entry.sizeInRAM = (bitsPerPixel[format < 11 ? format : 0] * bufw * h / 2) / 8;