aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/loop_unroll.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Detect do-while-false loops and unroll themIan Romanick2016-02-241-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously loops like do { // ... } while (false); that did not have any other loop-branch instructions would not be unrolled. This is commonly used to wrap multiline preprocessor macros. This produces IR like (loop ( ... break )) Since limiting_terminator was NULL, the loop unroller would throw up its hands and say, "I don't know how many iterations. How can I unroll this?" We can detect this another way. If there is no limiting_terminator and the only loop-branch is a break as the last IR, there's only one iteration. On my very old checkout of shader-db, this removes a loop from Orbital Explorer, but it does not otherwise affect the shader. The loop removed is the one the compiler inserts surrounding the switch statement. This change does prevent some seriously bad code generation in some patches to meta shaders that I recently sent out for review. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: move to compiler/Emil Velikov2016-01-261-0/+432
Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>