summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-11 12:48:52 +0200
committerNicolai Hähnle <[email protected]>2017-07-03 13:54:20 +0200
commitda506cce8ae8fd05b1f8e93ebed3009b8f176d59 (patch)
treea1dfbef0f8d7b2b7cac97bbc8736cc22aa67f8a9 /src/compiler/glsl
parent141d0831ff631d6405540bc42ec7f626f6400a72 (diff)
glsl: simplify disable_varying_optimizations_for_sso
We always have stage == first and stage == last when first == last, so drop the special case. Also rephrase the comment to make the logic clearer. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/linker.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 73ab8ff73cb..15295da97e4 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4517,24 +4517,17 @@ disable_varying_optimizations_for_sso(struct gl_shader_program *prog)
if (!sh)
continue;
- if (first == last) {
- /* For a single shader program only allow inputs to the vertex shader
- * and outputs from the fragment shader to be removed.
- */
- if (stage != MESA_SHADER_VERTEX)
- set_always_active_io(sh->ir, ir_var_shader_in);
- if (stage != MESA_SHADER_FRAGMENT)
- set_always_active_io(sh->ir, ir_var_shader_out);
- } else {
- /* For multi-stage separate shader programs only allow inputs and
- * outputs between the shader stages to be removed as well as inputs
- * to the vertex shader and outputs from the fragment shader.
- */
- if (stage == first && stage != MESA_SHADER_VERTEX)
- set_always_active_io(sh->ir, ir_var_shader_in);
- else if (stage == last && stage != MESA_SHADER_FRAGMENT)
- set_always_active_io(sh->ir, ir_var_shader_out);
- }
+ /* Prevent the removal of inputs to the first and outputs from the last
+ * stage, unless they are the initial pipeline inputs or final pipeline
+ * outputs, respectively.
+ *
+ * The removal of IO between shaders in the same program is always
+ * allowed.
+ */
+ if (stage == first && stage != MESA_SHADER_VERTEX)
+ set_always_active_io(sh->ir, ir_var_shader_in);
+ if (stage == last && stage != MESA_SHADER_FRAGMENT)
+ set_always_active_io(sh->ir, ir_var_shader_out);
}
}