From 97058b4db764e7a614f9b1434b044c01265054ac Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 1 Apr 2017 21:17:58 +0200 Subject: [PATCH] Apply the D3D11 loco roco fix identically to the other backends To make centralization easier, and this should be a problem for the other backends as well. --- GPU/Directx9/TextureCacheDX9.cpp | 10 ++++++++-- GPU/GLES/TextureCacheGLES.cpp | 10 ++++++++-- GPU/Vulkan/TextureCacheVulkan.cpp | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index c7b229c1b8..de76f9871b 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -493,9 +493,15 @@ void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry, bool replaceImage break; } + // If size reaches 1, stop, and override maxlevel. + int tw = gstate.getTextureWidth(i); + int th = gstate.getTextureHeight(i); + if (tw == 1 || th == 1) { + maxLevel = i; + break; + } + if (i > 0 && gstate_c.Supports(GPU_SUPPORTS_TEXTURE_LOD_CONTROL)) { - int tw = gstate.getTextureWidth(i); - int th = gstate.getTextureHeight(i); if (tw != 1 && tw != (gstate.getTextureWidth(i - 1) >> 1)) badMipSizes = true; else if (th != 1 && th != (gstate.getTextureHeight(i - 1) >> 1)) diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 2ee232cbdb..1133397b16 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -576,9 +576,15 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry, bool replaceImag break; } + // If size reaches 1, stop, and override maxlevel. + int tw = gstate.getTextureWidth(i); + int th = gstate.getTextureHeight(i); + if (tw == 1 || th == 1) { + maxLevel = i; + break; + } + if (i > 0 && gstate_c.Supports(GPU_SUPPORTS_TEXTURE_LOD_CONTROL)) { - int tw = gstate.getTextureWidth(i); - int th = gstate.getTextureHeight(i); if (tw != 1 && tw != (gstate.getTextureWidth(i - 1) >> 1)) badMipSizes = true; else if (th != 1 && th != (gstate.getTextureHeight(i - 1) >> 1)) diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 1a265b6866..05f2ff8050 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -503,9 +503,15 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry, bool replaceIm break; } + // If size reaches 1, stop, and override maxlevel. + int tw = gstate.getTextureWidth(i); + int th = gstate.getTextureHeight(i); + if (tw == 1 || th == 1) { + maxLevel = i; + break; + } + if (i > 0 && gstate_c.Supports(GPU_SUPPORTS_TEXTURE_LOD_CONTROL)) { - int tw = gstate.getTextureWidth(i); - int th = gstate.getTextureHeight(i); if (tw != 1 && tw != (gstate.getTextureWidth(i - 1) >> 1)) badMipSizes = true; else if (th != 1 && th != (gstate.getTextureHeight(i - 1) >> 1))