mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GE Debugger: Align texture/vertex/etc. data.
This may allow slab allocation after all, since it needs to be aligned.
This commit is contained in:
parent
9430145774
commit
300961ce6e
1 changed files with 9 additions and 2 deletions
|
@ -242,7 +242,15 @@ static Command EmitCommandWithRAM(CommandType t, const void *p, u32 sz) {
|
||||||
cmd.ptr = (u32)(prev - pushbuf.data());
|
cmd.ptr = (u32)(prev - pushbuf.data());
|
||||||
} else {
|
} else {
|
||||||
cmd.ptr = (u32)pushbuf.size();
|
cmd.ptr = (u32)pushbuf.size();
|
||||||
pushbuf.resize(pushbuf.size() + sz);
|
int pad = 0;
|
||||||
|
if (cmd.ptr & 0xF) {
|
||||||
|
pad = 0x10 - (cmd.ptr & 0xF);
|
||||||
|
cmd.ptr += pad;
|
||||||
|
}
|
||||||
|
pushbuf.resize(pushbuf.size() + sz + pad);
|
||||||
|
if (pad) {
|
||||||
|
memset(pushbuf.data() + cmd.ptr - pad, 0, pad);
|
||||||
|
}
|
||||||
memcpy(pushbuf.data() + cmd.ptr, p, sz);
|
memcpy(pushbuf.data() + cmd.ptr, p, sz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -533,7 +541,6 @@ static void FreePSPPointer(u32 &p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool AllocatePSPBuf(u32 &pspPointer, u32 bufptr, u32 sz) {
|
static bool AllocatePSPBuf(u32 &pspPointer, u32 bufptr, u32 sz) {
|
||||||
// TODO: Smarter... but slabs don't work, because of alignment issues. Arg.
|
|
||||||
FreePSPPointer(pspPointer);
|
FreePSPPointer(pspPointer);
|
||||||
|
|
||||||
u32 allocSize = sz;
|
u32 allocSize = sz;
|
||||||
|
|
Loading…
Add table
Reference in a new issue