Commit ef726459 authored by Pierre Moreau's avatar Pierre Moreau Committed by Dylan Baker

clover/nir: Check the result of spirv_to_nir

Fixes: deb04adf ("clover: add support for passing kernels as nir to the driver")
Signed-off-by: Pierre Moreau's avatarPierre Moreau <dev@pmoreau.org>
Reviewed-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
Part-of: <!4901>
(cherry picked from commit 38bbfd3a)
parent 1d1d5836
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
"description": "clover/nir: Check the result of spirv_to_nir", "description": "clover/nir: Check the result of spirv_to_nir",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"master_sha": null, "master_sha": null,
"because_sha": "deb04adf2ae605a017d7ce4e81f57db679567dfa" "because_sha": "deb04adf2ae605a017d7ce4e81f57db679567dfa"
}, },
...@@ -90,6 +90,11 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev, ...@@ -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, nir_shader *nir = spirv_to_nir(data, num_words, nullptr, 0,
MESA_SHADER_KERNEL, name, MESA_SHADER_KERNEL, name,
&spirv_options, compiler_options); &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->info.cs.local_size_variable = true;
nir_validate_shader(nir, "clover"); nir_validate_shader(nir, "clover");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment