mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
rusticl/program: undefine __IMAGE_SUPPORT__ if images are unsupported
Signed-off-by: Karol Herbst <kherbst@redhat.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
This commit is contained in:
parent
c5a535a5ef
commit
a4c0f59b5f
1 changed files with 7 additions and 3 deletions
|
|
@ -42,7 +42,11 @@ struct ProgramDevBuild {
|
|||
log: String,
|
||||
}
|
||||
|
||||
fn prepare_options(options: &str) -> Vec<CString> {
|
||||
fn prepare_options(options: &str, dev: &Device) -> Vec<CString> {
|
||||
let mut options = options.to_owned();
|
||||
if !dev.image_supported() {
|
||||
options.push_str(" -U__IMAGE_SUPPORT__");
|
||||
}
|
||||
options
|
||||
.split_whitespace()
|
||||
.map(|a| match a {
|
||||
|
|
@ -126,7 +130,7 @@ impl Program {
|
|||
let mut info = self.build_info();
|
||||
let d = Self::dev_build_info(&mut info, dev);
|
||||
|
||||
let args = prepare_options(&options);
|
||||
let args = prepare_options(&options, dev);
|
||||
let (spirv, log) =
|
||||
spirv::SPIRVBin::from_clc(&self.src, &args, &Vec::new(), dev.cl_features());
|
||||
|
||||
|
|
@ -165,7 +169,7 @@ impl Program {
|
|||
) -> bool {
|
||||
let mut info = self.build_info();
|
||||
let d = Self::dev_build_info(&mut info, dev);
|
||||
let args = prepare_options(&options);
|
||||
let args = prepare_options(&options, dev);
|
||||
|
||||
let (spirv, log) = spirv::SPIRVBin::from_clc(&self.src, &args, headers, dev.cl_features());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue