From 6a15e7a3aa8ffefff1b2f6cfd6917b5ffa19eaa0 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 2 Feb 2025 17:11:22 +0100 Subject: [PATCH] rend: LoD0 of VQ YUV textures is invalid. Use LoD1 instead. Fixes background magenta textures in WSB2K2. Issue #1038 --- core/rend/TexCache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/rend/TexCache.cpp b/core/rend/TexCache.cpp index 90cd47100..46743b57a 100644 --- a/core/rend/TexCache.cpp +++ b/core/rend/TexCache.cpp @@ -555,7 +555,10 @@ bool BaseTextureCacheData::Update() { PixelBuffer pb0; pb0.init(2, 2 ,false); - texconv32(&pb0, (u8*)&vram[vram_addr], 2, 2); + if (tcw.PixelFmt == PixelYUV) + // Use higher LoD mipmap + vram_addr = startAddress + VQMipPoint[1]; + texconv32(&pb0, &vram[vram_addr], 2, 2); *pb32.data() = *pb0.data(1, 1); continue; }