st/nine: Add secondary pipe for device
authorAxel Davy <axel.davy@ens.fr>
Thu, 3 Nov 2016 21:12:01 +0000 (22:12 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:23 +0000 (23:44 +0100)
The secondary pipe will be used for operations
that don't need synchronization.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/device9.h

index 2b60280c4ddd87a29b1cfe097d9252c5a72fe99c..271aa2b6b9f18e84314562d130457f23d25b3084 100644 (file)
@@ -193,7 +193,8 @@ NineDevice9_ctor( struct NineDevice9 *This,
         This->caps.MaxVertexShaderConst = NINE_MAX_CONST_F_SWVP;
 
     This->context.pipe = This->screen->context_create(This->screen, NULL, 0);
-    if (!This->context.pipe) { return E_OUTOFMEMORY; } /* guess */
+    This->pipe_secondary = This->screen->context_create(This->screen, NULL, 0);
+    if (!This->context.pipe || !This->pipe_secondary) { return E_OUTOFMEMORY; } /* guess */
     This->pipe_sw = This->screen_sw->context_create(This->screen_sw, NULL, 0);
     if (!This->pipe_sw) { return E_OUTOFMEMORY; }
 
@@ -574,6 +575,7 @@ NineDevice9_dtor( struct NineDevice9 *This )
     if (This->context.cso) { cso_destroy_context(This->context.cso); }
     if (This->cso_sw) { cso_destroy_context(This->cso_sw); }
     if (This->context.pipe && This->context.pipe->destroy) { This->context.pipe->destroy(This->context.pipe); }
+    if (This->pipe_secondary && This->pipe_secondary->destroy) { This->pipe_secondary->destroy(This->pipe_secondary); }
     if (This->pipe_sw && This->pipe_sw->destroy) { This->pipe_sw->destroy(This->pipe_sw); }
 
     if (This->present) { ID3DPresentGroup_Release(This->present); }
index 4539cda18a6687d215243d02b830cf50b4b86463..81c4ef97f417b3e2d2dea567496897f6afabb8fa 100644 (file)
@@ -53,6 +53,8 @@ struct NineDevice9
 
     /* G3D context */
     struct pipe_screen *screen;
+    /* For first time upload. No Sync with rendering thread */
+    struct pipe_context *pipe_secondary;
     struct pipe_screen *screen_sw;
     struct pipe_context *pipe_sw;
     struct cso_context *cso_sw;