diff --git a/src/gallium/drivers/radeonsi/si_build_pm4.h b/src/gallium/drivers/radeonsi/si_build_pm4.h index ab3e35ba6c8..bd2e42ebcf8 100644 --- a/src/gallium/drivers/radeonsi/si_build_pm4.h +++ b/src/gallium/drivers/radeonsi/si_build_pm4.h @@ -291,7 +291,7 @@ gfx11_opt_push_sh_reg(reg, reg_enum, value, compute) #define radeon_set_or_push_gfx_sh_reg(reg, value) do { \ - if (GFX_VERSION >= GFX11 && HAS_PAIRS) { \ + if (GFX_VERSION >= GFX11 && HAS_SH_PAIRS_PACKED) { \ radeon_push_gfx_sh_reg(reg, value); \ } else { \ radeon_set_sh_reg_seq(reg, 1); \ diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp index 0de66e638a9..04658778839 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.cpp +++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp @@ -810,9 +810,9 @@ enum si_is_draw_vertex_state { DRAW_VERTEX_STATE_ON, }; -enum si_has_pairs { - HAS_PAIRS_OFF, - HAS_PAIRS_ON, +enum si_has_sh_pairs_packed { + HAS_SH_PAIRS_PACKED_OFF, + HAS_SH_PAIRS_PACKED_ON, }; template ALWAYS_INLINE @@ -932,7 +932,7 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx) } template ALWAYS_INLINE + si_is_draw_vertex_state IS_DRAW_VERTEX_STATE, si_has_sh_pairs_packed HAS_SH_PAIRS_PACKED> ALWAYS_INLINE static void si_emit_vs_state(struct si_context *sctx, unsigned index_size) { if (!IS_DRAW_VERTEX_STATE && sctx->num_vs_blit_sgprs) { @@ -1190,7 +1190,7 @@ void si_emit_buffered_compute_sh_regs(struct si_context *sctx) } while (0) template ALWAYS_INLINE + si_is_draw_vertex_state IS_DRAW_VERTEX_STATE, si_has_sh_pairs_packed HAS_SH_PAIRS_PACKED> ALWAYS_INLINE static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw_info *info, unsigned drawid_base, const struct pipe_draw_indirect_info *indirect, @@ -1339,7 +1339,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw assert(indirect_va % 8 == 0); - if (HAS_PAIRS) { + if (HAS_SH_PAIRS_PACKED) { radeon_end(); gfx11_emit_buffered_sh_regs_inline(sctx, &sctx->num_buffered_gfx_sh_regs, sctx->gfx11.buffered_gfx_sh_regs); @@ -1422,7 +1422,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw if (!is_blit) { /* Prefer SET_SH_REG_PAIRS_PACKED* on Gfx11+. */ - if (HAS_PAIRS) { + if (HAS_SH_PAIRS_PACKED) { radeon_opt_push_gfx_sh_reg(sh_base_reg + SI_SGPR_BASE_VERTEX * 4, tracked_base_vertex_reg, base_vertex); if (set_draw_id) { @@ -1448,7 +1448,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw } } - if (HAS_PAIRS) { + if (HAS_SH_PAIRS_PACKED) { radeon_end(); gfx11_emit_buffered_sh_regs_inline(sctx, &sctx->num_buffered_gfx_sh_regs, sctx->gfx11.buffered_gfx_sh_regs); @@ -1722,7 +1722,7 @@ static unsigned get_vb_descriptor_sgpr_ptr_offset(void) } template ALWAYS_INLINE static bool si_upload_and_prefetch_VB_descriptors(struct si_context *sctx, struct pipe_vertex_state *state, @@ -1967,7 +1967,7 @@ static void si_emit_all_states(struct si_context *sctx, uint64_t skip_atom_mask) } while (0) template ALWAYS_INLINE static void si_draw(struct pipe_context *ctx, const struct pipe_draw_info *info, @@ -2247,7 +2247,7 @@ static void si_draw(struct pipe_context *ctx, /* <-- CUs are idle here if the cache_flush state waited. */ /* This must be done after si_emit_all_states, which can affect this. */ - si_emit_vs_state + si_emit_vs_state (sctx, index_size); /* This needs to be done after cache flushes because ACQUIRE_MEM rolls the context. */ @@ -2262,13 +2262,13 @@ static void si_draw(struct pipe_context *ctx, * It should done after cache flushing. */ if (unlikely((!si_upload_and_prefetch_VB_descriptors - + (sctx, state, partial_velem_mask)))) { DRAW_CLEANUP; return; } - si_emit_draw_packets + si_emit_draw_packets (sctx, info, drawid_offset, indirect, draws, num_draws, indexbuf, index_size, index_offset, instance_count); /* <-- CUs start to get busy here if we waited. */ @@ -2317,7 +2317,7 @@ static void si_draw(struct pipe_context *ctx, } template + si_has_sh_pairs_packed HAS_SH_PAIRS_PACKED> static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info, unsigned drawid_offset, @@ -2325,12 +2325,12 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_start_count_bias *draws, unsigned num_draws) { - si_draw + si_draw (ctx, info, drawid_offset, indirect, draws, num_draws, NULL, 0); } template + si_has_sh_pairs_packed HAS_SH_PAIRS_PACKED, util_popcnt POPCNT> static void si_draw_vertex_state(struct pipe_context *ctx, struct pipe_vertex_state *vstate, uint32_t partial_velem_mask, @@ -2346,7 +2346,7 @@ static void si_draw_vertex_state(struct pipe_context *ctx, dinfo.instance_count = 1; dinfo.index.resource = state->b.input.indexbuf; - si_draw + si_draw (ctx, &dinfo, 0, NULL, draws, num_draws, vstate, partial_velem_mask); if (info.take_vertex_state_ownership) @@ -2409,25 +2409,25 @@ static void si_init_draw_vbo(struct si_context *sctx) if (GFX_VERSION >= GFX11 && sctx->screen->info.has_set_sh_pairs_packed) { sctx->draw_vbo[HAS_TESS][HAS_GS][NGG] = - si_draw_vbo; + si_draw_vbo; if (util_get_cpu_caps()->has_popcnt) { sctx->draw_vertex_state[HAS_TESS][HAS_GS][NGG] = - si_draw_vertex_state; + si_draw_vertex_state; } else { sctx->draw_vertex_state[HAS_TESS][HAS_GS][NGG] = - si_draw_vertex_state; + si_draw_vertex_state; } } else { sctx->draw_vbo[HAS_TESS][HAS_GS][NGG] = - si_draw_vbo; + si_draw_vbo; if (util_get_cpu_caps()->has_popcnt) { sctx->draw_vertex_state[HAS_TESS][HAS_GS][NGG] = - si_draw_vertex_state; + si_draw_vertex_state; } else { sctx->draw_vertex_state[HAS_TESS][HAS_GS][NGG] = - si_draw_vertex_state; + si_draw_vertex_state; } } }