summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2018-08-26 13:48:10 -0400
committerIlia Mirkin <[email protected]>2018-08-29 20:51:23 -0400
commit52a7297dc640a1ed1f9b111498091c5416afd9aa (patch)
treeec20e6e71f3f5b1d5adc5f0c43125746b15793f6 /src/compiler
parent3731233cba04e5bc133fa631db65738f9614d0b0 (diff)
glsl: avoid lowering texcoord array except in simple cases
With compat creeping up to geometry and tess shaders, lowering texcoord accesses/writes becomes more complicated. Since it's an optimization anyways, just avoid the complication for now. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/opt_dead_builtin_varyings.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/glsl/opt_dead_builtin_varyings.cpp b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
index 0cb04b34589..6ed00128ed9 100644
--- a/src/compiler/glsl/opt_dead_builtin_varyings.cpp
+++ b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
@@ -558,6 +558,9 @@ do_dead_builtin_varyings(struct gl_context *ctx,
if (producer) {
producer_info.get(producer->ir, num_tfeedback_decls, tfeedback_decls);
+ if (producer->Stage == MESA_SHADER_TESS_CTRL)
+ producer_info.lower_texcoord_array = false;
+
if (!consumer) {
/* At least eliminate unused gl_TexCoord elements. */
if (producer_info.lower_texcoord_array) {
@@ -570,6 +573,9 @@ do_dead_builtin_varyings(struct gl_context *ctx,
if (consumer) {
consumer_info.get(consumer->ir, 0, NULL);
+ if (consumer->Stage != MESA_SHADER_FRAGMENT)
+ consumer_info.lower_texcoord_array = false;
+
if (!producer) {
/* At least eliminate unused gl_TexCoord elements. */
if (consumer_info.lower_texcoord_array) {