tu: Clear RB_MRT_BUF_INFO::LOSSLESSCOMPEN for stencil

This was already present in the 2d paths but not in the 3d path,
probably because the flag was moved there only on a7xx and it was
missed. Prevents page faults from bad flag buffer accesses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
This commit is contained in:
Connor Abbott 2025-10-15 23:21:48 -04:00 committed by Marge Bot
parent 2231c51474
commit bc14dd98e3

View file

@ -1401,12 +1401,19 @@ r3d_dst_depth(struct tu_cs *cs, const struct tu_image_view *iview, uint32_t laye
tu_cs_emit_regs(cs, A7XX_GRAS_SU_RENDER_CNTL());
}
static uint32_t
tu_rb_mrt_buf_info_stencil(const struct tu_image_view *iview)
{
return tu_image_view_stencil(iview, RB_MRT_BUF_INFO) &
~A7XX_RB_MRT_BUF_INFO_LOSSLESSCOMPEN;
}
template <chip CHIP>
static void
r3d_dst_stencil(struct tu_cs *cs, const struct tu_image_view *iview, uint32_t layer)
{
tu_cs_emit_regs(cs,
RB_MRT_BUF_INFO(CHIP, 0, .dword = tu_image_view_stencil(iview, RB_MRT_BUF_INFO)),
RB_MRT_BUF_INFO(CHIP, 0, .dword = tu_rb_mrt_buf_info_stencil(iview)),
A6XX_RB_MRT_PITCH(0, iview->stencil_pitch),
A6XX_RB_MRT_ARRAY_PITCH(0, iview->stencil_layer_size),
A6XX_RB_MRT_BASE(0, .qword = iview->stencil_base_addr + iview->stencil_layer_size * layer),
@ -1453,7 +1460,7 @@ r3d_dst_gmem(struct tu_cmd_buffer *cmd, struct tu_cs *cs,
RB_MRT_BUF_INFO = tu_image_view_depth(iview, RB_MRT_BUF_INFO);
gmem_offset = tu_attachment_gmem_offset(cmd, att, layer);
} else {
RB_MRT_BUF_INFO = tu_image_view_stencil(iview, RB_MRT_BUF_INFO);
RB_MRT_BUF_INFO = tu_rb_mrt_buf_info_stencil(iview);
gmem_offset = tu_attachment_gmem_offset_stencil(cmd, att, layer);
}
} else {