clover: handle libclc shader (v3)
authorDave Airlie <airlied@redhat.com>
Wed, 10 Apr 2019 00:24:46 +0000 (10:24 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 25 Sep 2020 20:09:08 +0000 (20:09 +0000)
commitf33b417652ceae711cc34601f51d62beec2d22f1
tree28bf968d64f00d332520d01407ef1f6e844a0fdc
parent14bc2dcaae0e08bd4d5a4406b6778feaeb01ce7c
clover: handle libclc shader (v3)

This works by taking the spirv produced by libclc which contains
a lot of mangled function entrypoints identified with LinkageAttribute decorations.

This patch just sets up clover to load the libclc blob and convert it to
library nir, and support inlining application nir with calls to libclc.

v2: Add a disk cache support for this object, to avoid the spirv parsing
overheads each time. move spirv->nir to lazy instantiation to avoid
the mess with glsl types and constructor ordering.
v3: make disk cache optional

v1-Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6035>
src/gallium/frontends/clover/core/device.cpp
src/gallium/frontends/clover/core/device.hpp
src/gallium/frontends/clover/meson.build
src/gallium/frontends/clover/nir/invocation.cpp
src/gallium/frontends/clover/nir/invocation.hpp
src/gallium/frontends/clover/spirv/invocation.cpp
src/gallium/frontends/clover/spirv/invocation.hpp