diff options
author | Pierre Moreau <[email protected]> | 2020-05-05 13:13:19 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-07 11:05:04 +0000 |
commit | 38bbfd3a57d68abdc88a93b436eac9f30a397b0f (patch) | |
tree | 6b8225108b2d31a3a63a7d2794cb90dace70972f | |
parent | abc4a8285776dcded21d0b7f3035c9858d061611 (diff) |
clover/nir: Check the result of spirv_to_nir
Fixes: deb04adf2ae ("clover: add support for passing kernels as nir to the driver")
Signed-off-by: Pierre Moreau <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4901>
-rw-r--r-- | src/gallium/state_trackers/clover/nir/invocation.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/nir/invocation.cpp b/src/gallium/state_trackers/clover/nir/invocation.cpp index 87a98046cc1..46440d96e09 100644 --- a/src/gallium/state_trackers/clover/nir/invocation.cpp +++ b/src/gallium/state_trackers/clover/nir/invocation.cpp @@ -90,6 +90,11 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev, nir_shader *nir = spirv_to_nir(data, num_words, nullptr, 0, MESA_SHADER_KERNEL, name, &spirv_options, compiler_options); + if (!nir) { + r_log += "Translation from SPIR-V to NIR for kernel \"" + sym.name + + "\" failed.\n"; + throw build_error(); + } nir->info.cs.local_size_variable = true; nir_validate_shader(nir, "clover"); |