Skip to content

Commit

Permalink
rdpq_mode: fix a few issues with SHQ textures
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Oct 4, 2024
1 parent a2e24ae commit 22b0750
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/rdpq_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ typedef enum rdpq_mipmap_s {
MIPMAP_INTERPOLATE = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear")
MIPMAP_INTERPOLATE_SHARPEN = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE | SOM_TEXTURE_SHARPEN) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear") with sharpening enabled
MIPMAP_INTERPOLATE_DETAIL = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE | SOM_TEXTURE_DETAIL) >> 32, ///< Interpolate between the two nearest mipmap levels (also known as "trilinear") with detail texture enabled
MIPMAP_INTERPOLATE_SHQ = (SOM_TEXTURE_LOD | SOMX_LOD_INTERPOLATE_SHQ) >> 32, ///< Special mipmap mode that must be used for SHC textures
MIPMAP_INTERPOLATE_SHQ = (SOMX_LOD_INTERPOLATE_SHQ) >> 32, ///< Special mipmap mode that must be used for SHC textures
} rdpq_mipmap_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/rsp_rdpq.inc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ AA_BLEND_DEFAULT_FORMULA:
.word RDPQ_BLENDER((IN_RGB, IN_ALPHA, MEMORY_RGB, MEMORY_CVG)) & ~SOM_READ_ENABLE # Reduced AA

#define RDPQ_COMB_LOD_INTERP RDPQ_COMBINER2((TEX1, TEX0, LOD_FRAC, TEX0), (TEX1, TEX0, LOD_FRAC, TEX0), (0,0,0,0), (0,0,0,0))
#define RDPQ_COMB_LOD_SHQ RDPQ_COMBINER2((TEX1, TEX0, K5, 0 ), (0, 0, 0, TEX1), (0,0,0,0), (0,0,0,0))
#define RDPQ_COMB_LOD_SHQ RDPQ_COMBINER2((TEX0, TEX1, K5, 0 ), (0, 0, 0, TEX1), (0,0,0,0), (0,0,0,0))
#define RDPQ_COMB_SHADE_FOG RDPQ_COMBINER1((0,0,0,SHADE), (0,0,0,1))
#define RDPQ_COMB_TEX_SHADE_FOG RDPQ_COMBINER1((TEX0,0,SHADE,0), (0,0,0,TEX0))

Expand Down
4 changes: 2 additions & 2 deletions src/rdpq/rdpq_sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ int __rdpq_sprite_upload(rdpq_tile_t tile, sprite_t *sprite, const rdpq_texparms
if (__builtin_expect(set_mode, 1)) {
// Enable/disable mipmapping
if(is_shq) {
rdpq_mode_mipmap(MIPMAP_INTERPOLATE_SHQ, num_mipmaps+1);
rdpq_set_yuv_parms(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF);
rdpq_mode_mipmap(MIPMAP_INTERPOLATE_SHQ, num_mipmaps);
rdpq_set_yuv_parms(0, 0, 0, 0, 0, 0xFF);
}
else if(use_detail) rdpq_mode_mipmap(MIPMAP_INTERPOLATE_DETAIL, num_mipmaps+1);
else if (num_mipmaps) rdpq_mode_mipmap(MIPMAP_INTERPOLATE, num_mipmaps);
Expand Down

0 comments on commit 22b0750

Please sign in to comment.