mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 07:10:09 +01:00
radv: clear unwritten color attachments for monolithic PS earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28976>
This commit is contained in:
parent
3b41fbd4b8
commit
e1483d022b
2 changed files with 4 additions and 9 deletions
|
|
@ -4113,15 +4113,7 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv
|
||||||
/* Make sure to clear color attachments without exports because MRT holes are removed during
|
/* Make sure to clear color attachments without exports because MRT holes are removed during
|
||||||
* compilation for optimal performance.
|
* compilation for optimal performance.
|
||||||
*/
|
*/
|
||||||
blend.spi_shader_col_format =
|
blend.spi_shader_col_format = radv_compact_spi_shader_col_format(blend.spi_shader_col_format);
|
||||||
radv_compact_spi_shader_col_format(blend.spi_shader_col_format & ps->info.ps.colors_written);
|
|
||||||
|
|
||||||
/* In presence 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned custom_blend_mode = extra ? extra->custom_blend_mode : 0;
|
unsigned custom_blend_mode = extra ? extra->custom_blend_mode : 0;
|
||||||
|
|
|
||||||
|
|
@ -914,6 +914,9 @@ gather_shader_info_fs(const struct radv_device *device, const nir_shader *nir,
|
||||||
if (!info->has_epilog) {
|
if (!info->has_epilog) {
|
||||||
info->ps.mrt0_is_dual_src = gfx_state->ps.epilog.mrt0_is_dual_src;
|
info->ps.mrt0_is_dual_src = gfx_state->ps.epilog.mrt0_is_dual_src;
|
||||||
info->ps.spi_shader_col_format = gfx_state->ps.epilog.spi_shader_col_format;
|
info->ps.spi_shader_col_format = gfx_state->ps.epilog.spi_shader_col_format;
|
||||||
|
|
||||||
|
/* Clear color attachments that aren't exported by the FS to match IO shader arguments. */
|
||||||
|
info->ps.spi_shader_col_format &= info->ps.colors_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool export_alpha_and_mrtz =
|
const bool export_alpha_and_mrtz =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue