mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 07:00:12 +01:00
dzn: Support native image copies when formats are compatible
CopyTextureRegion() works fine if the formats belong to the same group (matching the same _TYPELESS type), so let's avoid creating a temporary resource in that case. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17368>
This commit is contained in:
parent
53a352e1cf
commit
d132ec924d
1 changed files with 18 additions and 3 deletions
|
|
@ -3013,9 +3013,24 @@ dzn_CmdCopyImage2(VkCommandBuffer commandBuffer,
|
||||||
|
|
||||||
assert(src->vk.samples == dst->vk.samples);
|
assert(src->vk.samples == dst->vk.samples);
|
||||||
|
|
||||||
bool requires_temp_res = src->vk.format != dst->vk.format &&
|
bool requires_temp_res = false;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < info->regionCount; i++) {
|
||||||
|
const VkImageCopy2 *region = &info->pRegions[i];
|
||||||
|
|
||||||
|
dzn_foreach_aspect(aspect, region->srcSubresource.aspectMask) {
|
||||||
|
assert(aspect & region->dstSubresource.aspectMask);
|
||||||
|
|
||||||
|
if (!dzn_image_formats_are_compatible(device, src->vk.format, dst->vk.format,
|
||||||
|
VK_IMAGE_USAGE_TRANSFER_SRC_BIT, aspect) &&
|
||||||
src->vk.tiling != VK_IMAGE_TILING_LINEAR &&
|
src->vk.tiling != VK_IMAGE_TILING_LINEAR &&
|
||||||
dst->vk.tiling != VK_IMAGE_TILING_LINEAR;
|
dst->vk.tiling != VK_IMAGE_TILING_LINEAR) {
|
||||||
|
requires_temp_res = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool use_blit = false;
|
bool use_blit = false;
|
||||||
if (src->vk.samples > 1) {
|
if (src->vk.samples > 1) {
|
||||||
use_blit = requires_temp_res;
|
use_blit = requires_temp_res;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue