mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
radeonsi: don't call of u_prims_for_vertices for patches and rectangles
Both caused a crash due to a division by zero in that function.
This is an alternative fix.
Cc: 11.0 11.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
(cherry picked from commit 0f9519b938)
This commit is contained in:
parent
00fec0e4e1
commit
58f914c506
1 changed files with 13 additions and 1 deletions
|
|
@ -216,6 +216,18 @@ static void si_emit_derived_tess_state(struct si_context *sctx,
|
|||
radeon_emit(cs, tcs_out_layout | (num_tcs_output_cp << 26));
|
||||
}
|
||||
|
||||
static unsigned si_num_prims_for_vertices(const struct pipe_draw_info *info)
|
||||
{
|
||||
switch (info->mode) {
|
||||
case PIPE_PRIM_PATCHES:
|
||||
return info->count / info->vertices_per_patch;
|
||||
case R600_PRIM_RECTANGLE_LIST:
|
||||
return info->count / 3;
|
||||
default:
|
||||
return u_prims_for_vertices(info->mode, info->count);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
|
||||
const struct pipe_draw_info *info,
|
||||
unsigned num_patches)
|
||||
|
|
@ -305,7 +317,7 @@ static unsigned si_get_ia_multi_vgt_param(struct si_context *sctx,
|
|||
if (sctx->b.screen->info.max_se >= 2 && ia_switch_on_eoi &&
|
||||
(info->indirect ||
|
||||
(info->instance_count > 1 &&
|
||||
u_prims_for_vertices(info->mode, info->count) <= 1)))
|
||||
si_num_prims_for_vertices(info) <= 1)))
|
||||
sctx->b.flags |= SI_CONTEXT_VGT_FLUSH;
|
||||
|
||||
/* Instancing bug on 2 SE chips. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue