tu: Emit GRAS_LRZ_MRT_BUF_INFO_0

The blob seems to always emit this, even though it seems to only be used
when rendering to the special planar formats (which we only do in the
blit path). Based on the LRZ prefix it might used in other cases though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6792>
This commit is contained in:
Connor Abbott 2021-10-19 17:52:22 +02:00 committed by Marge Bot
parent c135c2cdb7
commit 9c895e133b
2 changed files with 14 additions and 0 deletions

View File

@ -939,6 +939,11 @@ r3d_dst(struct tu_cs *cs, const struct fdl6_view *iview, uint32_t layer)
tu_cs_emit_pkt4(cs, REG_A6XX_RB_MRT_FLAG_BUFFER(0), 3);
tu_cs_image_flag_ref(cs, iview, layer);
/* Use color format from RB_MRT_BUF_INFO. This register is relevant for
* FMT6_NV12_Y.
*/
tu_cs_emit_regs(cs, A6XX_GRAS_LRZ_MRT_BUF_INFO_0(.color_format = iview->RB_MRT_BUF_INFO & 0xff));
tu_cs_emit_regs(cs, A6XX_RB_RENDER_CNTL(.flag_mrts = iview->ubwc_enabled));
}

View File

@ -274,6 +274,15 @@ tu6_emit_mrt(struct tu_cmd_buffer *cmd,
tu_cs_image_flag_ref(cs, &iview->view, 0);
}
if (subpass->color_count) {
uint32_t a = subpass->color_attachments[0].attachment;
if (a != VK_ATTACHMENT_UNUSED) {
const struct tu_image_view *iview = cmd->state.attachments[a];
enum a6xx_format fmt = iview->view.RB_MRT_BUF_INFO & 0xff;
tu_cs_emit_regs(cs, A6XX_GRAS_LRZ_MRT_BUF_INFO_0(.color_format = fmt));
}
}
tu_cs_emit_regs(cs,
A6XX_RB_SRGB_CNTL(.dword = subpass->srgb_cntl));
tu_cs_emit_regs(cs,