From 062c45ff0df6a52080dcd74433710d47127cbe29 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 15 May 2012 15:02:37 +0200 Subject: xserver mesa git update 15 May 2012 --- mesalib/src/glsl/linker.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mesalib/src/glsl/linker.cpp') 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. -- cgit v1.2.3