Merge pull request #17192 from unknownbrackets/saveicon-download

GPU: Add xfer flag to ignore create vfb flags
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-03-26 08:51:27 +02:00
commit f3076294b2
4 files changed
+12 -11

No files matched your search

+3 -3
View File
@@ -734,7 +734,7 @@ static int Hook_godseaterburst_depthmask_5551() {
// This is added to read from the linearized mirror.
uint32_t depthMirror = depthBuffer + 0x00200000;
// Depth download required, or it won't work and will be transparent.
gpu->PerformMemoryCopy(depthMirror, depthMirror, size, GPUCopyFlag::FORCE_DST_MEM | GPUCopyFlag::DEPTH_REQUESTED);
gpu->PerformMemoryCopy(depthMirror, depthMirror, size, GPUCopyFlag::FORCE_DST_MATCH_MEM | GPUCopyFlag::DEPTH_REQUESTED);
NotifyMemInfo(MemBlockFlags::WRITE, depthMirror, size, "godseaterburst_depthmask_5551");
}
@@ -769,7 +769,7 @@ static int Hook_starocean_write_stencil() {
static int Hook_topx_create_saveicon() {
const u32 fb_address = currentMIPS->r[MIPS_REG_V0];
if (Memory::IsVRAMAddress(fb_address)) {
gpu->PerformReadbackToMemory(fb_address, 0x00044000);
gpu->PerformMemoryCopy(fb_address, fb_address, 0x00044000, GPUCopyFlag::FORCE_DST_MATCH_MEM | GPUCopyFlag::DISALLOW_CREATE_VFB);
NotifyMemInfo(MemBlockFlags::WRITE, fb_address, 0x00044000, "topx_create_saveicon");
}
return 0;
@@ -820,7 +820,7 @@ static int Hook_growlanser_create_saveicon() {
const u32 fmt = Memory::Read_U32(currentMIPS->r[MIPS_REG_SP]);
const u32 sz = fmt == GE_FORMAT_8888 ? 0x00088000 : 0x00044000;
if (Memory::IsVRAMAddress(fb_address) && fmt <= 3) {
gpu->PerformReadbackToMemory(fb_address, sz);
gpu->PerformMemoryCopy(fb_address, fb_address, sz, GPUCopyFlag::FORCE_DST_MATCH_MEM | GPUCopyFlag::DISALLOW_CREATE_VFB);
NotifyMemInfo(MemBlockFlags::WRITE, fb_address, sz, "growlanser_create_saveicon");
}
return 0;
+3 -3
View File
@@ -1799,8 +1799,8 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size,
VirtualFramebuffer *dstBuffer = nullptr;
VirtualFramebuffer *srcBuffer = nullptr;
bool ignoreDstBuffer = flags & GPUCopyFlag::FORCE_DST_MEM;
bool ignoreSrcBuffer = flags & (GPUCopyFlag::FORCE_SRC_MEM | GPUCopyFlag::MEMSET);
bool ignoreDstBuffer = flags & GPUCopyFlag::FORCE_DST_MATCH_MEM;
bool ignoreSrcBuffer = flags & (GPUCopyFlag::FORCE_SRC_MATCH_MEM | GPUCopyFlag::MEMSET);
RasterChannel channel = flags & GPUCopyFlag::DEPTH_REQUESTED ? RASTER_DEPTH : RASTER_COLOR;
u32 dstY = (u32)-1;
@@ -1892,7 +1892,7 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size,
if (!dstBuffer && srcBuffer && channel != RASTER_DEPTH) {
// Note - if we're here, we're in a memcpy, not a block transfer. Not allowing IntraVRAMBlockTransferAllowCreateFB.
// Technically, that makes BlockTransferAllowCreateFB a bit of a misnomer.
if (PSP_CoreParameter().compat.flags().BlockTransferAllowCreateFB) {
if (PSP_CoreParameter().compat.flags().BlockTransferAllowCreateFB && !(flags & GPUCopyFlag::DISALLOW_CREATE_VFB)) {
dstBuffer = CreateRAMFramebuffer(dst, srcBuffer->width, srcBuffer->height, srcBuffer->fb_stride, srcBuffer->fb_format);
dstY = 0;
}
+2 -2
View File
@@ -1977,7 +1977,7 @@ bool GPUCommon::PerformMemorySet(u32 dest, u8 v, int size) {
bool GPUCommon::PerformReadbackToMemory(u32 dest, int size) {
if (Memory::IsVRAMAddress(dest)) {
return PerformMemoryCopy(dest, dest, size, GPUCopyFlag::FORCE_DST_MEM);
return PerformMemoryCopy(dest, dest, size, GPUCopyFlag::FORCE_DST_MATCH_MEM);
}
return false;
}
@@ -1985,7 +1985,7 @@ bool GPUCommon::PerformReadbackToMemory(u32 dest, int size) {
bool GPUCommon::PerformWriteColorFromMemory(u32 dest, int size) {
if (Memory::IsVRAMAddress(dest)) {
GPURecord::NotifyUpload(dest, size);
return PerformMemoryCopy(dest, dest, size, GPUCopyFlag::FORCE_SRC_MEM | GPUCopyFlag::DEBUG_NOTIFIED);
return PerformMemoryCopy(dest, dest, size, GPUCopyFlag::FORCE_SRC_MATCH_MEM | GPUCopyFlag::DEBUG_NOTIFIED);
}
return false;
}
+4 -3
View File
@@ -116,12 +116,13 @@ ENUM_CLASS_BITOPS(WriteStencil);
enum class GPUCopyFlag {
NONE = 0,
FORCE_SRC_MEM = 1,
FORCE_DST_MEM = 2,
// Note: implies src == dst and FORCE_SRC_MEM.
FORCE_SRC_MATCH_MEM = 1,
FORCE_DST_MATCH_MEM = 2,
// Note: implies src == dst and FORCE_SRC_MATCH_MEM.
MEMSET = 4,
DEPTH_REQUESTED = 8,
DEBUG_NOTIFIED = 16,
DISALLOW_CREATE_VFB = 32,
};
ENUM_CLASS_BITOPS(GPUCopyFlag);