[Mesa-stable] [PATCH 2/3] glsl: TCS outputs can not be transform feedback candidates on GLES

Jose Maria Casanova Crespo jmcasanova at igalia.com
Wed Nov 21 18:45:08 UTC 2018


Fixes: KHR-GLES*.core.tessellation_shader.single.xfb_captures_data_from_correct_stage

Cc: mesa-stable at lists.freedesktop.org
---
I think this patch and the previous one should be squashed or interchange
the order before landing. I'm sending splitted because it allows exposing
the incorrect behaviour on GLES.

 src/compiler/glsl/link_varyings.cpp | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 1964dcc0a22..8bb90de8072 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -2502,10 +2502,31 @@ assign_varying_locations(struct gl_context *ctx,
 
          if (num_tfeedback_decls > 0) {
             tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates);
-            if (producer->Stage == MESA_SHADER_TESS_CTRL &&
-                !output_var->data.patch)
-               output_var->data.is_xfb_per_vertex_output = true;
-            g.process(output_var);
+
+            /* From OpenGL 4.6 (Core Profile) spec, section 11.1.2.1
+             * ("Vertex Shader Variables / Output Variables")
+             *
+             * "Each program object can specify a set of output variables from
+             * one shader to be recorded in transform feedback mode (see
+             * section 13.3). The variables that can be recorded are those
+             * emitted by the first active shader, in order, from the
+             * following list:
+             *
+             *  * geometry shader
+             *  * tessellation evaluation shader
+             *  * tessellation control shader
+             *  * vertex shader"
+             *
+             * But on OpenGL ES 3.2, section 11.1.2.1 ("Vertex Shader
+             * Variables / Output Variables") tessellation control shader is
+             * not included in the stages list.
+             */
+            if (!prog->IsES || producer->Stage != MESA_SHADER_TESS_CTRL) {
+               if (producer->Stage == MESA_SHADER_TESS_CTRL &&
+                   !output_var->data.patch)
+                  output_var->data.is_xfb_per_vertex_output = true;
+               g.process(output_var);
+            }
          }
 
          ir_variable *const input_var =
-- 
2.19.1



More information about the mesa-stable mailing list