Mesa (10.3): linker: Assign varying locations geometry shader inputs for SSO

Emil Velikov evelikov at kemper.freedesktop.org
Sun Dec 21 19:11:55 UTC 2014


Module: Mesa
Branch: 10.3
Commit: 5878e18ac72b5070cfb5ca55959c111957eee3cf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5878e18ac72b5070cfb5ca55959c111957eee3cf

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Dec  1 14:07:30 2014 -0800

linker: Assign varying locations geometry shader inputs for SSO

Previously only geometry shader outputs would be assigned locations if
the geometry shader was the only stage in the linked program.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: pavol at klacansky.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
(cherry picked from commit a909b995d95892798a189818454905fdefd4bc9b)
Nominated-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/linker.cpp |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 9080f1a..000e580 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2738,6 +2738,21 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
    if (last >= 0 && last < MESA_SHADER_FRAGMENT) {
       gl_shader *const sh = prog->_LinkedShaders[last];
 
+      if (first == MESA_SHADER_GEOMETRY) {
+         /* There was no vertex shader, but we still have to assign varying
+          * locations for use by geometry shader inputs in SSO.
+          *
+          * If the shader is not separable (i.e., prog->SeparateShader is
+          * false), linking will have already failed when first is
+          * MESA_SHADER_GEOMETRY.
+          */
+         if (!assign_varying_locations(ctx, mem_ctx, prog,
+                                       NULL, sh,
+                                       num_tfeedback_decls, tfeedback_decls,
+                                       prog->Geom.VerticesIn))
+            goto done;
+      }
+
       if (num_tfeedback_decls != 0 || prog->SeparateShader) {
          /* There was no fragment shader, but we still have to assign varying
           * locations for use by transform feedback.




More information about the mesa-commit mailing list