use crate::api::icd::*;
use crate::core::device::*;
-use crate::core::format::*;
use crate::core::memory::*;
use crate::core::util::*;
use crate::impl_cl_type_trait;
use mesa_rust::pipe::resource::*;
use mesa_rust::pipe::screen::ResourceType;
+use mesa_rust_gen::*;
use mesa_rust_util::properties::Properties;
use rusticl_opencl_gen::*;
pub fn create_texture(
&self,
desc: &cl_image_desc,
- format: &cl_image_format,
+ format: pipe_format,
user_ptr: *mut c_void,
copy: bool,
res_type: ResourceType,
.try_into()
.map_err(|_| CL_OUT_OF_HOST_MEMORY)?;
let target = cl_mem_type_to_texture_target(desc.image_type);
- let format = format.to_pipe_format().unwrap();
let mut res = HashMap::new();
for dev in &self.devs {
use crate::api::icd::*;
use crate::core::device::*;
use crate::core::event::*;
-use crate::core::format::*;
use crate::core::memory::*;
use crate::core::program::*;
use crate::core::queue::*;
}
resource_info.push((res.clone(), arg.offset));
} else {
- let format = mem.image_format.to_pipe_format().unwrap();
+ let format = mem.pipe_format;
let (formats, orders) = if arg.kind == KernelArgType::Image {
iviews.push(res.pipe_image_view(format, false, app_img_info.as_ref()));
(&mut img_formats, &mut img_orders)
pub offset: usize,
pub host_ptr: *mut c_void,
pub image_format: cl_image_format,
+ pub pipe_format: pipe_format,
pub image_desc: cl_image_desc,
pub image_elem_size: u8,
pub props: Vec<cl_mem_properties>,
offset: 0,
host_ptr: host_ptr,
image_format: cl_image_format::default(),
+ pipe_format: pipe_format::PIPE_FORMAT_NONE,
image_desc: cl_image_desc::default(),
image_elem_size: 0,
props: props,
offset: offset,
host_ptr: host_ptr,
image_format: cl_image_format::default(),
+ pipe_format: pipe_format::PIPE_FORMAT_NONE,
image_desc: cl_image_desc::default(),
image_elem_size: 0,
props: Vec::new(),
ResourceType::Normal
};
+ let pipe_format = image_format.to_pipe_format().unwrap();
let texture = if parent.is_none() {
Some(context.create_texture(
&image_desc,
- image_format,
+ pipe_format,
host_ptr,
bit_check(flags, CL_MEM_COPY_HOST_PTR),
res_type,
offset: 0,
host_ptr: host_ptr,
image_format: *image_format,
+ pipe_format: pipe_format,
image_desc: api_image_desc,
image_elem_size: image_elem_size,
props: props,
r.depth(),
r.array_size(),
cl_mem_type_to_texture_target(self.image_desc.image_type),
- self.image_format.to_pipe_format().unwrap(),
+ self.pipe_format,
ResourceType::Staging,
)
.ok_or(CL_OUT_OF_RESOURCES)?;
// CL_DEPTH where it's just one value.
unsafe {
util_format_pack_rgba(
- self.image_format.to_pipe_format().unwrap(),
+ self.pipe_format,
new_pattern.as_mut_ptr().cast(),
pattern.as_ptr().cast(),
1,