From 63576aec35c2af4331969aa5352d62796bd4c7a9 Mon Sep 17 00:00:00 2001 From: DrChat Date: Wed, 9 Aug 2017 22:26:56 -0500 Subject: [PATCH] Vulkan: Add debug code to flag empty texture uploads in the log --- src/xenia/gpu/vulkan/texture_cache.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/xenia/gpu/vulkan/texture_cache.cc b/src/xenia/gpu/vulkan/texture_cache.cc index 3f699a708..3190fe38d 100644 --- a/src/xenia/gpu/vulkan/texture_cache.cc +++ b/src/xenia/gpu/vulkan/texture_cache.cc @@ -1149,6 +1149,23 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer, auto alloc = staging_buffer_.Acquire(unpack_length, completion_fence); assert_not_null(alloc); + // DEBUG: Check the source address. If it's completely zero'd out, print it. + bool valid = false; + auto src_data = memory_->TranslatePhysical(src.guest_address); + for (uint32_t i = 0; i < src.input_length; i++) { + if (src_data[i] != 0) { + valid = true; + break; + } + } + + if (!valid) { + XELOGW( + "Warning: Uploading blank texture at address 0x%.8X " + "(length: 0x%.8X, format: %d)", + src.guest_address, src.input_length, src.texture_format); + } + // Upload texture into GPU memory. // TODO: If the GPU supports it, we can submit a compute batch to convert the // texture and copy it to its destination. Otherwise, fallback to conversion