0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd:🆑 Allow relative region offset for constructions.

This commit is contained in:
Jason Volk 2022-05-05 16:24:26 -07:00
parent 19210277a2
commit 2f790baae0

View file

@ -2059,18 +2059,25 @@ ircd::cl::data::data(data &master,
return;
cl_buffer_region region {0};
region.origin = slice.second;
region.size = slice.first;
region.origin = master.offset() + slice.second;
if(!region.size)
return;
const auto root
{
master.master()?: master.handle
};
assert(aligned(region.origin, size_t(gart_page_size)));
assert(padded(region.size, size_t(gart_page_size)));
assert(root);
int err {CL_SUCCESS};
handle = clCreateSubBuffer
(
cl_mem(master.handle),
cl_mem(root),
cl_mem_flags{0},
type,
&region,