diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 737cfb81b79..8522a162c3b 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -527,10 +527,9 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr) } if (emit_blend) { - assert(loc == FRAG_RESULT_COLOR || loc >= FRAG_RESULT_DATA0); + assert(loc >= FRAG_RESULT_DATA0); - unsigned rt = loc == FRAG_RESULT_COLOR ? 0 : - (loc - FRAG_RESULT_DATA0); + unsigned rt = (loc - FRAG_RESULT_DATA0); bi_index color = bi_src_index(&instr->src[0]); /* Explicit copy since BLEND inputs are precoloured to R0-R3, @@ -932,9 +931,8 @@ bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr) nir_find_variable_with_driver_location(b->shader->nir, nir_var_shader_out, nir_intrinsic_base(instr)); unsigned loc = var->data.location; - assert(loc == FRAG_RESULT_COLOR || loc >= FRAG_RESULT_DATA0); - rt = loc == FRAG_RESULT_COLOR ? 0 : - (loc - FRAG_RESULT_DATA0); + assert(loc >= FRAG_RESULT_DATA0); + rt = (loc - FRAG_RESULT_DATA0); } /* We want to load the current pixel. diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c index 49bba06ce45..c49d6f40217 100644 --- a/src/panfrost/lib/pan_shader.c +++ b/src/panfrost/lib/pan_shader.c @@ -177,20 +177,12 @@ pan_shader_compile(const struct panfrost_device *dev, if (s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK)) info->fs.writes_coverage = true; - uint64_t outputs_read = s->info.outputs_read; - uint64_t outputs_written = s->info.outputs_written; - - if (outputs_read & BITFIELD64_BIT(FRAG_RESULT_COLOR)) - outputs_read |= BITFIELD64_BIT(FRAG_RESULT_DATA0); - if (outputs_written & BITFIELD64_BIT(FRAG_RESULT_COLOR)) - outputs_written |= BITFIELD64_BIT(FRAG_RESULT_DATA0); - - info->fs.outputs_read = outputs_read >> FRAG_RESULT_DATA0; - info->fs.outputs_written = outputs_written >> FRAG_RESULT_DATA0; + info->fs.outputs_read = s->info.outputs_read >> FRAG_RESULT_DATA0; + info->fs.outputs_written = s->info.outputs_written >> FRAG_RESULT_DATA0; /* EXT_shader_framebuffer_fetch requires per-sample */ info->fs.sample_shading = s->info.fs.uses_sample_shading || - outputs_read; + info->fs.outputs_read; info->fs.can_discard = s->info.fs.uses_discard; info->fs.helper_invocations = s->info.fs.needs_quad_helper_invocations; diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 42a656de1fe..3ec5b3ab318 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -1650,9 +1650,6 @@ output_load_rt_addr(compiler_context *ctx, nir_intrinsic_instr *instr) unsigned loc = var->data.location; - if (loc == FRAG_RESULT_COLOR) - loc = FRAG_RESULT_DATA0; - if (loc >= FRAG_RESULT_DATA0) return loc - FRAG_RESULT_DATA0; @@ -1900,9 +1897,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr) } enum midgard_rt_id rt; - if (var->data.location == FRAG_RESULT_COLOR) - rt = MIDGARD_COLOR_RT0; - else if (var->data.location >= FRAG_RESULT_DATA0) + if (var->data.location >= FRAG_RESULT_DATA0) rt = MIDGARD_COLOR_RT0 + var->data.location - FRAG_RESULT_DATA0; else if (combined) diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c index 73041a1645f..16dafe6b82a 100644 --- a/src/panfrost/util/pan_lower_framebuffer.c +++ b/src/panfrost/util/pan_lower_framebuffer.c @@ -738,16 +738,12 @@ pan_lower_framebuffer(nir_shader *shader, const enum pipe_format *rt_fmts, if (var->data.mode != nir_var_shader_out) continue; - unsigned base = var->data.driver_location; - - unsigned rt; - if (var->data.location == FRAG_RESULT_COLOR) - rt = 0; - else if (var->data.location >= FRAG_RESULT_DATA0) - rt = var->data.location - FRAG_RESULT_DATA0; - else + if (var->data.location < FRAG_RESULT_DATA0) continue; + unsigned base = var->data.driver_location; + unsigned rt = var->data.location - FRAG_RESULT_DATA0; + if (rt_fmts[rt] == PIPE_FORMAT_NONE) continue; diff --git a/src/panfrost/util/pan_lower_writeout.c b/src/panfrost/util/pan_lower_writeout.c index 44a1dac9595..7c298208515 100644 --- a/src/panfrost/util/pan_lower_writeout.c +++ b/src/panfrost/util/pan_lower_writeout.c @@ -95,8 +95,7 @@ pan_nir_lower_zs_store(nir_shader *nir) const nir_variable *var = nir_find_variable_with_driver_location(nir, nir_var_shader_out, nir_intrinsic_base(intr)); assert(var); - if (var->data.location != FRAG_RESULT_COLOR && - var->data.location < FRAG_RESULT_DATA0) + if (var->data.location < FRAG_RESULT_DATA0) continue; if (var->data.index)