mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
rusticl/mem: use helper context for COPY_HOST_PTR buffers
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
fe8789e674
commit
3baf270316
1 changed files with 8 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ impl Mem {
|
|||
size: usize,
|
||||
host_ptr: *mut c_void,
|
||||
) -> CLResult<Arc<Mem>> {
|
||||
if bit_check(flags, CL_MEM_COPY_HOST_PTR | CL_MEM_ALLOC_HOST_PTR) {
|
||||
if bit_check(flags, CL_MEM_ALLOC_HOST_PTR) {
|
||||
println!("host ptr semantics not implemented!");
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +83,13 @@ impl Mem {
|
|||
context.create_buffer(size)
|
||||
}?;
|
||||
|
||||
if bit_check(flags, CL_MEM_COPY_HOST_PTR) {
|
||||
for (d, r) in &buffer {
|
||||
d.helper_ctx()
|
||||
.buffer_subdata(r, 0, host_ptr, size.try_into().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
let host_ptr = if bit_check(flags, CL_MEM_USE_HOST_PTR) {
|
||||
host_ptr
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue