tu: Rename tu_render_pass_attachment::clear_views to used_views

It's not just used for clears, it was already used for loads and it
needs to be used for stores too so clear_views was a confusing name.

Cc: mesa-stable
(cherry picked from commit 6c3ed74ed2)

Conflicts:
	src/freedreno/vulkan/tu_pass.cc
	src/freedreno/vulkan/tu_pass.h

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
This commit is contained in:
Connor Abbott 2025-10-24 18:23:19 -04:00 committed by Dylan Baker
parent 9696921018
commit ef9457d119
4 changed files with 22 additions and 10 deletions

View file

@ -3084,7 +3084,7 @@
"description": "tu: Rename tu_render_pass_attachment::clear_views to used_views",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -4648,7 +4648,7 @@ clear_sysmem_attachment(struct tu_cmd_buffer *cmd,
enum pipe_format format = vk_format_to_pipe_format(vk_format);
const struct tu_framebuffer *fb = cmd->state.framebuffer;
const struct tu_image_view *iview = cmd->state.attachments[a];
const uint32_t clear_views = cmd->state.pass->attachments[a].clear_views;
const uint32_t clear_views = cmd->state.pass->attachments[a].used_views;
const struct blit_ops *ops = &r2d_ops<CHIP>;
const VkClearValue *value = &cmd->state.clear_values[a];
if (cmd->state.pass->attachments[a].samples > 1)
@ -4744,7 +4744,7 @@ tu_clear_gmem_attachment(struct tu_cmd_buffer *cmd,
tu_emit_clear_gmem_attachment<CHIP>(cmd, cs, resolve_group, a, 0,
cmd->state.framebuffer->layers,
attachment->clear_views,
attachment->used_views,
attachment->clear_mask,
&cmd->state.clear_values[a], NULL);
}
@ -4765,7 +4765,7 @@ tu7_generic_clear_attachment(struct tu_cmd_buffer *cmd,
iview->view.ubwc_enabled, att->samples);
enum pipe_format format = vk_format_to_pipe_format(att->format);
for_each_layer(i, att->clear_views, cmd->state.framebuffer->layers) {
for_each_layer(i, att->used_views, cmd->state.framebuffer->layers) {
uint32_t layer = i + 0;
uint32_t mask =
aspect_write_mask_generic_clear(format, att->clear_mask);
@ -4846,7 +4846,7 @@ tu_emit_blit(struct tu_cmd_buffer *cmd,
uint32_t buffer_id = tu_resolve_group_include_buffer<CHIP>(resolve_group, format);
event_blit_setup(cs, buffer_id, attachment, blit_event_type, clear_mask);
for_each_layer(i, attachment->clear_views, cmd->state.framebuffer->layers) {
for_each_layer(i, attachment->used_views, cmd->state.framebuffer->layers) {
event_blit_dst_view blt_view = blt_view_from_tu_view(iview, i);
event_blit_run<CHIP>(cmd, cs, attachment, &blt_view, separate_stencil);
}
@ -4961,7 +4961,7 @@ load_3d_blit(struct tu_cmd_buffer *cmd,
/* Wait for CACHE_INVALIDATE to land */
tu_cs_emit_wfi(cs);
for_each_layer(i, att->clear_views, cmd->state.framebuffer->layers) {
for_each_layer(i, att->used_views, cmd->state.framebuffer->layers) {
if (cmd->state.pass->has_fdm) {
struct apply_load_coords_state state = {
.view = i,

View file

@ -885,7 +885,7 @@ tu_subpass_use_attachment(struct tu_render_pass *pass, int i, uint32_t a, const
att->gmem = true;
update_samples(subpass, pCreateInfo->pAttachments[a].samples);
att->clear_views |= subpass->multiview_mask;
att->used_views |= subpass->multiview_mask;
/* Loads and clears are emitted at the start of the subpass that needs them. */
att->first_subpass_idx = MIN2(i, att->first_subpass_idx);
@ -1237,7 +1237,7 @@ tu_setup_dynamic_render_pass(struct tu_cmd_buffer *cmd_buffer,
VK_FROM_HANDLE(tu_image_view, view, att_info->imageView);
tu_setup_dynamic_attachment(att, view);
att->gmem = true;
att->clear_views = info->viewMask;
att->used_views = info->viewMask;
attachment_set_ops(device, att, att_info->loadOp,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, att_info->storeOp,
VK_ATTACHMENT_STORE_OP_DONT_CARE);
@ -1281,7 +1281,7 @@ tu_setup_dynamic_render_pass(struct tu_cmd_buffer *cmd_buffer,
struct tu_render_pass_attachment *att = &pass->attachments[a];
tu_setup_dynamic_attachment(att, view);
att->gmem = true;
att->clear_views = info->viewMask;
att->used_views = info->viewMask;
subpass->depth_stencil_attachment.attachment = a++;
subpass->input_attachments[0].attachment =
subpass->depth_stencil_attachment.attachment;

View file

@ -94,7 +94,19 @@ struct tu_render_pass_attachment
VkSampleCountFlagBits samples;
uint32_t cpp;
VkImageAspectFlags clear_mask;
uint32_t clear_views;
/* All views that are used with the attachment in all subpasses. Used to
* determine which views to apply loadOp/storeOp to.
*/
uint32_t used_views;
/* The internal MSRTSS attachment to clear when the user says to clear
* this attachment. Clear values must be remapped to this attachment.
*/
uint32_t remapped_clear_att;
/* For internal attachments created for MSRTSS, the original user attachment
* which it is resolved/unresolved to.
*/
uint32_t user_att;
bool load;
bool store;
bool gmem;