summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
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/device9.c
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/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 91c4535a144..9f2575309a5 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -34,6 +34,7 @@
#include "texture9.h"
#include "cubetexture9.h"
#include "volumetexture9.h"
+#include "nine_buffer_upload.h"
#include "nine_helpers.h"
#include "nine_pipe.h"
#include "nine_ff.h"
@@ -282,6 +283,8 @@ NineDevice9_ctor( struct NineDevice9 *This,
if (This->csmt_active)
DBG("\033[1;32mCSMT is active\033[0m\n");
+ This->buffer_upload = nine_upload_create(This->pipe_secondary, 4 * 1024 * 1024, 4);
+
/* Initialize a dummy VBO to be used when a vertex declaration does not
* specify all the inputs needed by vertex shader, on win default behavior
* is to pass 0,0,0,0 to the shader */
@@ -571,6 +574,9 @@ NineDevice9_dtor( struct NineDevice9 *This )
FREE(This->swapchains);
}
+ if (This->buffer_upload)
+ nine_upload_destroy(This->buffer_upload);
+
/* Destroy cso first */
if (This->context.cso) { cso_destroy_context(This->context.cso); }
if (This->cso_sw) { cso_destroy_context(This->cso_sw); }