Pierre Moreau <pierre.mor...@free.fr> writes:

> 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.mor...@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);
> +            }

Since this is a valid condition according to the API spec I'd prefer to
assert that dev.ir_format() is one of the supported values until
upstream LLVM supports SPIRV as target.

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

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to