diff --git a/Common/GPU/Vulkan/VulkanProfiler.cpp b/Common/GPU/Vulkan/VulkanProfiler.cpp index fccea843b8..6e3a959f30 100644 --- a/Common/GPU/Vulkan/VulkanProfiler.cpp +++ b/Common/GPU/Vulkan/VulkanProfiler.cpp @@ -40,7 +40,7 @@ void VulkanProfiler::BeginFrame(VulkanContext *vulkan, VkCommandBuffer firstComm // Log it all out. for (auto &scope : scopes_) { if (scope.endQueryId == -1) { - WARN_LOG(G3D, "Unclosed scope: %s", scope.name.c_str()); + WARN_LOG(G3D, "Unclosed scope: %s", scope.name); continue; } uint64_t startTime = results[scope.startQueryId]; @@ -50,7 +50,7 @@ void VulkanProfiler::BeginFrame(VulkanContext *vulkan, VkCommandBuffer firstComm double milliseconds = (double)delta * timestampConversionFactor; - INFO_LOG(G3D, "%s%s (%0.3f ms)", indent[scope.level & 3], scope.name.c_str(), milliseconds); + INFO_LOG(G3D, "%s%s (%0.3f ms)", indent[scope.level & 3], scope.name, milliseconds); } scopes_.clear(); @@ -73,14 +73,11 @@ void VulkanProfiler::Begin(VkCommandBuffer cmdBuf, VkPipelineStageFlagBits stage return; } + ProfilerScope scope; va_list args; va_start(args, fmt); - char temp[512]; - vsnprintf(temp, sizeof(temp), fmt, args); + vsnprintf(scope.name, sizeof(scope.name), fmt, args); va_end(args); - - ProfilerScope scope; - scope.name = temp; scope.startQueryId = numQueries_; scope.endQueryId = -1; scope.level = (int)scopeStack_.size(); diff --git a/Common/GPU/Vulkan/VulkanProfiler.h b/Common/GPU/Vulkan/VulkanProfiler.h index d7b08d6738..e3d21c2021 100644 --- a/Common/GPU/Vulkan/VulkanProfiler.h +++ b/Common/GPU/Vulkan/VulkanProfiler.h @@ -13,7 +13,7 @@ // Put the whole thing in a FrameData to allow for overlap. struct ProfilerScope { - std::string name; + char name[52]; // to make a struct size of 64, just because int startQueryId; int endQueryId; int level;