aux/vk: Use correct aspect for image barrier

This commit is contained in:
Jakob Bornecrantz 2022-04-08 12:58:10 +01:00 committed by Jakob Bornecrantz
parent 0d152381a8
commit 6e13a0a21b

View file

@ -125,7 +125,7 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
// This is the format for the image view, it's not adjusted. // This is the format for the image view, it's not adjusted.
VkFormat image_view_format = (VkFormat)info->format; VkFormat image_view_format = (VkFormat)info->format;
VkImageAspectFlagBits aspect = vk_csci_get_image_view_aspect(image_view_format, info->bits); VkImageAspectFlagBits image_view_aspect = vk_csci_get_image_view_aspect(image_view_format, info->bits);
for (uint32_t i = 0; i < image_count; i++) { for (uint32_t i = 0; i < image_count; i++) {
@ -140,7 +140,7 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
for (uint32_t layer = 0; layer < info->array_size; ++layer) { for (uint32_t layer = 0; layer < info->array_size; ++layer) {
VkImageSubresourceRange subresource_range = { VkImageSubresourceRange subresource_range = {
.aspectMask = aspect, .aspectMask = image_view_aspect,
.baseMipLevel = 0, .baseMipLevel = 0,
.levelCount = 1, .levelCount = 1,
.baseArrayLayer = layer, .baseArrayLayer = layer,
@ -178,8 +178,10 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
vk_init_cmd_buffer(vk, &cmd_buffer); vk_init_cmd_buffer(vk, &cmd_buffer);
VkImageAspectFlagBits image_barrier_aspect = vk_csci_get_barrier_aspect_mask(image_view_format);
VkImageSubresourceRange subresource_range = { VkImageSubresourceRange subresource_range = {
.aspectMask = aspect, .aspectMask = image_barrier_aspect,
.baseMipLevel = 0, .baseMipLevel = 0,
.levelCount = 1, .levelCount = 1,
.baseArrayLayer = 0, .baseArrayLayer = 0,