Remove std::string from VulkanTexture

This commit is contained in:
Henrik Rydgård committed 2022-12-01 12:17:03 +01:00
1 parent c05ec8b520
commit 40ae99073b
4 files changed
+19 -23

No files matched your search

+4 -5
View File
@@ -482,7 +482,10 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
VkCommandBuffer cmdInit = (VkCommandBuffer)draw_->GetNativeObject(Draw::NativeObject::INIT_COMMANDBUFFER);
delete entry->vkTex;
entry->vkTex = new VulkanTexture(vulkan);
char texName[64]{};
snprintf(texName, sizeof(texName), "tex_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat()));
entry->vkTex = new VulkanTexture(vulkan, texName);
VulkanTexture *image = entry->vkTex;
const VkComponentMapping *mapping;
@@ -513,10 +516,6 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
actualFmt = VULKAN_8888_FORMAT;
}
char texName[128]{};
snprintf(texName, sizeof(texName), "tex_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat()));
image->SetTag(texName);
bool allocSuccess = image->CreateDirect(cmdInit, plan.createW, plan.createH, plan.depth, plan.levelsToCreate, actualFmt, imageLayout, usage, mapping);
if (!allocSuccess && !lowMemoryMode_) {
WARN_LOG_REPORT(G3D, "Texture cache ran out of GPU memory; switching to low memory mode");