diff options
author | Axel Davy <[email protected]> | 2016-12-01 22:50:22 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:47:08 +0100 |
commit | 16b6fb65ae03902f731b863802c094c4d854def1 (patch) | |
tree | c05658257d48a65a468ed26f50b13719b78ba584 /src/gallium/state_trackers/nine/buffer9.h | |
parent | a78b5f437865fc976154d226eb87b67ef2f098d2 (diff) |
st/nine: Optimize managed buffer upload
Do the upload in the other thread.
Usually managed buffers are used once per frame.
It is then very likely pending_upload is 0 at Lock
time.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/buffer9.h')
-rw-r--r-- | src/gallium/state_trackers/nine/buffer9.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/buffer9.h b/src/gallium/state_trackers/nine/buffer9.h index d8024e4aac2..e9ee31ef7f7 100644 --- a/src/gallium/state_trackers/nine/buffer9.h +++ b/src/gallium/state_trackers/nine/buffer9.h @@ -25,6 +25,7 @@ #define _NINE_BUFFER9_H_ #include "device9.h" +#include "nine_state.h" #include "resource9.h" #include "pipe/p_context.h" #include "pipe/p_state.h" @@ -57,6 +58,7 @@ struct NineBuffer9 struct pipe_box dirty_box; struct list_head list; /* for update_buffers */ struct list_head list2; /* for managed_buffers */ + unsigned pending_upload; /* for uploads */ } managed; }; static inline struct NineBuffer9 * @@ -92,13 +94,13 @@ NineBuffer9_Unlock( struct NineBuffer9 *This ); static inline void NineBuffer9_Upload( struct NineBuffer9 *This ) { - struct pipe_context *pipe = NineDevice9_GetPipe(This->base.base.device); + struct NineDevice9 *device = This->base.base.device; assert(This->base.pool == D3DPOOL_MANAGED && This->managed.dirty); - pipe->buffer_subdata(pipe, This->base.resource, 0, - This->managed.dirty_box.x, - This->managed.dirty_box.width, - (char *)This->managed.data + This->managed.dirty_box.x); + nine_context_range_upload(device, &This->managed.pending_upload, This->base.resource, + This->managed.dirty_box.x, + This->managed.dirty_box.width, + (char *)This->managed.data + This->managed.dirty_box.x); This->managed.dirty = FALSE; } |