Skip to content

Commit

Permalink
Use appropriate row/image_height for planar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Jan 24, 2024
1 parent f2d5d2b commit 250d2b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vulkan/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2220,19 +2220,19 @@ void *CommandBuffer::update_image(const Image &image, const VkOffset3D &offset,
uint32_t height = image.get_height(subresource.mipLevel);
uint32_t depth = image.get_depth(subresource.mipLevel);

if (!row_length)
row_length = width;

if (!image_height)
image_height = height;

if ((subresource.aspectMask & (VK_IMAGE_ASPECT_PLANE_0_BIT |
VK_IMAGE_ASPECT_PLANE_1_BIT |
VK_IMAGE_ASPECT_PLANE_2_BIT)) != 0)
{
format_ycbcr_downsample_dimensions(create_info.format, subresource.aspectMask, row_length, image_height);
format_ycbcr_downsample_dimensions(create_info.format, subresource.aspectMask, width, height);
}

if (!row_length)
row_length = width;

if (!image_height)
image_height = height;

uint32_t blocks_x = row_length;
uint32_t blocks_y = image_height;
format_num_blocks(create_info.format, blocks_x, blocks_y);
Expand Down

0 comments on commit 250d2b2

Please sign in to comment.