rusticl/mem: move pipe_image_host_access into Image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27376>
This commit is contained in:
@@ -682,19 +682,6 @@ impl MemBase {
|
|||||||
pub fn is_mapped_ptr(&self, ptr: *mut c_void) -> bool {
|
pub fn is_mapped_ptr(&self, ptr: *mut c_void) -> bool {
|
||||||
self.maps.lock().unwrap().contains_ptr(ptr)
|
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 {
|
impl Drop for MemBase {
|
||||||
@@ -1347,6 +1334,19 @@ impl Image {
|
|||||||
Ok(ptr)
|
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(
|
pub fn read(
|
||||||
&self,
|
&self,
|
||||||
dst: *mut c_void,
|
dst: *mut c_void,
|
||||||
|
Reference in New Issue
Block a user