glsl: Inline builtins in a separate pass
authorNeil Roberts <nroberts@igalia.com>
Tue, 15 Oct 2019 14:20:26 +0000 (16:20 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 24 Mar 2020 23:21:21 +0000 (23:21 +0000)
commite7434c0a0608383c13514210e805d15678af5722
tree19e4f28f0e047bd084628e992e3264ceb97ee2cb
parent1ee2ad584c95233b5cdbbed9fa5997533dc80276
glsl: Inline builtins in a separate pass

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.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
src/compiler/Makefile.sources
src/compiler/glsl/ast_function.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/ir_optimization.h
src/compiler/glsl/lower_builtins.cpp [new file with mode: 0644]
src/compiler/glsl/meson.build