From 90eae30bcb84d54dc871ddbb8355f729cf8fa900 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 31 Jan 2024 03:13:37 +0100 Subject: [PATCH] rusticl/mem: move pipe_image_host_access into Image Part-of: --- src/gallium/frontends/rusticl/core/memory.rs | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/memory.rs b/src/gallium/frontends/rusticl/core/memory.rs index 74bc7c94631..453cd551a4a 100644 --- a/src/gallium/frontends/rusticl/core/memory.rs +++ b/src/gallium/frontends/rusticl/core/memory.rs @@ -682,19 +682,6 @@ impl MemBase { pub fn is_mapped_ptr(&self, ptr: *mut c_void) -> bool { self.maps.lock().unwrap().contains_ptr(ptr) } - - pub fn pipe_image_host_access(&self) -> u16 { - // those flags are all mutually exclusive - (if bit_check(self.flags, CL_MEM_HOST_READ_ONLY) { - PIPE_IMAGE_ACCESS_READ - } else if bit_check(self.flags, CL_MEM_HOST_WRITE_ONLY) { - PIPE_IMAGE_ACCESS_WRITE - } else if bit_check(self.flags, CL_MEM_HOST_NO_ACCESS) { - 0 - } else { - PIPE_IMAGE_ACCESS_READ_WRITE - }) as u16 - } } impl Drop for MemBase { @@ -1347,6 +1334,19 @@ impl Image { Ok(ptr) } + pub fn pipe_image_host_access(&self) -> u16 { + // those flags are all mutually exclusive + (if bit_check(self.flags, CL_MEM_HOST_READ_ONLY) { + PIPE_IMAGE_ACCESS_READ + } else if bit_check(self.flags, CL_MEM_HOST_WRITE_ONLY) { + PIPE_IMAGE_ACCESS_WRITE + } else if bit_check(self.flags, CL_MEM_HOST_NO_ACCESS) { + 0 + } else { + PIPE_IMAGE_ACCESS_READ_WRITE + }) as u16 + } + pub fn read( &self, dst: *mut c_void,