Merge pull request #15718 from hrydgard/getpointer-const-cleanup

Split GetPointer into GetPointer and GetPointerWrite
This commit is contained in:
Unknown W. Brackets 2022-07-24 07:51:39 -07:00 committed by GitHub
commit b02fa4ec00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 192 additions and 173 deletions

View file

@ -1694,7 +1694,7 @@ void FramebufferManagerCommon::ApplyClearToMemory(int x1, int y1, int x2, int y2
return;
}
u8 *addr = Memory::GetPointerUnchecked(gstate.getFrameBufAddress());
u8 *addr = Memory::GetPointerWriteUnchecked(gstate.getFrameBufAddress());
const int bpp = gstate_c.framebufFormat == GE_FORMAT_8888 ? 4 : 2;
u32 clearBits = clearColor;
@ -2033,7 +2033,7 @@ bool FramebufferManagerCommon::GetFramebuffer(u32 fb_address, int fb_stride, GEB
if (!Memory::IsValidAddress(fb_address))
return false;
// If there's no vfb and we're drawing there, must be memory?
buffer = GPUDebugBuffer(Memory::GetPointer(fb_address), fb_stride, 512, format);
buffer = GPUDebugBuffer(Memory::GetPointerWriteUnchecked(fb_address), fb_stride, 512, format);
return true;
}
@ -2090,7 +2090,7 @@ bool FramebufferManagerCommon::GetDepthbuffer(u32 fb_address, int fb_stride, u32
if (!Memory::IsValidAddress(z_address))
return false;
// If there's no vfb and we're drawing there, must be memory?
buffer = GPUDebugBuffer(Memory::GetPointer(z_address), z_stride, 512, GPU_DBG_FORMAT_16BIT);
buffer = GPUDebugBuffer(Memory::GetPointerWriteUnchecked(z_address), z_stride, 512, GPU_DBG_FORMAT_16BIT);
return true;
}
@ -2128,7 +2128,7 @@ bool FramebufferManagerCommon::GetStencilbuffer(u32 fb_address, int fb_stride, G
return false;
// If there's no vfb and we're drawing there, must be memory?
// TODO: Actually get the stencil.
buffer = GPUDebugBuffer(Memory::GetPointer(fb_address), fb_stride, 512, GPU_DBG_FORMAT_8888);
buffer = GPUDebugBuffer(Memory::GetPointerWrite(fb_address), fb_stride, 512, GPU_DBG_FORMAT_8888);
return true;
}
@ -2193,7 +2193,7 @@ void FramebufferManagerCommon::PackFramebufferSync_(VirtualFramebuffer *vfb, int
return;
}
u8 *destPtr = Memory::GetPointer(fb_address + dstByteOffset);
u8 *destPtr = Memory::GetPointerWriteUnchecked(fb_address + dstByteOffset);
// We always need to convert from the framebuffer native format.
// Right now that's always 8888.