pco: support skipping overlap check emission, enable for eot shader

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Simon Perretta
2025-05-30 16:01:52 +01:00
committed by Marge Bot
parent a4802fd547
commit f7a783a2ec
3 changed files with 18 additions and 10 deletions
+1
View File
@@ -115,6 +115,7 @@ typedef struct _pco_fs_data {
bool early_frag;
bool sample_shading;
bool alpha_to_coverage;
bool olchk_skip;
} uses;
struct {
+13 -9
View File
@@ -31,6 +31,7 @@ typedef struct _trans_ctx {
pco_builder b; /** Builder. */
mesa_shader_stage stage; /** Shader stage. */
enum pco_cf_node_flag flag; /** Implementation-defined control-flow flag. */
bool olchk;
BITSET_WORD *float_types; /** NIR SSA float vars. */
BITSET_WORD *int_types; /** NIR SSA int vars. */
@@ -449,7 +450,7 @@ trans_store_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref src)
if (!tile_buffer) {
pco_ref dest =
pco_ref_hwreg(range->start + component, PCO_REG_CLASS_PIXOUT);
return pco_mov(&tctx->b, dest, src, .olchk = true);
return pco_mov(&tctx->b, dest, src, .olchk = tctx->olchk);
}
unsigned tile_buffer_id = range->start;
@@ -480,7 +481,7 @@ trans_store_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref src)
base_addr[1],
tiled_offset,
pco_ref_null(),
.olchk = true,
.olchk = tctx->olchk,
.s = true);
unsigned chans = pco_ref_get_chans(src);
@@ -507,7 +508,7 @@ trans_store_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref src)
pco_ref_imm8(chans),
addr_data,
cov_mask,
.olchk = true);
.olchk = tctx->olchk);
}
static pco_instr *trans_flush_tile_buffer(trans_ctx *tctx,
@@ -528,7 +529,7 @@ static pco_instr *trans_flush_tile_buffer(trans_ctx *tctx,
src_addr_hi,
tiled_offset,
pco_ref_null(),
.olchk = true,
.olchk = tctx->olchk,
.s = true);
pco_ref addr = pco_ref_new_ssa_addr(tctx->func);
@@ -651,7 +652,7 @@ trans_load_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref dest)
if (!tile_buffer) {
pco_ref src =
pco_ref_hwreg(range->start + component, PCO_REG_CLASS_PIXOUT);
return pco_mov(&tctx->b, dest, src, .olchk = true);
return pco_mov(&tctx->b, dest, src, .olchk = tctx->olchk);
}
unsigned tile_buffer_id = range->start;
@@ -680,7 +681,7 @@ trans_load_output_fs(trans_ctx *tctx, nir_intrinsic_instr *intr, pco_ref dest)
base_addr[1],
tiled_offset,
pco_ref_null(),
.olchk = true,
.olchk = tctx->olchk,
.s = true);
pco_ref addr = pco_ref_new_ssa_addr(tctx->func);
@@ -1541,7 +1542,7 @@ static pco_instr *trans_intr(trans_ctx *tctx, nir_intrinsic_instr *intr)
assert(tctx->stage == MESA_SHADER_FRAGMENT);
pco_ref pixout =
pco_ref_hwreg(nir_intrinsic_base(intr), PCO_REG_CLASS_PIXOUT);
return pco_mov(&tctx->b, pixout, pixout, .olchk = true);
return pco_mov(&tctx->b, pixout, pixout, .olchk = tctx->olchk);
break;
}
@@ -1713,14 +1714,14 @@ static pco_instr *trans_intr(trans_ctx *tctx, nir_intrinsic_instr *intr)
instr = does_depthf ? pco_depthf(&tctx->b,
pco_ref_drc(PCO_DRC_0),
src[1],
.olchk = true)
.olchk = tctx->olchk)
: pco_alphaf(&tctx->b,
pco_ref_null(),
pco_ref_drc(PCO_DRC_0),
pco_zero,
pco_zero,
pco_7,
.olchk = true);
.olchk = tctx->olchk);
if (does_discard)
pco_instr_set_exec_cnd(instr, PCO_EXEC_CND_E1_Z1);
@@ -3410,6 +3411,9 @@ pco_trans_nir(pco_ctx *ctx, nir_shader *nir, pco_data *data, void *mem_ctx)
.stage = shader->stage,
};
if (shader->stage == MESA_SHADER_FRAGMENT)
tctx.olchk = !data->fs.uses.olchk_skip;
nir_foreach_function_with_impl (func, impl, nir) {
trans_func(&tctx, impl);
}
+4 -1
View File
@@ -156,7 +156,10 @@ pco_shader *pvr_usc_eot(pco_ctx *ctx,
/* Just return. */
nir_jump(&b, nir_jump_return);
return build_shader(ctx, b.shader, &(pco_data){ 0 });
pco_data data = {
.fs.uses.olchk_skip = true,
};
return build_shader(ctx, b.shader, &data);
}
/**