[Mesa-dev] [Mesa-stable] [PATCH 5/5] radeonsi/gfx9: fix geometry shaders without output vertices

Marek Olšák maraeo at gmail.com
Wed Sep 27 09:21:57 UTC 2017


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Sep 26, 2017 at 4:43 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Not that those are super common or useful, but hey! Fun corner cases
> of the API...
>
> Fixes dEQP-GLES31.functional.geometry_shading.emit.*
>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/gallium/drivers/radeonsi/si_state_shaders.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
> index 53a60ba11ed..985ee130e6d 100644
> --- a/src/gallium/drivers/radeonsi/si_state_shaders.c
> +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
> @@ -637,23 +637,25 @@ static void gfx9_get_gs_info(struct si_shader_selector *es,
>         assert(gs_num_invocations <= 32); /* GL maximum */
>
>         if (uses_adjacency || gs_num_invocations > 1)
>                 max_gs_prims = 127 / gs_num_invocations;
>         else
>                 max_gs_prims = 255;
>
>         /* MAX_PRIMS_PER_SUBGROUP = gs_prims * max_vert_out * gs_invocations.
>          * Make sure we don't go over the maximum value.
>          */
> -       max_gs_prims = MIN2(max_gs_prims,
> -                           max_out_prims /
> -                           (gs->gs_max_out_vertices * gs_num_invocations));
> +       if (gs->gs_max_out_vertices > 0) {
> +               max_gs_prims = MIN2(max_gs_prims,
> +                                   max_out_prims /
> +                                   (gs->gs_max_out_vertices * gs_num_invocations));
> +       }
>         assert(max_gs_prims > 0);
>
>         /* If the primitive has adjacency, halve the number of vertices
>          * that will be reused in multiple primitives.
>          */
>         min_es_verts = gs->gs_input_verts_per_prim / (uses_adjacency ? 2 : 1);
>
>         gs_prims = MIN2(ideal_gs_prims, max_gs_prims);
>         worst_case_es_verts = MIN2(min_es_verts * gs_prims, max_es_verts);
>
> --
> 2.11.0
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable


More information about the mesa-dev mailing list