nir: Add a printf lowering pass (v5)
authorJesse Natalie <jenatali@microsoft.com>
Fri, 14 Aug 2020 00:21:18 +0000 (17:21 -0700)
committerDave Airlie <airlied@redhat.com>
Mon, 28 Dec 2020 23:07:24 +0000 (09:07 +1000)
commit24669a672f331a10152f9a4d7deb6126a1106211
tree0491d32245a3f3d3608a8e79f7998203f9c911ef
parent9524e9dbd085734869af519ccbaae3a8ae85a312
nir: Add a printf lowering pass (v5)

This pass creates a SSBO var for the printf buffer. It does an atomic increment
at the beginning of the buffer to determine where to write, then dumps
the args after that.

v2: [airlied]
Enhanced to use an index into a set of format info that is passed
back to the caller. The format info contains the number of args,
argument sizes and the format string.

v3: move format string lowering to vtn

v4: Jason reworked it.

v5: assume buffer has initial offset prebaked in and work from there.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8254>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_intrinsics.py
src/compiler/nir/nir_lower_printf.c [new file with mode: 0644]