summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/buffer9.h
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-12-04 20:34:59 +0100
committerAxel Davy <[email protected]>2016-12-20 23:47:08 +0100
commitbad7f7cc638391acc93f070fce3e1b7035dc48f8 (patch)
treedfc3dc7cad2a96efa3b131a803294c5599330d41 /src/gallium/state_trackers/nine/buffer9.h
parent8960be0e939bc6c0f9f34c5d4a16891af7e325fd (diff)
st/nine: Implement new buffer upload path
This new buffer upload path enables to lock faster than the normal path when using DISCARD/NOOVERWRITE. v2: Diverse cleanups and fixes. v3: Fix allocation size for 'lone' buffers and add more debug info. v4: Rewrite of the path to handle when DISCARD/NOOVERWRITE is not used anymore. The resource content is copied to the new resource used. v5: flush for safety after unmap (not sure it is really required here, but safer to flush). v6: Do not use the path if persistent coherent mapping is unavailable. Fix buffer creation flags. v7: Do not flush since it is not needed. 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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/buffer9.h b/src/gallium/state_trackers/nine/buffer9.h
index e9ee31ef7f7..b04a0a721bb 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_buffer_upload.h"
#include "nine_state.h"
#include "resource9.h"
#include "pipe/p_context.h"
@@ -38,6 +39,8 @@ struct pipe_transfer;
struct NineTransfer {
struct pipe_transfer *transfer;
bool is_pipe_secondary;
+ struct nine_subbuffer *buf; /* NULL unless subbuffer are used */
+ bool should_destroy_buf; /* If the subbuffer should be destroyed */
};
struct NineBuffer9
@@ -50,6 +53,10 @@ struct NineBuffer9
UINT size;
int16_t bind_count; /* to Device9->state.stream */
+ /* Whether only discard and nooverwrite were used so far
+ * for this buffer. Allows some optimization. */
+ boolean discard_nooverwrite_only;
+ struct nine_subbuffer *buf;
/* Specific to managed buffers */
struct {
@@ -79,7 +86,7 @@ void
NineBuffer9_dtor( struct NineBuffer9 *This );
struct pipe_resource *
-NineBuffer9_GetResource( struct NineBuffer9 *This );
+NineBuffer9_GetResource( struct NineBuffer9 *This, unsigned *offset );
HRESULT NINE_WINAPI
NineBuffer9_Lock( struct NineBuffer9 *This,