tu: Remove usage of RenderPassBeginInfo

More preparation for using this with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
This commit is contained in:
Connor Abbott 2022-06-24 16:39:53 +02:00 committed by Marge Bot
parent cf391db4c6
commit 22be08a21e
4 changed files with 20 additions and 20 deletions

View File

@ -2836,7 +2836,7 @@ clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
struct tu_cs *cs,
VkFormat vk_format,
VkImageAspectFlags clear_mask,
const VkRenderPassBeginInfo *info,
const VkClearValue *value,
uint32_t a,
bool separate_ds)
{
@ -2852,8 +2852,9 @@ clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
ops->setup(cmd, cs, format, format, clear_mask, 0, true, iview->view.ubwc_enabled,
cmd->state.pass->attachments[a].samples);
ops->coords(cs, &info->renderArea.offset, NULL, &info->renderArea.extent);
ops->clear_value(cs, format, &info->pClearValues[a]);
ops->coords(cs, &cmd->state.render_area.offset, NULL,
&cmd->state.render_area.extent);
ops->clear_value(cs, format, value);
for_each_layer(i, clear_views, fb->layers) {
if (separate_ds) {
@ -2879,7 +2880,7 @@ void
tu_clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
struct tu_cs *cs,
uint32_t a,
const VkRenderPassBeginInfo *info)
const VkClearValue *value)
{
const struct tu_render_pass_attachment *attachment =
&cmd->state.pass->attachments[a];
@ -2890,15 +2891,15 @@ tu_clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
if (attachment->format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
if (attachment->clear_mask & VK_IMAGE_ASPECT_DEPTH_BIT) {
clear_sysmem_attachment(cmd, cs, VK_FORMAT_D32_SFLOAT, VK_IMAGE_ASPECT_COLOR_BIT,
info, a, true);
value, a, true);
}
if (attachment->clear_mask & VK_IMAGE_ASPECT_STENCIL_BIT) {
clear_sysmem_attachment(cmd, cs, VK_FORMAT_S8_UINT, VK_IMAGE_ASPECT_COLOR_BIT,
info, a, true);
value, a, true);
}
} else {
clear_sysmem_attachment(cmd, cs, attachment->format, attachment->clear_mask,
info, a, false);
value, a, false);
}
/* The spec doesn't explicitly say, but presumably the initial renderpass
@ -2926,7 +2927,7 @@ void
tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
struct tu_cs *cs,
uint32_t a,
const VkRenderPassBeginInfo *info)
const VkClearValue *value)
{
const struct tu_render_pass_attachment *attachment =
&cmd->state.pass->attachments[a];
@ -2936,8 +2937,7 @@ tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
tu_cs_emit_regs(cs, A6XX_RB_MSAA_CNTL(tu_msaa_samples(attachment->samples)));
tu_emit_clear_gmem_attachment(cmd, cs, a, attachment->clear_mask,
&info->pClearValues[a]);
tu_emit_clear_gmem_attachment(cmd, cs, a, attachment->clear_mask, value);
}
static void

View File

@ -1235,7 +1235,7 @@ tu_set_input_attachments(struct tu_cmd_buffer *cmd, const struct tu_subpass *sub
static void
tu_emit_renderpass_begin(struct tu_cmd_buffer *cmd,
const VkRenderPassBeginInfo *info)
const VkClearValue *clear_values)
{
struct tu_cs *cs = &cmd->draw_cs;
@ -1246,14 +1246,14 @@ tu_emit_renderpass_begin(struct tu_cmd_buffer *cmd,
tu6_emit_blit_scissor(cmd, cs, false);
for (uint32_t i = 0; i < cmd->state.pass->attachment_count; ++i)
tu_clear_gmem_attachment(cmd, cs, i, info);
tu_clear_gmem_attachment(cmd, cs, i, &clear_values[i]);
tu_cond_exec_end(cs);
tu_cond_exec_start(cs, CP_COND_EXEC_0_RENDER_MODE_SYSMEM);
for (uint32_t i = 0; i < cmd->state.pass->attachment_count; ++i)
tu_clear_sysmem_attachment(cmd, cs, i, info);
tu_clear_sysmem_attachment(cmd, cs, i, &clear_values[i]);
tu_cond_exec_end(cs);
}
@ -3582,11 +3582,11 @@ tu_CmdBeginRenderPass2(VkCommandBuffer commandBuffer,
if (pass->subpasses[0].feedback_invalidate)
cmd->state.renderpass_cache.flush_bits |= TU_CMD_FLAG_CACHE_INVALIDATE;
tu_lrz_begin_renderpass(cmd, pRenderPassBegin);
tu_lrz_begin_renderpass(cmd, pRenderPassBegin->pClearValues);
cmd->trace_renderpass_start = u_trace_end_iterator(&cmd->trace);
tu_emit_renderpass_begin(cmd, pRenderPassBegin);
tu_emit_renderpass_begin(cmd, pRenderPassBegin->pClearValues);
tu_emit_subpass_begin(cmd);
}

View File

@ -277,7 +277,7 @@ tu_lrz_init_secondary(struct tu_cmd_buffer *cmd,
void
tu_lrz_begin_renderpass(struct tu_cmd_buffer *cmd,
const VkRenderPassBeginInfo *pRenderPassBegin)
const VkClearValue *clear_values)
{
const struct tu_render_pass *pass = cmd->state.pass;
@ -310,7 +310,7 @@ tu_lrz_begin_renderpass(struct tu_cmd_buffer *cmd,
const struct tu_render_pass_attachment *att = &cmd->state.pass->attachments[a];
tu_lrz_init_state(cmd, att, cmd->state.attachments[a]);
if (att->clear_mask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT)) {
VkClearValue clear = pRenderPassBegin->pClearValues[a];
VkClearValue clear = clear_values[a];
cmd->state.lrz.depth_clear_value = clear;
cmd->state.lrz.fast_clear = cmd->state.lrz.fast_clear &&
(clear.depthStencil.depth == 0.f ||

View File

@ -1725,7 +1725,7 @@ tu_lrz_clear_depth_image(struct tu_cmd_buffer *cmd,
void
tu_lrz_begin_renderpass(struct tu_cmd_buffer *cmd,
const VkRenderPassBeginInfo *pRenderPassBegin);
const VkClearValue *clear_values);
void
tu_lrz_begin_secondary_cmdbuf(struct tu_cmd_buffer *cmd);
@ -1821,13 +1821,13 @@ void
tu_clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
struct tu_cs *cs,
uint32_t a,
const VkRenderPassBeginInfo *info);
const VkClearValue *value);
void
tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
struct tu_cs *cs,
uint32_t a,
const VkRenderPassBeginInfo *info);
const VkClearValue *value);
void
tu_load_gmem_attachment(struct tu_cmd_buffer *cmd,