From 5fe20fda741ac1f85418466e4c48de5ab3744726 Mon Sep 17 00:00:00 2001 From: jirongjiao Date: Thu, 29 Aug 2024 17:04:53 -0400 Subject: [PATCH] modify copy resource message --- framework/graphics/dx12_resource_data_util.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/framework/graphics/dx12_resource_data_util.cpp b/framework/graphics/dx12_resource_data_util.cpp index fd21376169..e9b3f17526 100644 --- a/framework/graphics/dx12_resource_data_util.cpp +++ b/framework/graphics/dx12_resource_data_util.cpp @@ -513,16 +513,25 @@ HRESULT Dx12ResourceDataUtil::WriteToResource(ID3D12Resource* GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, subresource_sizes[i]); size_t subresource_size = static_cast(std::min(subresource_sizes[i], layout_sizes[i])); - if (layout_sizes[i] != subresource_sizes[i]) + if (layout_sizes[i] > subresource_sizes[i]) { - GFXRECON_LOG_ERROR("The size of the data to be copied to the subresource does not match the size " + GFXRECON_LOG_DEBUG("The size of the data to be copied to the subresource does not match the size " "required by the subresource's copyable footprint (data size = %" PRIu64 ", footprint size = %" PRIu64 ", subresouce index = %" PRIu32 ").", subresource_sizes[i], layout_sizes[i], i); } + else if (layout_sizes[i] < subresource_sizes[i]) + { + GFXRECON_LOG_ERROR("The size of the data to be copied to the subresource is greater than the size of the subresource's copyable footprint." + "Not all data can be written to the subresource. (data size = %" PRIu64 + ", footprint size = %" PRIu64 ", subresouce index = %" PRIu32 ").", + subresource_sizes[i], + layout_sizes[i], + i); + } size_t layout_offset = static_cast(layout_offsets[i]); size_t layout_size = static_cast(layout_sizes[i]); util::platform::MemoryCopy(