From 46d93c908ce4e91d45d0022f0b26b7a331e0a49e Mon Sep 17 00:00:00 2001 From: Lurs <2795933+Lurs@users.noreply.github.com> Date: Wed, 1 Jul 2026 23:09:28 +0200 Subject: [PATCH] Support BCn for RawTextureReplacement --- src/dusk/tphd/HdAssetLayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dusk/tphd/HdAssetLayer.cpp b/src/dusk/tphd/HdAssetLayer.cpp index e5c37cd3c2..c05f4bdcf0 100644 --- a/src/dusk/tphd/HdAssetLayer.cpp +++ b/src/dusk/tphd/HdAssetLayer.cpp @@ -455,10 +455,12 @@ void registerHdSurface(const Gx2FormatMapping& m, const GtxSurface& s, std::lock_guard lk{g_cacheMutex}; g_textureBuffers().emplace_back(std::move(decoded.bytes)); const auto& bytes = g_textureBuffers().back(); + const u32 texWidth = m.isBcn ? ((s.width + 3u) & ~3u) : s.width; + const u32 texHeight = m.isBcn ? ((s.height + 3u) & ~3u) : s.height; const aurora::texture::RawTextureReplacement replacement{ .bytes = {bytes.data(), bytes.size()}, - .width = s.width, - .height = s.height, + .width = texWidth, + .height = texHeight, .mipCount = std::max(decoded.mipCount, 1u), .gxFormat = m.newGxFormat, .label = gtxName,