glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say: "Recursion is not allowed, not even statically. Static recursion is present if the static function call graph of the program contains cycles." Recursion is detected and rejected both a compile-time and at link-time. The complie-time check happens to detect some cases that may be removed by various optimization passes. The spec doesn't seem to allow this, but other vendors (e.g., NVIDIA) appear to only check at link-time after all optimizations. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885 Reviewed-by:Paul Berry <stereotype441@gmail.com> Reviewed-by:
Eric Anholt <eric@anholt.net> Reviewed-by:
Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 02c5ae1b) This also squashes in the following commit to make sure that bisects in scons builds work: glsl: Add ir_function_detect_recursion.cpp to SConscript. (cherry picked from commit 76bccaff)
Showing
- src/glsl/Makefile 1 addition, 0 deletionssrc/glsl/Makefile
- src/glsl/SConscript 1 addition, 0 deletionssrc/glsl/SConscript
- src/glsl/ast_to_hir.cpp 2 additions, 0 deletionssrc/glsl/ast_to_hir.cpp
- src/glsl/ir.h 26 additions, 0 deletionssrc/glsl/ir.h
- src/glsl/ir_function_detect_recursion.cpp 371 additions, 0 deletionssrc/glsl/ir_function_detect_recursion.cpp
- src/glsl/linker.cpp 4 additions, 0 deletionssrc/glsl/linker.cpp
Loading
Please register or sign in to comment