rusticl/program: fix CL_PROGRAM_BINARIES for devs with no builds

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10611
Fixes: e028baa177 ("rusticl/program: implement clCreateProgramWithBinary")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27633>
(cherry picked from commit a4f77ce2d4)
This commit is contained in:
Karol Herbst 2024-02-15 13:57:33 +01:00 committed by Eric Engestrom
parent 8a338675c6
commit a85301784d
2 changed files with 7 additions and 2 deletions

View file

@ -3084,7 +3084,7 @@
"description": "rusticl/program: fix CL_PROGRAM_BINARIES for devs with no builds",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "e028baa1772eeaa55393b1d01d5e5fb217474f95",
"notes": null

View file

@ -505,7 +505,12 @@ impl Program {
for (i, d) in self.devs.iter().enumerate() {
let mut ptr = ptrs[i];
let info = lock.dev_build(d);
let spirv = info.spirv.as_ref().unwrap().to_bin();
// no spirv means nothing to write
let Some(spirv) = info.spirv.as_ref() else {
continue;
};
let spirv = spirv.to_bin();
unsafe {
// 1. binary format version