radv: fix hw remapping of MRT holes with color attachments without export
If a color attachment is used in a render pass but not exported by the
FS, cb_shader_mask would be non-zero for this MRT. Though, to make sure
the hw remapping of SPI_SHADER_COL_FORMAT<->CB_SHADER_MASK works as
expected, we should also clear the unused color attachment in
CB_SHADER_MASK. Otherwise, the hw will remap to the wrong MRT.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7221
Fixes: 8fcb4aa0eb ("radv: compact MRTs to save PS export memory space")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18491>
This commit is contained in:
committed by
Marge Bot
parent
f8209ddc5b
commit
c26e0e5070
@@ -6096,6 +6096,13 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv
|
||||
blend.spi_shader_col_format = V_028714_SPI_SHADER_32_R;
|
||||
}
|
||||
|
||||
/* In presense of MRT holes (ie. the FS exports MRT1 but not MRT0), the compiler will remap them,
|
||||
* so that only MRT0 is exported and the driver will compact SPI_SHADER_COL_FORMAT to match what
|
||||
* the FS actually exports. Though, to make sure the hw remapping works as expected, we should
|
||||
* also clear color attachments without exports in CB_SHADER_MASK.
|
||||
*/
|
||||
blend.cb_shader_mask &= ps->info.ps.colors_written;
|
||||
|
||||
pipeline->col_format = blend.spi_shader_col_format;
|
||||
pipeline->cb_target_mask = blend.cb_target_mask;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user