[Mesa-dev] [PATCH] st/nir: Disable varying packing when doing transform feedback.

Timothy Arceri tarceri at itsqueeze.com
Wed Jun 20 22:56:36 UTC 2018


nir_compact_varyings() is meant to skip over varyings used by xfb:

          /* We can't repack xfb varyings. */
          if (var->data.always_active_io)
             continue;

Any idea why that isn't working in this case?

On 21/06/18 06:30, Eric Anholt wrote:
> If one of the TF variables got varying-packed, it would end up with a new
> driver_location, despite the pipe_stream_output already being set up for
> the old driver location.  This left the gallium driver with no way to work
> back to what varying was referenced by pipe_stream_output.
> 
> Fixes these tests on V3D:
> dEQP-GLES3.functional.transform_feedback.random.separate.points.3
> dEQP-GLES3.functional.transform_feedback.random.separate.points.7
> dEQP-GLES3.functional.transform_feedback.random.separate.points.9
> dEQP-GLES3.functional.transform_feedback.random.separate.triangles.3
> dEQP-GLES3.functional.transform_feedback.random.separate.triangles.8
> ---
>   src/mesa/state_tracker/st_glsl_to_nir.cpp | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> index d24944c6af51..6d19bb0dfb8a 100644
> --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> @@ -739,7 +739,15 @@ st_link_nir(struct gl_context *ctx,
>         shader->Program->info = nir->info;
>   
>         if (prev != -1) {
> -         nir_compact_varyings(shader_program->_LinkedShaders[prev]->Program->nir,
> +         struct gl_program *prev_shader =
> +            shader_program->_LinkedShaders[prev]->Program;
> +
> +         /* We can't use nir_compact_varyings with transform feedback, since
> +          * the pipe_stream_output->output_register field is based on the
> +          * pre-compacted driver_locations.
> +          */
> +         if (!prev_shader->sh.LinkedTransformFeedback)
> +            nir_compact_varyings(shader_program->_LinkedShaders[prev]->Program->nir,
>                                 nir, ctx->API != API_OPENGL_COMPAT);
>         }
>         prev = i;
> 


More information about the mesa-dev mailing list