aco/ngg: Add assertion to make sure we always know the vertex count.
Just a sanity check to avoid hangs caused by missing this in the future. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7213>
This commit is contained in:
parent
d9cb9ff414
commit
d8435c1628
|
@ -6934,6 +6934,8 @@ void ngg_visit_set_vertex_and_primitive_count(isel_context *ctx, nir_intrinsic_i
|
||||||
if (!ctx->args->shader_info->gs.num_stream_output_components[stream])
|
if (!ctx->args->shader_info->gs.num_stream_output_components[stream])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ctx->ngg_gs_known_vtxcnt[stream] = true;
|
||||||
|
|
||||||
/* Clear the primitive flags of non-emitted GS vertices. */
|
/* Clear the primitive flags of non-emitted GS vertices. */
|
||||||
if (!nir_src_is_const(instr->src[0]) || nir_src_as_uint(instr->src[0]) < ctx->shader->info.gs.vertices_out) {
|
if (!nir_src_is_const(instr->src[0]) || nir_src_as_uint(instr->src[0]) < ctx->shader->info.gs.vertices_out) {
|
||||||
Temp vtx_cnt = get_ssa_temp(ctx, instr->src[0].ssa);
|
Temp vtx_cnt = get_ssa_temp(ctx, instr->src[0].ssa);
|
||||||
|
@ -11577,6 +11579,9 @@ void ngg_gs_prelude(isel_context *ctx)
|
||||||
|
|
||||||
void ngg_gs_finale(isel_context *ctx)
|
void ngg_gs_finale(isel_context *ctx)
|
||||||
{
|
{
|
||||||
|
/* Sanity check. Make sure the vertex/primitive counts are set and the LDS is correctly initialized. */
|
||||||
|
assert(ctx->ngg_gs_known_vtxcnt[0]);
|
||||||
|
|
||||||
if_context ic;
|
if_context ic;
|
||||||
Builder bld(ctx->program, ctx->block);
|
Builder bld(ctx->program, ctx->block);
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ struct isel_context {
|
||||||
/* GS inputs */
|
/* GS inputs */
|
||||||
bool ngg_nogs_early_prim_export = false;
|
bool ngg_nogs_early_prim_export = false;
|
||||||
bool ngg_gs_early_alloc = false;
|
bool ngg_gs_early_alloc = false;
|
||||||
|
bool ngg_gs_known_vtxcnt[4] = {false, false, false, false};
|
||||||
Temp gs_wave_id;
|
Temp gs_wave_id;
|
||||||
unsigned ngg_gs_emit_addr = 0;
|
unsigned ngg_gs_emit_addr = 0;
|
||||||
unsigned ngg_gs_emit_vtx_bytes = 0;
|
unsigned ngg_gs_emit_vtx_bytes = 0;
|
||||||
|
|
Loading…
Reference in New Issue