microsoft/compiler: Truncate function names when needed
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 14 Feb 2022 17:13:41 +0000 (09:13 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Jun 2022 14:15:55 +0000 (14:15 +0000)
commitbd4c8f562c94ee17c1873b066c6a43ed19f28c97
tree0003cb64da2471ca2d8ca26be39082c6078cc2cc
parent69339066fc9c44a9dc0b779b5d0d36bc3fdb78b6
microsoft/compiler: Truncate function names when needed

DXIL metadata strings and function names have a limited size. Truncate
the name when they don't fit. This is a quick&dirty workaround since it
doesn't address the problem for all kind of strings, and doesn't ensure
there's no collision in the function names after the truncation. That's
not an issue right now because I don't think we have implementations
keeping more than one function (the entrypoint), but it might be a
problem at some point.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16961>
src/microsoft/compiler/dxil_module.c
src/microsoft/compiler/nir_to_dxil.c