mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
clover: support custom driver strides
This is required by llvmpipe as it sets explicit strides on buffers and textures. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
This commit is contained in:
parent
9583ce04db
commit
f2bdb69218
3 changed files with 11 additions and 8 deletions
|
|
@ -806,7 +806,7 @@ clEnqueueMapBuffer(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
|
|||
validate_object(q, mem, obj_origin, obj_pitch, region);
|
||||
validate_map_flags(mem, flags);
|
||||
|
||||
void *map = mem.resource_in(q).add_map(q, flags, blocking, obj_origin, region);
|
||||
auto *map = mem.resource_in(q).add_map(q, flags, blocking, obj_origin, region);
|
||||
|
||||
auto hev = create<hard_event>(q, CL_COMMAND_MAP_BUFFER, deps);
|
||||
if (blocking)
|
||||
|
|
@ -814,7 +814,7 @@ clEnqueueMapBuffer(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
|
|||
|
||||
ret_object(rd_ev, hev);
|
||||
ret_error(r_errcode, CL_SUCCESS);
|
||||
return map;
|
||||
return *map;
|
||||
|
||||
} catch (error &e) {
|
||||
ret_error(r_errcode, e);
|
||||
|
|
@ -844,7 +844,10 @@ clEnqueueMapImage(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
|
|||
if (img.slice_pitch() && !slice_pitch)
|
||||
throw error(CL_INVALID_VALUE);
|
||||
|
||||
void *map = img.resource_in(q).add_map(q, flags, blocking, origin, region);
|
||||
auto *map = img.resource_in(q).add_map(q, flags, blocking, origin, region);
|
||||
*row_pitch = map->pitch()[1];
|
||||
if (slice_pitch)
|
||||
*slice_pitch = map->pitch()[2];
|
||||
|
||||
auto hev = create<hard_event>(q, CL_COMMAND_MAP_IMAGE, deps);
|
||||
if (blocking)
|
||||
|
|
@ -852,7 +855,7 @@ clEnqueueMapImage(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
|
|||
|
||||
ret_object(rd_ev, hev);
|
||||
ret_error(r_errcode, CL_SUCCESS);
|
||||
return map;
|
||||
return *map;
|
||||
|
||||
} catch (error &e) {
|
||||
ret_error(r_errcode, e);
|
||||
|
|
|
|||
|
|
@ -79,11 +79,11 @@ resource::clear(command_queue &q, const vector &origin, const vector ®ion,
|
|||
}
|
||||
}
|
||||
|
||||
void *
|
||||
mapping *
|
||||
resource::add_map(command_queue &q, cl_map_flags flags, bool blocking,
|
||||
const vector &origin, const vector ®ion) {
|
||||
maps.emplace_back(q, *this, flags, blocking, origin, region);
|
||||
return maps.back();
|
||||
return &maps.back();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ namespace clover {
|
|||
void clear(command_queue &q, const vector &origin, const vector ®ion,
|
||||
const std::string &data);
|
||||
|
||||
void *add_map(command_queue &q, cl_map_flags flags, bool blocking,
|
||||
const vector &origin, const vector ®ion);
|
||||
mapping *add_map(command_queue &q, cl_map_flags flags, bool blocking,
|
||||
const vector &origin, const vector ®ion);
|
||||
void del_map(void *p);
|
||||
unsigned map_count() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue