mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 09:10:12 +01:00
radeonsi: add si_emit_rasterizer_prim_state_for_mesh
To be used by mesh pipeline. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38044>
This commit is contained in:
parent
4ee6553767
commit
4c220f9745
3 changed files with 33 additions and 8 deletions
|
|
@ -2298,14 +2298,6 @@ static inline bool si_vs_uses_vbos(struct si_shader_selector *sel)
|
|||
return !sel || !sel->info.base.vs.blit_sgprs_amd;
|
||||
}
|
||||
|
||||
static inline bool si_is_line_stipple_enabled(struct si_context *sctx)
|
||||
{
|
||||
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
|
||||
|
||||
return rs->line_stipple_enable && sctx->current_rast_prim != MESA_PRIM_POINTS &&
|
||||
(rs->polygon_mode_is_lines || util_prim_is_lines(sctx->current_rast_prim));
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE void
|
||||
si_emit_all_states(struct si_context *sctx, uint64_t skip_atom_mask)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ void si_set_vertex_buffer_descriptor(struct si_screen *sscreen, struct si_vertex
|
|||
uint32_t *out);
|
||||
void si_emit_buffered_compute_sh_regs(struct si_context *sctx, struct radeon_cmdbuf *cs);
|
||||
void si_emit_buffered_gfx_sh_regs_for_mesh(struct si_context *sctx);
|
||||
void si_emit_rasterizer_prim_state_for_mesh(struct si_context *sctx);
|
||||
bool si_update_shaders_for_mesh(struct si_context *sctx, struct si_shader *old_vs, struct si_shader *new_vs);
|
||||
void si_init_draw_functions_GFX6(struct si_context *sctx);
|
||||
void si_init_draw_functions_GFX7(struct si_context *sctx);
|
||||
|
|
|
|||
|
|
@ -895,6 +895,14 @@ static void si_init_ia_multi_vgt_param_table(struct si_context *sctx)
|
|||
}
|
||||
}
|
||||
|
||||
static bool si_is_line_stipple_enabled(struct si_context *sctx)
|
||||
{
|
||||
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
|
||||
|
||||
return rs->line_stipple_enable && sctx->current_rast_prim != MESA_PRIM_POINTS &&
|
||||
(rs->polygon_mode_is_lines || util_prim_is_lines(sctx->current_rast_prim));
|
||||
}
|
||||
|
||||
enum si_is_draw_vertex_state {
|
||||
DRAW_VERTEX_STATE_OFF,
|
||||
DRAW_VERTEX_STATE_ON,
|
||||
|
|
@ -1038,6 +1046,30 @@ static void si_emit_rasterizer_prim_state(struct si_context *sctx)
|
|||
radeon_end();
|
||||
}
|
||||
|
||||
#if GFX_VER == 6 /* declare this function only once because it handles all chips. */
|
||||
|
||||
void si_emit_rasterizer_prim_state_for_mesh(struct si_context *sctx)
|
||||
{
|
||||
switch (sctx->screen->info.gfx_level) {
|
||||
case GFX10_3:
|
||||
si_emit_rasterizer_prim_state<GFX10_3, GS_OFF, NGG_ON>(sctx);
|
||||
break;
|
||||
case GFX11:
|
||||
si_emit_rasterizer_prim_state<GFX11, GS_OFF, NGG_ON>(sctx);
|
||||
break;
|
||||
case GFX11_5:
|
||||
si_emit_rasterizer_prim_state<GFX11_5, GS_OFF, NGG_ON>(sctx);
|
||||
break;
|
||||
case GFX12:
|
||||
si_emit_rasterizer_prim_state<GFX12, GS_OFF, NGG_ON>(sctx);
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE("invalid GFX version for mesh shaders");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template <amd_gfx_level GFX_VERSION, si_has_tess HAS_TESS, si_has_gs HAS_GS, si_has_ngg NGG,
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue