[Mesa-dev] [PATCH 4/4] draw: kill off bogus assertion in tgsi_fetch_gs_outputs

Jose Fonseca jfonseca at vmware.com
Thu Aug 28 09:14:54 PDT 2014


draw module has loads of !util_is_inf_or_nan() assertions, but most are 
#ifdef'd out.  If my memory serves me right, they were useful to cacth 
bugs (as NaNs shouldn't appear when the input is not NaN).  But as you 
say, it's not a valid assumption, when inputs are NaNs.

Series looks good to me.

Jose

On 28/08/14 00:08, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> Not sure why it was there but it is definitely not an error if gs outputs are
> infs/nans. Besides, the outputs can be ints, in which case any small negative
> number asserted.
> This fixes piglit's texelFetch gs isamplerXX crashes with softpipe (down from
> 14 to 2).
>
> Bug https://bugs.freedesktop.org/show_bug.cgi?id=80012.
> ---
>   src/gallium/auxiliary/draw/draw_gs.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
> index bbf515a..878fcca 100644
> --- a/src/gallium/auxiliary/draw/draw_gs.c
> +++ b/src/gallium/auxiliary/draw/draw_gs.c
> @@ -64,7 +64,7 @@ draw_gs_get_input_index(int semantic, int index,
>    * We execute geometry shaders in the SOA mode, so ideally we want to
>    * flush when the number of currently fetched primitives is equal to
>    * the number of elements in the SOA vector. This ensures that the
> - * throughput is optimized for the given vector instrunction set.
> + * throughput is optimized for the given vector instruction set.
>    */
>   static INLINE boolean
>   draw_gs_should_flush(struct draw_geometry_shader *shader)
> @@ -90,7 +90,7 @@ tgsi_fetch_gs_outputs(struct draw_geometry_shader *shader,
>
>      for (prim_idx = 0; prim_idx < num_primitives; ++prim_idx) {
>         unsigned num_verts_per_prim = machine->Primitives[prim_idx];
> -      shader->primitive_lengths[prim_idx +   shader->emitted_primitives] =
> +      shader->primitive_lengths[prim_idx + shader->emitted_primitives] =
>            machine->Primitives[prim_idx];
>         shader->emitted_vertices += num_verts_per_prim;
>         for (j = 0; j < num_verts_per_prim; j++, current_idx++) {
> @@ -110,7 +110,6 @@ tgsi_fetch_gs_outputs(struct draw_geometry_shader *shader,
>                            output[slot][2],
>                            output[slot][3]);
>   #endif
> -            debug_assert(!util_is_inf_or_nan(output[slot][0]));
>            }
>            output = (float (*)[4])((char *)output + shader->vertex_size);
>         }
>



More information about the mesa-dev mailing list