Skip to content

nir: add lower_calls_to_builtins pass

Alyssa Rosenzweig requested to merge alyssa/mesa:nir/lower-builtin into main

nir_builder for the GPU

/*
 * Lower calls to functions prefixed "nir_*" to the NIR ALU instruction or
 * intrinsic represented. This matches functions of the form:
 *
 *    nir_[op name](__optional mangling suffix)
 *
 * These functions return a value if the instruction has a destination. They
 * take all instruction sources as parameters, followed by parameters for each
 * ordered intrinsic index if any.
 *
 * Mangling allows for multiple definitions of the same instruction with
 * different vector lengths and bit sizes. This could be combined with
 * __attribute_((overloadable)) for seamless overloads.
 *
 * In effect, this pass re-implements nir_builder dynamically. This exposes
 * low-level hardware intrinsics to internal driver programs. It is intended for
 * use with internal OpenCL but should theoretically work for GLSL too.
 */

This also switches Asahi to use the new pass (which should work for everyone), instead of hardcoding the lowerings. Contains !32208 (merged) as a prerequisite for the switch.

Merge request reports

Loading