From 751f30003d32da3c8081e1084c0e8d15492c5646 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 6 Oct 2019 14:16:12 +0200 Subject: [PATCH] rend: fix stride regression introduced in 24b973f7 Fix YUV textures corruption --- core/rend/TexCache.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/rend/TexCache.cpp b/core/rend/TexCache.cpp index e5c7fd43a..b204ea45e 100644 --- a/core/rend/TexCache.cpp +++ b/core/rend/TexCache.cpp @@ -535,9 +535,8 @@ void BaseTextureCacheData::Create() //Planar textures support stride selection, mostly used for non power of 2 textures (videos) int stride = w; if (tcw.StrideSel) - { - stride = std::max((TEXT_CONTROL & 31) * 32, w); - } + stride = (TEXT_CONTROL & 31) * 32; + //Call the format specific conversion code texconv = tex->PL; texconv32 = tex->PL32; @@ -613,10 +612,10 @@ void BaseTextureCacheData::Update() ::vq_codebook = &vram[vq_codebook]; // might be used if VQ tex //texture conversion work - u32 stride=w; + u32 stride = w; if (tcw.StrideSel && tcw.ScanOrder && (tex->PL || tex->PL32)) - stride = std::max(w, (TEXT_CONTROL & 31) * 32); + stride = (TEXT_CONTROL & 31) * 32; u32 original_h = h; if (sa_tex > VRAM_SIZE || size == 0 || sa + size > VRAM_SIZE)