if (cmd_buffer->state.emitted_ps_epilog == ps_epilog && !pipeline_is_dirty)
return;
- radeon_set_context_reg(cmd_buffer->cs, R_028714_SPI_SHADER_COL_FORMAT,
- ps_epilog->spi_shader_col_format);
+ uint32_t col_format = ps_epilog->spi_shader_col_format;
+ if (pipeline->need_null_export_workaround && !col_format)
+ col_format = V_028714_SPI_SHADER_32_R;
+ radeon_set_context_reg(cmd_buffer->cs, R_028714_SPI_SHADER_COL_FORMAT, col_format);
radeon_set_context_reg(cmd_buffer->cs, R_02823C_CB_SHADER_MASK,
ac_get_cb_shader_mask(ps_epilog->spi_shader_col_format));
}
cmd_buffer->state.col_format_non_compacted = ps_epilog->spi_shader_col_format;
+ if (cmd_buffer->state.graphics_pipeline->need_null_export_workaround &&
+ !cmd_buffer->state.col_format_non_compacted)
+ cmd_buffer->state.col_format_non_compacted = V_028714_SPI_SHADER_32_R;
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_RBPLUS;
}
* color and Z formats to SPI_SHADER_ZERO. The hw will skip export
* instructions if any are present.
*/
- if ((device->physical_device->rad_info.gfx_level <= GFX9 || ps->info.ps.can_discard) &&
- !blend.spi_shader_col_format) {
- if (!ps->info.ps.writes_z && !ps->info.ps.writes_stencil && !ps->info.ps.writes_sample_mask) {
- blend.spi_shader_col_format = V_028714_SPI_SHADER_32_R;
- pipeline->col_format_non_compacted = V_028714_SPI_SHADER_32_R;
- }
+ pipeline->need_null_export_workaround =
+ (device->physical_device->rad_info.gfx_level <= GFX9 || ps->info.ps.can_discard) &&
+ !ps->info.ps.writes_z && !ps->info.ps.writes_stencil && !ps->info.ps.writes_sample_mask;
+ if (pipeline->need_null_export_workaround && !blend.spi_shader_col_format) {
+ blend.spi_shader_col_format = V_028714_SPI_SHADER_32_R;
+ pipeline->col_format_non_compacted = V_028714_SPI_SHADER_32_R;
}
if (radv_pipeline_has_stage(pipeline, MESA_SHADER_GEOMETRY) && !radv_pipeline_has_ngg(pipeline)) {