From 3ccd0891d342cd518b929f5135ad307255ddc789 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 7 Apr 2021 14:02:06 -0400 Subject: [PATCH] nir/lower_fragcolor: set outputs_written for fragdata members normal gather_info stuff Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_lower_fragcolor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_lower_fragcolor.c b/src/compiler/nir/nir_lower_fragcolor.c index 95eaf3dff2e..1d05a3d7d72 100644 --- a/src/compiler/nir/nir_lower_fragcolor.c +++ b/src/compiler/nir/nir_lower_fragcolor.c @@ -72,6 +72,8 @@ lower_fragcolor_instr(nir_intrinsic_instr *instr, nir_builder *b, unsigned max_d /* translate gl_FragColor -> gl_FragData since this is already handled */ out->data.location = FRAG_RESULT_DATA0; nir_component_mask_t writemask = nir_intrinsic_write_mask(instr); + b->shader->info.outputs_written &= ~BITFIELD64_BIT(FRAG_RESULT_COLOR); + b->shader->info.outputs_written |= BITFIELD64_BIT(FRAG_RESULT_DATA0); for (unsigned i = 1; i < max_draw_buffers; i++) { char name[28]; @@ -83,6 +85,7 @@ lower_fragcolor_instr(nir_intrinsic_instr *instr, nir_builder *b, unsigned max_d out_color->data.driver_location = i; out_color->data.index = out->data.index; nir_store_var(b, out_color, frag_color, writemask); + b->shader->info.outputs_written |= BITFIELD64_BIT(FRAG_RESULT_DATA0 + i); } return true; }