radeonsi: fix clearing index_size for NGG fast launch

Cc: 21.1 21.2 <mesa-stable@lists.freedesktop.org>

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13048>
(cherry picked from commit b1cf504f78)
This commit is contained in:
Marek Olšák 2021-09-26 08:40:18 -04:00 committed by Dylan Baker
parent ccf0bd1aa6
commit 00b88496e1
2 changed files with 6 additions and 3 deletions

View file

@ -139,7 +139,7 @@
"description": "radeonsi: fix clearing index_size for NGG fast launch",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -2043,8 +2043,6 @@ static void si_draw_vbo(struct pipe_context *ctx,
} else if (!primitive_restart) {
ngg_culling |= SI_NGG_CULL_GS_FAST_LAUNCH_TRI_STRIP |
SI_NGG_CULL_GS_FAST_LAUNCH_INDEX_SIZE_PACKED(MIN2(index_size, 3));
/* The index buffer will be emulated. */
index_size = 0;
}
}
}
@ -2092,6 +2090,11 @@ static void si_draw_vbo(struct pipe_context *ctx,
}
}
/* ngg_culling can be changed after si_update_shaders above, so determine index_size here. */
if (GFX_VERSION >= GFX10 && NGG &&
sctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_INDEX_SIZE_PACKED(~0))
index_size = 0; /* The index buffer will be emulated. */
/* Since we've called si_context_add_resource_size for vertex buffers,
* this must be called after si_need_cs_space, because we must let
* need_cs_space flush before we add buffers to the buffer list.