glsl/linker: check against varying limit after unused varyings are eliminated
We counted even the varyings which were later eliminated, which was
suboptimal.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 3adcddd..6d73578 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1929,6 +1929,10 @@
while (do_dead_code(sh_next->ir, false))
;
+ /* This must be done after all dead varyings are eliminated. */
+ if (!check_against_varying_limit(ctx, prog, sh_next))
+ goto done;
+
next = i;
}