CLUTs can be loaded from small rectangular textures. Need to linearize.

Fixes #8406, although technically, we should wrap by bufw, not the
texture width.
This commit is contained in:
Henrik Rydgård committed 2022-09-21 18:33:15 +02:00
1 parent 1971fc49de
commit 94ae0fabfa
5 files changed
+30 -2

No files matched your search

+3 -2
View File
@@ -1259,11 +1259,12 @@ void TextureCacheCommon::LoadClut(u32 clutAddr, u32 loadBytes) {
dynamicClutTemp_ = draw_->CreateFramebuffer(desc);
}
// Download the pixels to our temp clut, scaling down if needed.
// Copy the pixels to our temp clut, scaling down if needed and wrapping.
// TODO: Take the clutRenderOffset_ into account here.
framebufferManager_->BlitUsingRaster(
chosenFramebuffer->fbo, 0.0f, 0.0f, 512.0f * chosenFramebuffer->renderScaleFactor, 1.0f,
dynamicClutTemp_, 0.0f, 0.0f, 512.0f, 1.0f,
false, 1.0f, framebufferManager_->Get2DPipeline(DRAW2D_COPY_COLOR), "copy_clut_to_temp");
false, chosenFramebuffer->renderScaleFactor, framebufferManager_->Get2DPipeline(DRAW2D_COPY_COLOR_RECT2LIN), "copy_clut_to_temp");
clutRenderFormat_ = chosenFramebuffer->fb_format;
}
NotifyMemInfo(MemBlockFlags::ALLOC, clutAddr, loadBytes, "CLUT");