mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 03:35:19 +02:00
Split GetPointer into two versions, to help with const correctness
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user