mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
radeonsi: determine correctly if switching from normal launch to fast launch
Fixes: 3da91b3327 - radeonsi/ngg: add VGT_FLUSH when enabling fast launch
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
This commit is contained in:
parent
13a6dd3f15
commit
44d0d449b1
1 changed files with 22 additions and 11 deletions
|
|
@ -1867,6 +1867,7 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
|
|||
}
|
||||
|
||||
/* Update NGG culling settings. */
|
||||
uint8_t old_ngg_culling = sctx->ngg_culling;
|
||||
if (sctx->ngg && !dispatch_prim_discard_cs && rast_prim == PIPE_PRIM_TRIANGLES &&
|
||||
!sctx->gs_shader.cso && /* GS doesn't support NGG culling. */
|
||||
(sctx->screen->always_use_ngg_culling_all ||
|
||||
|
|
@ -1878,7 +1879,7 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
|
|||
(prim == PIPE_PRIM_TRIANGLES || prim == PIPE_PRIM_TRIANGLE_STRIP) &&
|
||||
!sctx->tes_shader.cso)) &&
|
||||
si_get_vs(sctx)->cso->ngg_culling_allowed) {
|
||||
unsigned ngg_culling = 0;
|
||||
uint8_t ngg_culling = 0;
|
||||
|
||||
if (rs->rasterizer_discard) {
|
||||
ngg_culling |= SI_NGG_CULL_FRONT_FACE | SI_NGG_CULL_BACK_FACE;
|
||||
|
|
@ -1907,23 +1908,33 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
|
|||
ngg_culling |= SI_NGG_CULL_GS_FAST_LAUNCH_TRI_STRIP;
|
||||
}
|
||||
|
||||
if (ngg_culling != sctx->ngg_culling) {
|
||||
/* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
|
||||
* See issues #2418, #2426, #2434
|
||||
*/
|
||||
if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL &&
|
||||
!(sctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL))
|
||||
sctx->flags |= SI_CONTEXT_VGT_FLUSH;
|
||||
if (ngg_culling != old_ngg_culling) {
|
||||
/* If shader compilation is not ready, this setting will be rejected. */
|
||||
sctx->ngg_culling = ngg_culling;
|
||||
sctx->do_update_shaders = true;
|
||||
}
|
||||
} else if (sctx->ngg_culling) {
|
||||
} else if (old_ngg_culling) {
|
||||
sctx->ngg_culling = false;
|
||||
sctx->do_update_shaders = true;
|
||||
}
|
||||
|
||||
if (sctx->do_update_shaders && !si_update_shaders(sctx))
|
||||
goto return_cleanup;
|
||||
if (unlikely(sctx->do_update_shaders)) {
|
||||
if (unlikely(!si_update_shaders(sctx)))
|
||||
goto return_cleanup;
|
||||
|
||||
/* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
|
||||
* See issues #2418, #2426, #2434
|
||||
*
|
||||
* This is the setting that is used by the draw.
|
||||
*/
|
||||
uint8_t ngg_culling = si_get_vs(sctx)->current->key.opt.ngg_culling;
|
||||
if (!(old_ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL) &&
|
||||
ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
|
||||
sctx->flags |= SI_CONTEXT_VGT_FLUSH;
|
||||
|
||||
/* Set this to the correct value determined by si_update_shaders. */
|
||||
sctx->ngg_culling = ngg_culling;
|
||||
}
|
||||
|
||||
si_need_gfx_cs_space(sctx);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue