mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
panfrost: Assume lower_fragcolor has been called
Allows us to clean up quite a bit. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
This commit is contained in:
parent
28ac4d1e00
commit
03e3e65cd4
5 changed files with 13 additions and 33 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue