glsl: Inline builtins in a separate pass

Graphics / Mesa 3D Graphics Library / Mesa - Neil Roberts [igalia.com] - 24 March 2020 23:21 EDT

Previously, the ir_call functions for builtin functions were replaced with the inline implementation immediately after being added to the instruction list. This patch replaces that with a separate pass that lowers them after the conversion from AST to IR is complete. This will be useful to be able to insert some handling for the precision lowering pass before the inlining. This needs to happen because the precision of the operations in the inlined implementation depends on the highest precision of all of the arguments to the call.

e7434c0a060 glsl: Inline builtins in a separate pass
src/compiler/Makefile.sources | 1 +
src/compiler/glsl/ast_function.cpp | 5 ---
src/compiler/glsl/glsl_parser_extras.cpp | 1 +
src/compiler/glsl/ir_optimization.h | 1 +
src/compiler/glsl/lower_builtins.cpp | 64 ++++++++++++++++++++++++++++++++
src/compiler/glsl/meson.build | 1 +
6 files changed, 68 insertions(+), 5 deletions(-)

Upstream: cgit.freedesktop.org


  • Share