ir3: Detect FS that write only color without other side effects

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33735>
This commit is contained in:
Danylo Piliaiev 2025-03-05 17:11:51 +01:00
parent ace933455c
commit 71238fb4d8
2 changed files with 5 additions and 0 deletions

View file

@ -6043,6 +6043,9 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
if (so->type == MESA_SHADER_FRAGMENT) {
so->empty = is_empty(ir) && so->num_sampler_prefetch == 0;
so->writes_only_color = !ctx->s->info.writes_memory && !so->has_kill &&
!so->writes_pos && !so->writes_smask &&
!so->writes_stencilref;
}
if (gl_shader_stage_is_compute(so->type)) {

View file

@ -854,6 +854,8 @@ struct ir3_shader_variant {
bool post_depth_coverage;
bool empty;
/* Doesn't have side-effects, no kill, no D/S write, etc. */
bool writes_only_color;
/* Are we using split or merged register file? */
bool mergedregs;