mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:🆑 Allow relative region offset for constructions.
This commit is contained in:
parent
19210277a2
commit
2f790baae0
1 changed files with 9 additions and 2 deletions
11
ircd/cl.cc
11
ircd/cl.cc
|
@ -2059,18 +2059,25 @@ ircd::cl::data::data(data &master,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cl_buffer_region region {0};
|
cl_buffer_region region {0};
|
||||||
region.origin = slice.second;
|
|
||||||
region.size = slice.first;
|
region.size = slice.first;
|
||||||
|
region.origin = master.offset() + slice.second;
|
||||||
|
|
||||||
if(!region.size)
|
if(!region.size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const auto root
|
||||||
|
{
|
||||||
|
master.master()?: master.handle
|
||||||
|
};
|
||||||
|
|
||||||
assert(aligned(region.origin, size_t(gart_page_size)));
|
assert(aligned(region.origin, size_t(gart_page_size)));
|
||||||
assert(padded(region.size, size_t(gart_page_size)));
|
assert(padded(region.size, size_t(gart_page_size)));
|
||||||
|
assert(root);
|
||||||
|
|
||||||
int err {CL_SUCCESS};
|
int err {CL_SUCCESS};
|
||||||
handle = clCreateSubBuffer
|
handle = clCreateSubBuffer
|
||||||
(
|
(
|
||||||
cl_mem(master.handle),
|
cl_mem(root),
|
||||||
cl_mem_flags{0},
|
cl_mem_flags{0},
|
||||||
type,
|
type,
|
||||||
®ion,
|
®ion,
|
||||||
|
|
Loading…
Reference in a new issue