Skip to content

Commit

Permalink
Update texture.c
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored Dec 4, 2024
1 parent 98a03e9 commit 1291dc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hw/xbox/nv2a/pgraph/vk/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,16 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
void *texture_data = (char*)d->vram_ptr + texture_vram_offset;
void *palette_data = (char*)d->vram_ptr + texture_palette_vram_offset;


if(state.width == 1280 && state.height == 480 && state.color_format == NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16) {
size_t size = state.height*state.width*2;
uint8_t * tex_theft_buf = texture_data;
for(size_t idx = 0; idx < size; idx+=4) {
tex_theft_buf[idx] = tex_theft_buf[idx+2];
tex_theft_buf[idx+1] = tex_theft_buf[idx+3];
}
}

uint64_t content_hash = 0;
if (!surface_to_texture && possibly_dirty) {
content_hash = fast_hash(texture_data, texture_length);
Expand Down

0 comments on commit 1291dc5

Please sign in to comment.