mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
pvr, pco: add dummy stores for tilebuffer-only loadops
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:
parent
0176d0e4a0
commit
22c67a3c4e
3 changed files with 16 additions and 0 deletions
|
|
@ -2742,3 +2742,5 @@ system_value("front_face_op_pco", 1, bit_sizes=[32])
|
|||
system_value("fs_meta_pco", 1, bit_sizes=[32])
|
||||
|
||||
intrinsic("flush_tile_buffer_pco", src_comp=[1, 1])
|
||||
|
||||
intrinsic("dummy_load_store_pco", indices=[BASE])
|
||||
|
|
|
|||
|
|
@ -1433,6 +1433,14 @@ static pco_instr *trans_intr(trans_ctx *tctx, nir_intrinsic_instr *intr)
|
|||
instr = trans_load_output_fs(tctx, intr, dest);
|
||||
break;
|
||||
|
||||
case nir_intrinsic_dummy_load_store_pco: {
|
||||
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);
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_intrinsic_flush_tile_buffer_pco:
|
||||
assert(tctx->stage == MESA_SHADER_FRAGMENT);
|
||||
instr = trans_flush_tile_buffer(tctx, intr, src[0], src[1]);
|
||||
|
|
|
|||
|
|
@ -970,6 +970,7 @@ pco_shader *pvr_uscgen_loadop(pco_ctx *ctx, struct pvr_load_op *load_op)
|
|||
load_op->clears_loads_state.mrt_setup;
|
||||
|
||||
pco_data data = { 0 };
|
||||
bool has_non_tile_buffer_stores = false;
|
||||
|
||||
nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_FRAGMENT,
|
||||
pco_nir_options(),
|
||||
|
|
@ -1035,6 +1036,7 @@ pco_shader *pvr_uscgen_loadop(pco_ctx *ctx, struct pvr_load_op *load_op)
|
|||
|
||||
struct usc_mrt_resource *mrt_resource = &mrt_setup->mrt_resources[rt_idx];
|
||||
bool tile_buffer = mrt_resource->type != USC_MRT_RESOURCE_TYPE_OUTPUT_REG;
|
||||
has_non_tile_buffer_stores |= !tile_buffer;
|
||||
|
||||
data.fs.outputs[FRAG_RESULT_DATA0 + rt_idx] = (pco_range){
|
||||
.start = tile_buffer ? mrt_resource->mem.tile_buffer
|
||||
|
|
@ -1081,6 +1083,7 @@ pco_shader *pvr_uscgen_loadop(pco_ctx *ctx, struct pvr_load_op *load_op)
|
|||
struct usc_mrt_resource *mrt_resource =
|
||||
&mrt_setup->mrt_resources[depth_idx];
|
||||
bool tile_buffer = mrt_resource->type != USC_MRT_RESOURCE_TYPE_OUTPUT_REG;
|
||||
has_non_tile_buffer_stores |= !tile_buffer;
|
||||
|
||||
unsigned accum_size_dwords =
|
||||
DIV_ROUND_UP(mrt_resource->intermediate_size, sizeof(uint32_t));
|
||||
|
|
@ -1197,6 +1200,9 @@ pco_shader *pvr_uscgen_loadop(pco_ctx *ctx, struct pvr_load_op *load_op)
|
|||
load_op->num_tile_buffers = data.fs.num_tile_buffers;
|
||||
}
|
||||
|
||||
if (!has_non_tile_buffer_stores)
|
||||
nir_dummy_load_store_pco(&b);
|
||||
|
||||
nir_jump(&b, nir_jump_return);
|
||||
|
||||
load_op->const_shareds_count = shared_regs;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue