mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-27 04:08:37 +01:00
Split GetPointer into two versions, to help with const correctness
This commit is contained in:
1 parent
d2a3918f5f
commit
e6403d7157
43 files changed
+169
-156
No files matched your search
+9
-9
@@ -1677,8 +1677,8 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) {
|
||||
return;
|
||||
}
|
||||
|
||||
void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
void *inds = nullptr;
|
||||
const void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *inds = nullptr;
|
||||
u32 vertexType = gstate.vertType;
|
||||
if ((vertexType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
u32 indexAddr = gstate_c.indexAddr;
|
||||
@@ -1886,8 +1886,8 @@ void GPUCommon::Execute_Bezier(u32 op, u32 diff) {
|
||||
return;
|
||||
}
|
||||
|
||||
void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
void *indices = NULL;
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG_REPORT(G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
@@ -1956,8 +1956,8 @@ void GPUCommon::Execute_Spline(u32 op, u32 diff) {
|
||||
return;
|
||||
}
|
||||
|
||||
void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
void *indices = NULL;
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG_REPORT(G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
@@ -2018,7 +2018,7 @@ void GPUCommon::Execute_BoundingBox(u32 op, u32 diff) {
|
||||
return;
|
||||
}
|
||||
if (((count & 7) == 0) && count <= 64) { // Sanity check
|
||||
void *control_points = Memory::GetPointer(gstate_c.vertexAddr);
|
||||
const void *control_points = Memory::GetPointer(gstate_c.vertexAddr);
|
||||
if (!control_points) {
|
||||
ERROR_LOG_REPORT_ONCE(boundingbox, G3D, "Invalid verts in bounding box check");
|
||||
currentList->bboxResult = true;
|
||||
@@ -2795,7 +2795,7 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
|
||||
u32 srcLineStartAddr = srcBasePtr + (srcY * srcStride + srcX) * bpp;
|
||||
u32 dstLineStartAddr = dstBasePtr + (dstY * dstStride + dstX) * bpp;
|
||||
const u8 *src = Memory::GetPointerUnchecked(srcLineStartAddr);
|
||||
u8 *dst = Memory::GetPointerUnchecked(dstLineStartAddr);
|
||||
u8 *dst = Memory::GetPointerWriteUnchecked(dstLineStartAddr);
|
||||
memcpy(dst, src, width * height * bpp);
|
||||
GPURecord::NotifyMemcpy(dstLineStartAddr, srcLineStartAddr, width * height * bpp);
|
||||
} else {
|
||||
@@ -2804,7 +2804,7 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
|
||||
u32 dstLineStartAddr = dstBasePtr + ((y + dstY) * dstStride + dstX) * bpp;
|
||||
|
||||
const u8 *src = Memory::GetPointerUnchecked(srcLineStartAddr);
|
||||
u8 *dst = Memory::GetPointerUnchecked(dstLineStartAddr);
|
||||
u8 *dst = Memory::GetPointerWriteUnchecked(dstLineStartAddr);
|
||||
memcpy(dst, src, width * bpp);
|
||||
GPURecord::NotifyMemcpy(dstLineStartAddr, srcLineStartAddr, width * bpp);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user