Skip to content

Commit

Permalink
Merge pull request #199 from GDQR/Texture-Buffer
Browse files Browse the repository at this point in the history
 Fix: width of texture buffer for pallete color
  • Loading branch information
h4570 authored Oct 1, 2024
2 parents 1e396fb + e8c0cfc commit b7bc5f2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions engine/src/renderer/core/texture/renderer_core_texture_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,19 @@ texbuffer_t* RendererCoreTextureSender::allocateTextureCore(
auto* result = new texbuffer_t;
const auto* core = t_texture->core;

int coreWidth = core->width <= 64 ? 64 : core->width;
switch (core->psm) {
case GS_PSM_8:
case GS_PSM_4:
case GS_PSM_8H:
case GS_PSM_4HL:
case GS_PSM_4HH:
result->width = -128 & (core->width + 127);
break;
default:
result->width = -64 & (core->width + 63);
break;
}

result->width = coreWidth;
result->psm = core->psm;
result->info.components = core->components;

Expand Down

0 comments on commit b7bc5f2

Please sign in to comment.