From 3d9cf02530f213be6a324f46d55dc0f05895963f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 1 Sep 2020 18:41:36 -0400 Subject: [PATCH] radeonsi: stop using TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_pipe.h | 2 +- src/gallium/drivers/radeonsi/si_shader.h | 3 +-- src/gallium/drivers/radeonsi/si_shader_nir.c | 2 +- src/gallium/drivers/radeonsi/si_state_shaders.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 94103919fd4..f23865cec2b 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1781,7 +1781,7 @@ static inline unsigned si_get_total_colormask(struct si_context *sctx) unsigned colormask = sctx->framebuffer.colorbuf_enabled_4bit & sctx->queued.named.blend->cb_target_mask; - if (!ps->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS]) + if (!ps->info.color0_writes_all_cbufs) colormask &= ps->colors_written_4bit; else if (!ps->colors_written_4bit) colormask = 0; /* color0 writes all cbufs, but it's not written */ diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index b7670e4004a..80369a6e7e9 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -343,6 +343,7 @@ struct si_shader_info { ubyte colors_read; /**< which color components are read by the FS */ ubyte colors_written; + bool color0_writes_all_cbufs; /**< gl_FragColor */ bool reads_samplemask; /**< does fragment shader read sample mask? */ bool reads_tess_factors; /**< If TES reads TESSINNER or TESSOUTER */ bool writes_z; /**< does fragment shader write Z value? */ @@ -392,8 +393,6 @@ struct si_shader_info { unsigned msaa_images_declared; /**< bitmask of declared MSAA images */ unsigned shader_buffers_declared; /**< bitmask of declared shader buffers */ - unsigned properties[TGSI_PROPERTY_COUNT]; /* index with TGSI_PROPERTY_ */ - /** Whether all codepaths write tess factors in all invocations. */ bool tessfactors_are_def_in_all_invocs; }; diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 65f49322789..3eb3cd5ad89 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -114,7 +114,7 @@ static void scan_io_usage(struct si_shader_info *info, nir_intrinsic_instr *intr /* Never use FRAG_RESULT_COLOR directly. */ if (semantic == FRAG_RESULT_COLOR) { semantic = FRAG_RESULT_DATA0; - info->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] = true; + info->color0_writes_all_cbufs = true; } semantic += nir_intrinsic_io_semantics(intr).dual_source_blend_index; } diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 11fc10a92e3..8e579d865f4 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1889,7 +1889,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; struct si_state_blend *blend = sctx->queued.named.blend; - if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] && + if (sel->info.color0_writes_all_cbufs && sel->info.colors_written == 0x1) key->part.ps.epilog.last_cbuf = MAX2(sctx->framebuffer.state.nr_cbufs, 1) - 1; -- 2.30.2