diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index 32cccdcb58a..9acb6b463fe 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -106,9 +106,9 @@ impl DeviceCaps { Self { has_images: has_images, has_timestamp: cap_timestamp && timer_resolution > 0, - image_2d_size: has_images.then_some(image_2d_size).unwrap_or_default(), - max_read_images: has_images.then_some(max_read_images).unwrap_or_default(), - max_write_images: has_images.then_some(max_write_images).unwrap_or_default(), + image_2d_size: if has_images { image_2d_size } else { 0 }, + max_read_images: if has_images { max_read_images } else { 0 }, + max_write_images: if has_images { max_write_images } else { 0 }, timer_resolution: timer_resolution, has_create_fence_fd: ctx.is_create_fence_fd_supported(), ..Default::default() diff --git a/src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs b/src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs index 9f84f67d4e9..c8ac6f67614 100644 --- a/src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs +++ b/src/gallium/frontends/rusticl/mesa/compiler/clc/spirv.rs @@ -258,18 +258,16 @@ impl SPIRVBin { .iter() .map(|a| SPIRVKernelArg { // SAFETY: we have a valid C string pointer here - name: a - .name - .is_null() - .not() - .then(|| unsafe { CStr::from_ptr(a.name) }.to_owned()) - .unwrap_or_default(), - type_name: a - .type_name - .is_null() - .not() - .then(|| unsafe { CStr::from_ptr(a.type_name) }.to_owned()) - .unwrap_or_default(), + name: if !a.name.is_null() { + unsafe { CStr::from_ptr(a.name) }.to_owned() + } else { + Default::default() + }, + type_name: if !a.type_name.is_null() { + unsafe { CStr::from_ptr(a.type_name) }.to_owned() + } else { + Default::default() + }, access_qualifier: clc_kernel_arg_access_qualifier(a.access_qualifier), address_qualifier: a.address_qualifier, type_qualifier: clc_kernel_arg_type_qualifier(a.type_qualifier),