diff options
author | Marek Olšák <[email protected]> | 2016-07-16 21:19:48 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-23 13:33:42 +0200 |
commit | 1ffe77e7bb2486ea74cda077ed2a9622b758395c (patch) | |
tree | 4a04818614fc8c4e086e9dcd32dbadecbac4b6fb /src/gallium/drivers/ddebug | |
parent | 0ba7288376dc66f932336862c8a6abb629b47686 (diff) |
gallium: split transfer_inline_write into buffer and texture callbacks
to reduce the call indirections with u_resource_vtbl.
The worst call tree you could get was:
- u_transfer_inline_write_vtbl
- u_default_transfer_inline_write
- u_transfer_map_vtbl
- driver_transfer_map
- u_transfer_unmap_vtbl
- driver_transfer_unmap
That's 6 indirect calls. Some drivers only had 5. The goal is to have
1 indirect call for drivers that care. The resource type can be determined
statically at most call sites.
The new interface is:
pipe_context::buffer_subdata(ctx, resource, usage, offset, size, data)
pipe_context::texture_subdata(ctx, resource, level, usage, box, data,
stride, layer_stride)
v2: fix whitespace, correct ilo's behavior
Reviewed-by: Nicolai Hähnle <[email protected]>
Acked-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ddebug')
-rw-r--r-- | src/gallium/drivers/ddebug/dd_context.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/gallium/drivers/ddebug/dd_context.c b/src/gallium/drivers/ddebug/dd_context.c index 98475b9fe99..c0b2b3ddd7e 100644 --- a/src/gallium/drivers/ddebug/dd_context.c +++ b/src/gallium/drivers/ddebug/dd_context.c @@ -599,17 +599,28 @@ dd_context_transfer_unmap(struct pipe_context *_pipe, } static void -dd_context_transfer_inline_write(struct pipe_context *_pipe, - struct pipe_resource *resource, - unsigned level, unsigned usage, - const struct pipe_box *box, - const void *data, unsigned stride, - unsigned layer_stride) +dd_context_buffer_subdata(struct pipe_context *_pipe, + struct pipe_resource *resource, + unsigned usage, unsigned offset, + unsigned size, const void *data) +{ + struct pipe_context *pipe = dd_context(_pipe)->pipe; + + pipe->buffer_subdata(pipe, resource, usage, offset, size, data); +} + +static void +dd_context_texture_subdata(struct pipe_context *_pipe, + struct pipe_resource *resource, + unsigned level, unsigned usage, + const struct pipe_box *box, + const void *data, unsigned stride, + unsigned layer_stride) { struct pipe_context *pipe = dd_context(_pipe)->pipe; - pipe->transfer_inline_write(pipe, resource, level, usage, box, data, - stride, layer_stride); + pipe->texture_subdata(pipe, resource, level, usage, box, data, + stride, layer_stride); } @@ -767,7 +778,8 @@ dd_context_create(struct dd_screen *dscreen, struct pipe_context *pipe) CTX_INIT(transfer_map); CTX_INIT(transfer_flush_region); CTX_INIT(transfer_unmap); - CTX_INIT(transfer_inline_write); + CTX_INIT(buffer_subdata); + CTX_INIT(texture_subdata); CTX_INIT(texture_barrier); CTX_INIT(memory_barrier); /* create_video_codec */ |