vk: Crop malformed image descriptors

- Some image descriptors (lle vdec?) are malformed with pitch being smaller than width
- Crop these for now pending hardware tests
This commit is contained in:
kd-11 2019-09-08 16:21:06 +03:00 committed by kd-11
parent f53361b966
commit d1603fbb0b

View File

@ -563,7 +563,7 @@ namespace vk
auto& copy_info = copy_regions.back();
copy_info.bufferOffset = offset_in_buffer;
copy_info.imageExtent.height = layout.height_in_block * block_in_pixel;
copy_info.imageExtent.width = layout.width_in_block * block_in_pixel;
copy_info.imageExtent.width = std::min<u32>(layout.width_in_block, layout.pitch_in_block) * block_in_pixel;
copy_info.imageExtent.depth = layout.depth;
copy_info.imageSubresource.aspectMask = flags;
copy_info.imageSubresource.layerCount = 1;