[Mesa-dev] [PATCH v2 12/22] clover: Refuse to compile source code to SPIR-V

Karol Herbst kherbst at redhat.com
Tue Jan 23 07:29:30 UTC 2018


On Tue, Jan 23, 2018 at 1:33 AM, Pierre Moreau <pierre.morrow at free.fr> wrote:
> Creating a program using clCreateProgramWithSource to SPIR-V requires a
> non-upstreamed version of LLVM and clang, therefore it is currently not
> supported.
>
> Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
>  src/gallium/state_trackers/clover/core/program.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
> index ae4b50a879..15d559cd93 100644
> --- a/src/gallium/state_trackers/clover/core/program.cpp
> +++ b/src/gallium/state_trackers/clover/core/program.cpp
> @@ -51,6 +51,10 @@ program::compile(const ref_vector<device> &devs, const std::string &opts,
>           std::string log;
>
>           try {
> +            if (dev.ir_format() == PIPE_SHADER_IR_SPIRV) {
> +               log = "Compiling from source to SPIR-V is not supported yet\n";
> +               throw error(CL_INVALID_DEVICE);
> +            }

this fails whenever the preferred IR is NIR, because clover ends up
using llvm then. We need much a better way on handling this in general
like stated in my reply to the cover letter.

>              const module m = (dev.ir_format() == PIPE_SHADER_IR_TGSI ?
>                                tgsi::compile_program(_source, log) :
>                                llvm::compile_program(_source, headers,
> --
> 2.16.0
>


More information about the mesa-dev mailing list