radv: gather MRTs that are written by the fragment shader

This will be used to filter color attachments without exports.

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/5786>
This commit is contained in:
Samuel Pitoiset 2022-08-31 17:15:27 +02:00 committed by Marge Bot
parent 6e990a2f73
commit 49c7d28b0b
2 changed files with 5 additions and 0 deletions

View file

@ -329,6 +329,7 @@ struct radv_shader_info {
bool allow_flat_shading;
bool has_epilog;
unsigned spi_ps_input;
unsigned colors_written;
} ps;
struct {
bool uses_grid_size;

View file

@ -77,6 +77,10 @@ gather_intrinsic_store_output_info(const nir_shader *nir, const nir_intrinsic_in
case MESA_SHADER_GEOMETRY:
output_usage_mask = info->gs.output_usage_mask;
break;
case MESA_SHADER_FRAGMENT:
if (idx >= FRAG_RESULT_DATA0)
info->ps.colors_written |= 0xf << (4 * (idx - FRAG_RESULT_DATA0));
break;
default:
break;
}