Summary: | [glsl] GLSL compiler allows recursion | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | low | ||
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2011-02-03 16:04:42 UTC
We do need to fix this. Many GLSL compilers crash in the presence of recursion (ours probably does too at link-time). I'm not too worried about not generating a compile-time error for this. Because of that, I'm lowering the priority. Thanks for the test case, though. This should have been fixed on the 7.11 branch by: commit 7c98381ed4a2293c5797a2ff003584566a0ce762 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Mon Jul 11 10:46:01 2011 -0700 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 02c5ae1b3fef75d5c0a715313a69e6b95ebd5b95) 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 76bccaff0c54aed10ffbc7c7dc744f1708921409) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.