Merge pull request #11500 from iwubcode/vulkan_copy_rectangle_one_layer

VideoBackends: update Vulkan's 'CopyRectangleFromTexture' to copy one layer
This commit is contained in:
Admiral H. Curtiss 2023-01-30 10:03:33 +01:00 committed by GitHub
commit ae712c61c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -265,10 +265,12 @@ void VKTexture::CopyRectangleFromTexture(const AbstractTexture* src,
static_cast<u32>(dst_rect.GetHeight()) <= m_config.height,
"Dest rect is too large for CopyRectangleFromTexture");
const u32 copy_layer_count = 1;
VkImageCopy image_copy = {
{VK_IMAGE_ASPECT_COLOR_BIT, src_level, src_layer, src_texture->GetLayers()},
{VK_IMAGE_ASPECT_COLOR_BIT, src_level, src_layer, copy_layer_count},
{src_rect.left, src_rect.top, 0},
{VK_IMAGE_ASPECT_COLOR_BIT, dst_level, dst_layer, m_config.layers},
{VK_IMAGE_ASPECT_COLOR_BIT, dst_level, dst_layer, copy_layer_count},
{dst_rect.left, dst_rect.top, 0},
{static_cast<uint32_t>(src_rect.GetWidth()), static_cast<uint32_t>(src_rect.GetHeight()), 1}};