Skip to content

Commit

Permalink
modify copy resource message
Browse files Browse the repository at this point in the history
  • Loading branch information
jirongjiao authored and jirongjiao committed Aug 29, 2024
1 parent 24fca72 commit 5fe20fd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions framework/graphics/dx12_resource_data_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,25 @@ HRESULT Dx12ResourceDataUtil::WriteToResource(ID3D12Resource*
GFXRECON_CHECK_CONVERSION_DATA_LOSS(size_t, subresource_sizes[i]);
size_t subresource_size = static_cast<size_t>(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<size_t>(layout_offsets[i]);
size_t layout_size = static_cast<size_t>(layout_sizes[i]);
util::platform::MemoryCopy(
Expand Down

0 comments on commit 5fe20fd

Please sign in to comment.