aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-15 15:07:22 +0200
committermarha <marha@users.sourceforge.net>2012-05-15 15:07:22 +0200
commit9818207986d5db9831e43eb2a640be68f54bb2ef (patch)
treee1ac6d17b2da887a2110c1337f01fc6fbdfa68fd /mesalib/src/glsl/linker.cpp
parente6ff1fe09702cb307729b3208175c84f623f2968 (diff)
parent062c45ff0df6a52080dcd74433710d47127cbe29 (diff)
downloadvcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.tar.gz
vcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.tar.bz2
vcxsrv-9818207986d5db9831e43eb2a640be68f54bb2ef.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 6ba297237..bdab499f0 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -2296,6 +2296,17 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
prog->LinkStatus = true;
}
+ /* Implement the GLSL 1.30+ rule for discard vs infinite loops Do
+ * it before optimization because we want most of the checks to get
+ * dropped thanks to constant propagation.
+ */
+ if (max_version >= 130) {
+ struct gl_shader *sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
+ if (sh) {
+ lower_discard_flow(sh->ir);
+ }
+ }
+
/* Do common optimization before assigning storage for attributes,
* uniforms, and varyings. Later optimization could possibly make
* some of that unused.