From 6e2bf98d5fd479f7c48bf28ff2cc38c8e8b6d894 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 24 Sep 2016 20:05:39 +0200 Subject: [PATCH] gsdx hw: round mipmap lod value Will avoid some corruption based on distance/angle --- plugins/GSdx/GSRendererHW.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index c361268d2b..68d0a5564d 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -491,7 +491,7 @@ void GSRendererHW::Draw() //gd.sel.mmin = (context->TEX1.MMIN & 1) + 1; // 1: round, 2: tri int mxl = std::min((int)m_context->TEX1.MXL, 6); - int k = (m_context->TEX1.K >> 4); + int k = (m_context->TEX1.K + 8) >> 4; int lcm = m_context->TEX1.LCM; if ((int)m_vt.m_lod.x >= mxl) { @@ -510,7 +510,7 @@ void GSRendererHW::Draw() lod = std::max(std::min(k, mxl), 0); } else { // Not constant but who care ! - lod = std::max((int)m_vt.m_lod.x, 0); + lod = std::max((int)round(m_vt.m_lod.x), 0); } MIP_CLAMP.MINU >>= lod;