mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Further std::string removal
This commit is contained in:
parent
0780976fe7
commit
4e1bc2b3e0
@ -48,15 +48,15 @@ struct MemBlockInfo {
|
||||
|
||||
void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char *str, size_t strLength);
|
||||
|
||||
// This lets us avoid calling strlen on string constants, instead the string length (including null)
|
||||
// is computed at compile time.
|
||||
// This lets us avoid calling strlen on string constants, instead the string length (including null,
|
||||
// so we have to subtract 1) is computed at compile time.
|
||||
template<size_t count>
|
||||
inline void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char(&str)[count]) {
|
||||
NotifyMemInfo(flags, start, size, str, count);
|
||||
NotifyMemInfo(flags, start, size, str, count - 1);
|
||||
}
|
||||
|
||||
inline void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const std::string &str) {
|
||||
NotifyMemInfo(flags, start, size, str.c_str(), str.size() + 1);
|
||||
inline void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char *str) {
|
||||
NotifyMemInfo(flags, start, size, str, strlen(str));
|
||||
}
|
||||
|
||||
std::vector<MemBlockInfo> FindMemInfo(uint32_t start, uint32_t size);
|
||||
|
@ -1294,14 +1294,16 @@ void FramebufferManagerCommon::ResizeFramebufFBO(VirtualFramebuffer *vfb, int w,
|
||||
}
|
||||
|
||||
shaderManager_->DirtyLastShader();
|
||||
char tag[256];
|
||||
snprintf(tag, sizeof(tag), "FB_%08x_%08x_%dx%d_%s", vfb->fb_address, vfb->z_address, w, h, GeBufferFormatToString(vfb->format));
|
||||
char tag[128];
|
||||
size_t len = snprintf(tag, sizeof(tag), "FB_%08x_%08x_%dx%d_%s", vfb->fb_address, vfb->z_address, w, h, GeBufferFormatToString(vfb->format));
|
||||
vfb->fbo = draw_->CreateFramebuffer({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, tag });
|
||||
if (Memory::IsVRAMAddress(vfb->fb_address) && vfb->fb_stride != 0) {
|
||||
NotifyMemInfo(MemBlockFlags::ALLOC, vfb->fb_address, ColorBufferByteSize(vfb), tag);
|
||||
NotifyMemInfo(MemBlockFlags::ALLOC, vfb->fb_address, ColorBufferByteSize(vfb), tag, len);
|
||||
}
|
||||
if (Memory::IsVRAMAddress(vfb->z_address) && vfb->z_stride != 0) {
|
||||
NotifyMemInfo(MemBlockFlags::ALLOC, vfb->z_address, vfb->fb_stride * vfb->height * sizeof(uint16_t), std::string("Z_") + tag);
|
||||
char buf[128];
|
||||
size_t len = snprintf(buf, sizeof(buf), "Z_%s", tag);
|
||||
NotifyMemInfo(MemBlockFlags::ALLOC, vfb->z_address, vfb->fb_stride * vfb->height * sizeof(uint16_t), buf, len);
|
||||
}
|
||||
if (old.fbo) {
|
||||
INFO_LOG(FRAMEBUF, "Resizing FBO for %08x : %dx%dx%s", vfb->fb_address, w, h, GeBufferFormatToString(vfb->format));
|
||||
|
@ -1323,7 +1323,9 @@ void TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, GETextureForm
|
||||
const u8 *texptr = Memory::GetPointer(texaddr);
|
||||
const uint32_t byteSize = (textureBitsPerPixel[format] * bufw * h) / 8;
|
||||
|
||||
NotifyMemInfo(MemBlockFlags::TEXTURE, texaddr, byteSize, StringFromFormat("Texture_%08x_%dx%d_%s", texaddr, w, h, GeTextureFormatToString(format, clutformat)));
|
||||
char buf[128];
|
||||
size_t len = snprintf(buf, sizeof(buf), "Tex_%08x_%dx%d_%s", texaddr, w, h, GeTextureFormatToString(format, clutformat));
|
||||
NotifyMemInfo(MemBlockFlags::TEXTURE, texaddr, byteSize, buf, len);
|
||||
|
||||
switch (format) {
|
||||
case GE_TFMT_CLUT4:
|
||||
|
@ -862,7 +862,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
|
||||
}
|
||||
|
||||
char texName[128]{};
|
||||
snprintf(texName, sizeof(texName), "texture_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat()));
|
||||
snprintf(texName, sizeof(texName), "tex_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat()));
|
||||
image->SetTag(texName);
|
||||
|
||||
bool allocSuccess = image->CreateDirect(cmdInit, allocator_, w * scaleFactor, h * scaleFactor, maxLevelToGenerate + 1, actualFmt, imageLayout, usage, mapping);
|
||||
|
Loading…
Reference in New Issue
Block a user