From d8b1ea22f5a7db0cf564b54a573edb587e7245e7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 18 Feb 2013 08:34:51 -0800 Subject: [PATCH] Cleanup some warnings and reuse some vars. --- GPU/GLES/TextureCache.cpp | 10 +++++----- GPU/GLES/TextureCache.h | 4 ++-- GPU/GLES/TransformPipeline.cpp | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 6487e9ce36..96ccc7768b 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -684,6 +684,8 @@ void TextureCache::SetTexture() { clutformat = gstate.clutformat & 3; clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); cachekey |= (u64)clutaddr << 32; + } else { + clutaddr = 0; } int maxLevel = ((gstate.texmode >> 16) & 0x7); @@ -725,7 +727,7 @@ void TextureCache::SetTexture() { entry->hash != texhash || entry->format != format || entry->maxLevel != maxLevel || - ((format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && + (hasClut && (entry->clutformat != clutformat || entry->clutaddr != clutaddr || entry->cluthash != Memory::Read_U32(entry->clutaddr)))) @@ -810,9 +812,9 @@ void TextureCache::SetTexture() { entry->lodBias = 0.0f; - if (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) { + if (hasClut) { entry->clutformat = clutformat; - entry->clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); + entry->clutaddr = clutaddr; entry->cluthash = Memory::Read_U32(entry->clutaddr); } else { entry->clutaddr = 0; @@ -1173,8 +1175,6 @@ bool TextureCache::DecodeTexture(u8* output, GPUgstate state) // TODO: Look into using BGRA for 32-bit textures when the GL_EXT_texture_format_BGRA8888 extension is available, as it's faster than RGBA on some chips. - // TODO: Actually decode the mipmaps. - switch (format) { case GE_TFMT_CLUT4: diff --git a/GPU/GLES/TextureCache.h b/GPU/GLES/TextureCache.h index 764ad63735..65c64b4eb3 100644 --- a/GPU/GLES/TextureCache.h +++ b/GPU/GLES/TextureCache.h @@ -66,8 +66,8 @@ private: int numFrames; u32 framesUntilNextFullHash; u8 format; - u8 clutformat; u16 dim; + u8 clutformat; u32 clutaddr; u32 cluthash; u32 texture; //GLuint @@ -102,7 +102,7 @@ private: u32 *clutBuf32; u16 *clutBuf16; - int lastBoundTexture; + u32 lastBoundTexture; float maxAnisotropyLevel; }; diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 85fa40b631..72b2066c57 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -53,12 +53,14 @@ enum { }; TransformDrawEngine::TransformDrawEngine() - : numDrawCalls(0), - collectedVerts(0), + : collectedVerts(0), prevPrim_(-1), lastVType_(-1), curVbo_(0), - shaderManager_(0) { + shaderManager_(0), + textureCache_(0), + framebufferManager_(0), + numDrawCalls(0) { // Allocate nicely aligned memory. Maybe graphics drivers will // appreciate it. // All this is a LOT of memory, need to see if we can cut down somehow.