From c4210dec8a8cc7ecf881cd537556e778ca967b18 Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Thu, 6 Jul 2017 08:35:37 +0000 Subject: [PATCH] glsl: look up for transform feedback varyings after linking MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Check if shaders have transform feedback varyings also after the post-link step. This fixes: KHR-GL45.enhanced_layouts.xfb_vertex_streams piglit/spec/arb_enhanced_layouts/gs-stream-location-aliasing v2: add claryfing comments (Timothy) Reviewed-by: Marek Olšák Reviewed-by: Timothy Arceri --- src/compiler/glsl/glsl_to_nir.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 4b3dbcff17b..331438a1835 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -169,9 +169,16 @@ glsl_to_nir(const struct gl_shader_program *shader_prog, shader->info.name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name); if (shader_prog->Label) shader->info.label = ralloc_strdup(shader, shader_prog->Label); + + /* Check for transform feedback varyings specified via the API */ shader->info.has_transform_feedback_varyings = shader_prog->TransformFeedback.NumVarying > 0; + /* Check for transform feedback varyings specified in the Shader */ + if (shader_prog->last_vert_prog) + shader->info.has_transform_feedback_varyings |= + shader_prog->last_vert_prog->sh.LinkedTransformFeedback->NumVarying > 0; + return shader; } -- 2.30.2