v3dv: fix blit_shader() to honor the region's aspect mask

When translating combined depth/stencil blits to compatible color blits we
should look at the requested region aspects to decide the color
mask to apply.

Fixes:
dEQP-VK.api.copy_and_blit.*.buffer_to_depthstencil.buffer_offset_d24_unorm_s8_uint_D
dEQP-VK.api.copy_and_blit.*.buffer_to_depthstencil.buffer_offset_d24_unorm_s8_uint_SD
dEQP-VK.api.copy_and_blit.*.buffer_to_depthstencil.buffer_offset_d24_unorm_s8_uint_S_D

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Iago Toral Quiroga 2020-07-01 11:05:28 +02:00 committed by Marge Bot
parent bf20a5e7b7
commit 0385da9e08
1 changed files with 2 additions and 2 deletions

View File

@ -3566,12 +3566,12 @@ blit_shader(struct v3dv_cmd_buffer *cmd_buffer,
break;
case VK_FORMAT_X8_D24_UNORM_PACK32:
case VK_FORMAT_D24_UNORM_S8_UINT:
if (dst->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
if (region.srcSubresource.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) {
cmask |= VK_COLOR_COMPONENT_G_BIT |
VK_COLOR_COMPONENT_B_BIT |
VK_COLOR_COMPONENT_A_BIT;
}
if (dst->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
if (region.srcSubresource.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) {
assert(dst_format == VK_FORMAT_D24_UNORM_S8_UINT);
cmask |= VK_COLOR_COMPONENT_R_BIT;
}