0
0
Fork 0
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:
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; 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,
&region, &region,