venus: Drop vn_present_src_attachment::acquire

The field is redundant.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
This commit is contained in:
Chad Versace 2022-08-04 12:42:30 -07:00 committed by Marge Bot
parent 7cc3f046e0
commit b3619743c0
3 changed files with 12 additions and 12 deletions

View file

@ -304,17 +304,18 @@ static void
vn_present_src_attachment_to_image_memory_barrier(
const struct vn_image *img,
const struct vn_present_src_attachment *att,
VkImageMemoryBarrier *img_barrier)
VkImageMemoryBarrier *img_barrier,
bool acquire)
{
*img_barrier = (VkImageMemoryBarrier)
{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = att->src_access_mask,
.dstAccessMask = att->dst_access_mask,
.oldLayout = att->acquire ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
: VN_PRESENT_SRC_INTERNAL_LAYOUT,
.newLayout = att->acquire ? VN_PRESENT_SRC_INTERNAL_LAYOUT
: VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.oldLayout = acquire ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
: VN_PRESENT_SRC_INTERNAL_LAYOUT,
.newLayout = acquire ? VN_PRESENT_SRC_INTERNAL_LAYOUT
: VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.image = vn_image_to_handle((struct vn_image *)img),
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
@ -327,6 +328,7 @@ vn_present_src_attachment_to_image_memory_barrier(
static void
vn_cmd_transfer_present_src_images(
struct vn_command_buffer *cmd,
bool acquire,
const struct vn_image *const *images,
const struct vn_present_src_attachment *atts,
uint32_t count)
@ -344,8 +346,8 @@ vn_cmd_transfer_present_src_images(
src_stage_mask |= atts[i].src_stage_mask;
dst_stage_mask |= atts[i].dst_stage_mask;
vn_present_src_attachment_to_image_memory_barrier(images[i], &atts[i],
&img_barriers[i]);
vn_present_src_attachment_to_image_memory_barrier(
images[i], &atts[i], &img_barriers[i], acquire);
vn_cmd_fix_image_memory_barrier(cmd, &img_barriers[i],
&img_barriers[i]);
}
@ -400,7 +402,7 @@ vn_cmd_begin_render_pass(struct vn_command_buffer *cmd,
}
if (pass->present_acquire_count) {
vn_cmd_transfer_present_src_images(cmd, images,
vn_cmd_transfer_present_src_images(cmd, true, images,
pass->present_acquire_attachments,
pass->present_acquire_count);
}
@ -424,7 +426,8 @@ vn_cmd_end_render_pass(struct vn_command_buffer *cmd)
if (pass->present_release_count) {
vn_cmd_transfer_present_src_images(
cmd, images + pass->present_acquire_count,
cmd, false,
images + pass->present_acquire_count,
pass->present_release_attachments,
pass->present_release_count);
}

View file

@ -39,13 +39,11 @@
for (uint32_t i = 0; i < att_count; i++) { \
if (out_atts[i].initialLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) { \
out_atts[i].initialLayout = VN_PRESENT_SRC_INTERNAL_LAYOUT; \
_acquire_atts->acquire = true; \
_acquire_atts->index = i; \
_acquire_atts++; \
} \
if (out_atts[i].finalLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) { \
out_atts[i].finalLayout = VN_PRESENT_SRC_INTERNAL_LAYOUT; \
_release_atts->acquire = false; \
_release_atts->index = i; \
_release_atts++; \
} \

View file

@ -14,7 +14,6 @@
#include "vn_common.h"
struct vn_present_src_attachment {
bool acquire;
uint32_t index;
VkPipelineStageFlags src_stage_mask;