mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 18:50:10 +01:00
amd,radv,radeonsi: add ac_emit_cp_set_predication()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37870>
This commit is contained in:
parent
ad907efae2
commit
48b4a43e8f
4 changed files with 27 additions and 28 deletions
|
|
@ -1069,3 +1069,21 @@ ac_emit_cp_pfp_sync_me(struct ac_cmdbuf *cs)
|
|||
ac_cmdbuf_emit(0);
|
||||
ac_cmdbuf_end();
|
||||
}
|
||||
|
||||
void
|
||||
ac_emit_cp_set_predication(struct ac_cmdbuf *cs, enum amd_gfx_level gfx_level,
|
||||
uint64_t va, uint32_t op)
|
||||
{
|
||||
ac_cmdbuf_begin(cs);
|
||||
if (gfx_level >= GFX9) {
|
||||
ac_cmdbuf_emit(PKT3(PKT3_SET_PREDICATION, 2, 0));
|
||||
ac_cmdbuf_emit(op);
|
||||
ac_cmdbuf_emit(va);
|
||||
ac_cmdbuf_emit(va >> 32);
|
||||
} else {
|
||||
ac_cmdbuf_emit(PKT3(PKT3_SET_PREDICATION, 1, 0));
|
||||
ac_cmdbuf_emit(va);
|
||||
ac_cmdbuf_emit(op | ((va >> 32) & 0xFF));
|
||||
}
|
||||
ac_cmdbuf_end();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,10 @@ ac_emit_cp_copy_data(struct ac_cmdbuf *cs, uint32_t src_sel, uint32_t dst_sel,
|
|||
void
|
||||
ac_emit_cp_pfp_sync_me(struct ac_cmdbuf *cs);
|
||||
|
||||
void
|
||||
ac_emit_cp_set_predication(struct ac_cmdbuf *cs, enum amd_gfx_level gfx_level,
|
||||
uint64_t va, uint32_t op);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14605,25 +14605,14 @@ radv_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer, bool draw_vi
|
|||
|
||||
op = PRED_OP(pred_op);
|
||||
|
||||
/* PREDICATION_DRAW_VISIBLE means that if the 32-bit value is
|
||||
* zero, all rendering commands are discarded. Otherwise, they
|
||||
* are discarded if the value is non zero.
|
||||
/* PREDICATION_DRAW_VISIBLE means that if the 32-bit value is zero, all
|
||||
* rendering commands are discarded. Otherwise, they are discarded if
|
||||
* the value is non zero.
|
||||
*/
|
||||
op |= draw_visible ? PREDICATION_DRAW_VISIBLE : PREDICATION_DRAW_NOT_VISIBLE;
|
||||
}
|
||||
|
||||
radeon_begin(cs);
|
||||
if (pdev->info.gfx_level >= GFX9) {
|
||||
radeon_emit(PKT3(PKT3_SET_PREDICATION, 2, 0));
|
||||
radeon_emit(op);
|
||||
radeon_emit(va);
|
||||
radeon_emit(va >> 32);
|
||||
} else {
|
||||
radeon_emit(PKT3(PKT3_SET_PREDICATION, 1, 0));
|
||||
radeon_emit(va);
|
||||
radeon_emit(op | ((va >> 32) & 0xFF));
|
||||
}
|
||||
radeon_end();
|
||||
ac_emit_cp_set_predication(cs->b, pdev->info.gfx_level, va, op);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1033,19 +1033,7 @@ static void emit_set_predicate(struct si_context *ctx, struct si_resource *buf,
|
|||
{
|
||||
struct radeon_cmdbuf *cs = &ctx->gfx_cs;
|
||||
|
||||
radeon_begin(cs);
|
||||
|
||||
if (ctx->gfx_level >= GFX9) {
|
||||
radeon_emit(PKT3(PKT3_SET_PREDICATION, 2, 0));
|
||||
radeon_emit(op);
|
||||
radeon_emit(va);
|
||||
radeon_emit(va >> 32);
|
||||
} else {
|
||||
radeon_emit(PKT3(PKT3_SET_PREDICATION, 1, 0));
|
||||
radeon_emit(va);
|
||||
radeon_emit(op | ((va >> 32) & 0xFF));
|
||||
}
|
||||
radeon_end();
|
||||
ac_emit_cp_set_predication(&cs->current, ctx->gfx_level, va, op);
|
||||
|
||||
radeon_add_to_buffer_list(ctx, &ctx->gfx_cs, buf, RADEON_USAGE_READ | RADEON_PRIO_QUERY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue