Rename bpmem.copyMipMapStrideChannels to bpmem.copyDestStride

As far as I can tell, it has nothing to do with the mipmap/half_scale functionality, but does change based on the width of the destination texture (and the destination texture is half the width if half_scale is set). The comment that was there (which dates back to the initial megacommit) seems to not have accounted for the width aspect; it was first used as an actual stride in bbbe898839 (the first commit that used it at all).
This commit is contained in:
Pokechu22 2023-10-29 17:54:51 -07:00
parent 9543555bfe
commit 6bad17b170
4 changed files with 35 additions and 38 deletions

View File

@ -605,7 +605,7 @@ void FifoPlayer::ClearEfb()
wh.x = EFB_WIDTH - 1;
wh.y = EFB_HEIGHT - 1;
LoadBPReg(BPMEM_EFB_WH, wh.hex);
LoadBPReg(BPMEM_MIPMAP_STRIDE, 0x140);
LoadBPReg(BPMEM_EFB_STRIDE, 0x140);
// The clear color and Z value have already been loaded via LoadRegisters()
LoadBPReg(BPMEM_EFB_ADDR, 0);
UPE_Copy copy = bpmem.triggerEFBCopy;
@ -627,7 +627,7 @@ void FifoPlayer::ClearEfb()
// probably a good idea.
LoadBPReg(BPMEM_EFB_TL, m_File->GetBPMem()[BPMEM_EFB_TL]);
LoadBPReg(BPMEM_EFB_WH, m_File->GetBPMem()[BPMEM_EFB_WH]);
LoadBPReg(BPMEM_MIPMAP_STRIDE, m_File->GetBPMem()[BPMEM_MIPMAP_STRIDE]);
LoadBPReg(BPMEM_EFB_STRIDE, m_File->GetBPMem()[BPMEM_EFB_STRIDE]);
LoadBPReg(BPMEM_EFB_ADDR, m_File->GetBPMem()[BPMEM_EFB_ADDR]);
// Wait for the EFB copy to finish. That way, the EFB copy (which will be performed at a later
// time) won't clobber any memory updates.

View File

@ -231,7 +231,7 @@ static void SetSpans(int sBlkSize, int tBlkSize, s32* tSpan, s32* sBlkSpan, s32*
*tBlkSpan = ((640 * tBlkSize) - alignedWidth) *
readStride; // bytes to advance src pointer after each row of blocks
*writeStride = bpmem.copyMipMapStrideChannels * 32;
*writeStride = bpmem.copyDestStride << 5;
}
#define ENCODE_LOOP_BLOCKS \

View File

@ -56,7 +56,7 @@ enum
BPMEM_EFB_TL = 0x49,
BPMEM_EFB_WH = 0x4A,
BPMEM_EFB_ADDR = 0x4B,
BPMEM_MIPMAP_STRIDE = 0x4D,
BPMEM_EFB_STRIDE = 0x4D,
BPMEM_COPYYSCALE = 0x4E,
BPMEM_CLEAR_AR = 0x4F,
BPMEM_CLEAR_GB = 0x50,
@ -2451,10 +2451,7 @@ struct BPMemory
X10Y10 copyTexSrcWH; // 0x4a
u32 copyTexDest; // 0x4b: CopyAddress (GXDispCopy and GXTexCopy use it)
u32 unknown6; // 0x4c
// usually set to 4 when dest is single channel, 8 when dest is 2 channel, 16 when dest is RGBA
// also, doubles whenever mipmap box filter option is set (excent on RGBA). Probably to do
// with number of bytes to look at when smoothing
u32 copyMipMapStrideChannels; // 0x4d
u32 copyDestStride; // 0x4d
u32 dispcopyyscale; // 0x4e
u32 clearcolorAR; // 0x4f
u32 clearcolorGB; // 0x50

View File

@ -246,7 +246,7 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager,
// this function
u32 destAddr = bpmem.copyTexDest << 5;
u32 destStride = bpmem.copyMipMapStrideChannels << 5;
u32 destStride = bpmem.copyDestStride << 5;
MathUtil::Rectangle<s32> srcRect;
srcRect.left = bpmem.copyTexSrcXY.x;
@ -515,7 +515,7 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager,
pixel_shader_manager.SetZModeControl();
return;
case BPMEM_MIPMAP_STRIDE: // MipMap Stride Channel
case BPMEM_EFB_STRIDE: // Display Copy Stride
case BPMEM_COPYYSCALE: // Display Copy Y Scale
/* 24 RID
@ -982,8 +982,8 @@ std::pair<std::string, std::string> GetBPRegInfo(u8 cmd, u32 cmddata)
RegName(BPMEM_EFB_ADDR),
fmt::format("EFB Target address (32 byte aligned): 0x{:06X}", cmddata << 5));
case BPMEM_MIPMAP_STRIDE: // 0x4D
return DescriptionlessReg(BPMEM_MIPMAP_STRIDE);
case BPMEM_EFB_STRIDE: // 0x4D
return DescriptionlessReg(BPMEM_EFB_STRIDE);
// TODO: Description
case BPMEM_COPYYSCALE: // 0x4E