From 15a608a6b9c48c862c016e402f2abe75491e6567 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 1 Mar 2014 16:11:56 -0800 Subject: [PATCH] Check for kernel textures in kernel ram properly. Textures can perfectly legitimately be in volatile ram. --- GPU/Common/TextureDecoder.h | 2 +- GPU/Directx9/TextureCacheDX9.cpp | 2 +- GPU/GLES/TextureCache.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GPU/Common/TextureDecoder.h b/GPU/Common/TextureDecoder.h index dabd95291..6d092de0b 100644 --- a/GPU/Common/TextureDecoder.h +++ b/GPU/Common/TextureDecoder.h @@ -92,7 +92,7 @@ static const u32 textureAlignMask16[16] = { static inline u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) { // This is a hack to allow for us to draw the huge PPGe texture, which is always in kernel ram. - if (texaddr < PSP_GetUserMemoryBase()) + if (texaddr < PSP_GetKernelMemoryEnd()) return gstate.texbufwidth[level] & 0x1FFF; u32 bufw = gstate.texbufwidth[level] & textureAlignMask16[format]; diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 0ff095db6..3fbbb417b 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -1027,7 +1027,7 @@ void TextureCacheDX9::SetTexture() { } } - if ((bufw == 0 || (gstate.texbufwidth[0] & 0xf800) != 0) && texaddr >= PSP_GetUserMemoryBase()) { + if ((bufw == 0 || (gstate.texbufwidth[0] & 0xf800) != 0) && texaddr >= PSP_GetKernelMemoryEnd()) { ERROR_LOG_REPORT(G3D, "Texture with unexpected bufw (full=%d)", gstate.texbufwidth[0] & 0xffff); } diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 77b0d7494..037378e43 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1060,7 +1060,7 @@ void TextureCache::SetTexture(bool force) { } } - if ((bufw == 0 || (gstate.texbufwidth[0] & 0xf800) != 0) && texaddr >= PSP_GetUserMemoryBase()) { + if ((bufw == 0 || (gstate.texbufwidth[0] & 0xf800) != 0) && texaddr >= PSP_GetKernelMemoryEnd()) { ERROR_LOG_REPORT(G3D, "Texture with unexpected bufw (full=%d)", gstate.texbufwidth[0] & 0xffff); }