OSDN Git Service

glsl/linker: Fix unmatched TCS outputs being reduced to local variable
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Wed, 2 Jan 2019 13:55:08 +0000 (15:55 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 14 Mar 2019 19:07:30 +0000 (19:07 +0000)
Always match TCS outputs since they are shared by all invocations
within the patch and should not be converted to local variables.

This is one of the issues found in Downward.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104297
(cherry picked from commit 9f29d90327e343f5717a98ceb6df2cdbab5d0e0b)

src/compiler/glsl/linker.cpp

index 17fe0a5..f7c9d56 100644 (file)
@@ -3181,6 +3181,12 @@ match_explicit_outputs_to_inputs(gl_linked_shader *producer,
          const unsigned idx = var->data.location - VARYING_SLOT_VAR0;
          if (explicit_locations[idx][var->data.location_frac] == NULL)
             explicit_locations[idx][var->data.location_frac] = var;
+
+         /* Always match TCS outputs. They are shared by all invocations
+          * within a patch and can be used as shared memory.
+          */
+         if (producer->Stage == MESA_SHADER_TESS_CTRL)
+            var->data.is_unmatched_generic_inout = 0;
       }
    }