summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-09-09 02:04:00 +0200
committerMarek Olšák <[email protected]>2016-09-16 22:35:08 +0200
commitae0a4a1299f649ff550a0dfd59d60fc8b91df54f (patch)
treec24aa6ace2ca65de617d74e5d71829d6a6175a8f /src/compiler/glsl/link_varyings.cpp
parentd58a3906cba57b12035f6ec7a3da80edc6929d6f (diff)
glsl: remove interpolateAt* instructions for demoted inputs
This fixes 8 fs-interpolateat* piglit crashes on radeonsi, because it can't handle non-input operands in interpolateAt*. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 8c436c2f440..e622b3e46bc 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -593,6 +593,11 @@ remove_unused_shader_inputs_and_outputs(bool is_separate_shader_object,
*/
if (var->data.is_unmatched_generic_inout && !var->data.is_xfb_only) {
assert(var->data.mode != ir_var_temporary);
+
+ /* Assign zeros to demoted inputs to allow more optimizations. */
+ if (var->data.mode == ir_var_shader_in && !var->constant_value)
+ var->constant_value = ir_constant::zero(var, var->type);
+
var->data.mode = ir_var_auto;
}
}