Log improvements

This commit is contained in:
Henrik Rydgård committed 2026-07-15 12:03:05 +02:00
1 parent c1ceea1405
commit 26313b6314
3 files changed
+9 -7

No files matched your search

+6 -6
View File
@@ -40,12 +40,12 @@ static bool IsDepthStencilFormat(VkFormat format) {
bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat format, VkImageLayout initialLayout, VkImageUsageFlags usage, VulkanBarrierBatch *barrierBatch, const VkComponentMapping *mapping) {
if (w == 0 || h == 0 || numMips == 0) {
ERROR_LOG(Log::G3D, "Can't create a zero-size VulkanTexture");
ERROR_LOG(Log::G3D, "Can't create a zero-size VulkanTexture (tag: '%s')", tag_);
return false;
}
int maxDim = vulkan_->GetPhysicalDeviceProperties(0).properties.limits.maxImageDimension2D;
int maxDim = vulkan_->GetPhysicalDeviceProperties().properties.limits.maxImageDimension2D;
if (w > maxDim || h > maxDim) {
ERROR_LOG(Log::G3D, "Can't create a texture this large");
ERROR_LOG(Log::G3D, "Can't create a texture with format %s this large (%d > %d or %d > %d) (tag: '%s')", VulkanFormatToString(format), w, maxDim, h, maxDim, tag_);
return false;
}
@@ -87,7 +87,7 @@ bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat
VmaAllocationInfo allocInfo{};
VkResult res = vmaCreateImage(vulkan_->Allocator(), &image_create_info, &allocCreateInfo, &image_, &allocation_, &allocInfo);
if (res != VK_SUCCESS) {
ERROR_LOG(Log::G3D, "vmaCreateImage failed: %s. Destroying image.", VulkanResultToString(res));
ERROR_LOG(Log::G3D, "vmaCreateImage failed: %s. Destroying image (tag: '%s')", VulkanResultToString(res), tag_);
_dbg_assert_msg_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS, "%d", (int)res);
view_ = VK_NULL_HANDLE;
image_ = VK_NULL_HANDLE;
@@ -145,7 +145,7 @@ bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat
res = vkCreateImageView(vulkan_->GetDevice(), &view_info, NULL, &view_);
if (res != VK_SUCCESS) {
ERROR_LOG(Log::G3D, "vkCreateImageView failed: %s. Destroying image.", VulkanResultToString(res));
ERROR_LOG(Log::G3D, "vkCreateImageView failed: %s. Destroying image (tag: '%s')", VulkanResultToString(res), tag_);
_assert_msg_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS, "%d", (int)res);
vmaDestroyImage(vulkan_->Allocator(), image_, allocation_);
view_ = VK_NULL_HANDLE;
@@ -160,7 +160,7 @@ bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat
view_info.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
res = vkCreateImageView(vulkan_->GetDevice(), &view_info, NULL, &arrayView_);
// Assume that if the above view creation succeeded, so will this.
_assert_msg_(res == VK_SUCCESS, "View creation failed: %d", (int)res);
_assert_msg_(res == VK_SUCCESS, "View creation failed: %d (tag: '%s')", (int)res, tag_);
vulkan_->SetDebugName(arrayView_, VK_OBJECT_TYPE_IMAGE_VIEW, tag_);
}
+1 -1
View File
@@ -836,7 +836,7 @@ bool VKTexture::Create(VkCommandBuffer cmd, VulkanBarrierBatch *postBarriers, Vu
}
VulkanBarrierBatch barrier;
if (!vkTex_->CreateDirect(width_, height_, 1, mipLevels_, vulkanFormat, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, usageBits, &barrier, swizzle)) {
ERROR_LOG(Log::G3D, "Failed to create VulkanTexture: %dx%dx%d fmt %d, %d levels", width_, height_, depth_, (int)vulkanFormat, mipLevels_);
ERROR_LOG(Log::G3D, "Failed to create VKTexture: %dx%dx%d fmt %s, %d levels, tag '%s'", width_, height_, depth_, VulkanFormatToString(vulkanFormat), mipLevels_, desc.tag);
return false;
}
barrier.Flush(cmd);
+2
View File
@@ -826,6 +826,8 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init
}
}
EARLY_LOG("Calling NativeInit with user_data_path %s, externalStorageDir %s, cacheDir %s", user_data_path.c_str(), externalStorageDir.c_str(), cacheDir.c_str());
// TODO: We should be able to do the Vulkan init in parallel with NativeInit.
NativeInit((int)args.size(), &args[0], user_data_path.c_str(), externalStorageDir.c_str(), cacheDir.c_str());