[Mesa-dev] [PATCH] glsl/linker: fix multiple streams transform feedback.

Timothy Arceri timothy.arceri at collabora.com
Tue May 31 04:38:57 UTC 2016


On Tue, 2016-05-31 at 12:54 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> e2791b38b42f83add5b07298c39741bf0a6d7d4b
> mesa/program_interface_query: fix transform feedback varyings.
> 
> caused a regression in
> GL45-
> CTS.gtf40.GL3Tests.transform_feedback3.transform_feedback3_multiple_s
> treams
> on radeonsi.
> 
> The problem was it was using the skip components varying to set
> the stream id, when it should wait until a varying was written,
> this just adds the varying checks in the right place.
> 
> Cc: "12.0" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Makes sense to me.

Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

> ---
>  src/compiler/glsl/link_varyings.cpp | 32 +++++++++++++++++--------
> -------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/src/compiler/glsl/link_varyings.cpp
> b/src/compiler/glsl/link_varyings.cpp
> index 34c8906..91a82f5 100644
> --- a/src/compiler/glsl/link_varyings.cpp
> +++ b/src/compiler/glsl/link_varyings.cpp
> @@ -1094,21 +1094,23 @@ store_tfeedback_info(struct gl_context *ctx,
> struct gl_shader_program *prog,
>              num_buffers++;
>              buffer_stream_id = -1;
>              continue;
> -         } else if (buffer_stream_id == -1)  {
> -            /* First varying writing to this buffer: remember its
> stream */
> -            buffer_stream_id = (int)
> tfeedback_decls[i].get_stream_id();
> -         } else if (buffer_stream_id !=
> -                    (int) tfeedback_decls[i].get_stream_id()) {
> -            /* Varying writes to the same buffer from a different
> stream */
> -            linker_error(prog,
> -                         "Transform feedback can't capture varyings
> belonging "
> -                         "to different vertex streams in a single
> buffer. "
> -                         "Varying %s writes to buffer from stream
> %u, other "
> -                         "varyings in the same buffer write from
> stream %u.",
> -                         tfeedback_decls[i].name(),
> -                         tfeedback_decls[i].get_stream_id(),
> -                         buffer_stream_id);
> -            return false;
> +         } else if (tfeedback_decls[i].is_varying()) {
> +            if (buffer_stream_id == -1)  {
> +               /* First varying writing to this buffer: remember its
> stream */
> +               buffer_stream_id = (int)
> tfeedback_decls[i].get_stream_id();
> +            } else if (buffer_stream_id !=
> +                       (int) tfeedback_decls[i].get_stream_id()) {
> +               /* Varying writes to the same buffer from a different
> stream */
> +               linker_error(prog,
> +                            "Transform feedback can't capture
> varyings belonging "
> +                            "to different vertex streams in a single
> buffer. "
> +                            "Varying %s writes to buffer from stream
> %u, other "
> +                            "varyings in the same buffer write from
> stream %u.",
> +                            tfeedback_decls[i].name(),
> +                            tfeedback_decls[i].get_stream_id(),
> +                            buffer_stream_id);
> +               return false;
> +            }
>           }
>  
>           if (has_xfb_qualifiers) {


More information about the mesa-dev mailing list