st/nine: Use nine_context for blit
authorPatrick Rudolph <siro@das-labor.org>
Thu, 27 Oct 2016 05:39:03 +0000 (07:39 +0200)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:23 +0000 (23:44 +0100)
Enables to offload it with CSMT.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/nine_state.c
src/gallium/state_trackers/nine/nine_state.h

index 7d4a2a9c4b0f0f94c2e4b15c1e85753784db2085..633bc3e31ea64453021833396ad1bec747727161 100644 (file)
@@ -1549,7 +1549,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
                          D3DTEXTUREFILTERTYPE Filter )
 {
     struct pipe_screen *screen = This->screen;
-    struct pipe_context *pipe = NineDevice9_GetPipe(This);
+    struct pipe_context *pipe;
     struct NineSurface9 *dst = NineSurface9(pDestSurface);
     struct NineSurface9 *src = NineSurface9(pSourceSurface);
     struct pipe_resource *dst_res = NineSurface9_GetResource(dst);
@@ -1722,7 +1722,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
                                                 PIPE_BIND_RENDER_TARGET),
                     D3DERR_INVALIDCALL);
 
-        pipe->blit(pipe, &blit);
+        nine_context_blit(This, &blit);
     } else {
         assert(blit.dst.box.x >= 0 && blit.dst.box.y >= 0 &&
                blit.src.box.x >= 0 && blit.src.box.y >= 0 &&
@@ -1732,6 +1732,7 @@ NineDevice9_StretchRect( struct NineDevice9 *This,
                blit.src.box.y + blit.src.box.height <= src->desc.Height);
         /* Or drivers might crash ... */
         DBG("Using resource_copy_region.\n");
+        pipe = NineDevice9_GetPipe(This);
         pipe->resource_copy_region(pipe,
             blit.dst.resource, blit.dst.level,
             blit.dst.box.x, blit.dst.box.y, blit.dst.box.z,
index 745b9d8c65b574132437966b96c8d47372fdc347..48a4c1396d4d710701a870e9fa2a1e7b195d1e78 100644 (file)
@@ -2583,6 +2583,14 @@ CSMT_ITEM_NO_WAIT(nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf,
     context->pipe->draw_vbo(context->pipe, &info);
 }
 
+CSMT_ITEM_NO_WAIT(nine_context_blit,
+                  ARG_BIND_BLIT(struct pipe_blit_info, blit))
+{
+    struct nine_context *context = &device->context;
+
+    context->pipe->blit(context->pipe, blit);
+}
+
 struct pipe_query *
 nine_context_create_query(struct NineDevice9 *device, unsigned query_type)
 {
index ee88a943ccd6a45e323042b64c9709d4f21bf1c9..62b2c134fe130455f92372eaaabab468b186b576 100644 (file)
@@ -517,6 +517,10 @@ nine_context_draw_indexed_primitive_from_vtxbuf_idxbuf(struct NineDevice9 *devic
                                                        struct pipe_vertex_buffer *vbuf,
                                                        struct pipe_index_buffer *ibuf);
 
+void
+nine_context_blit(struct NineDevice9 *device,
+                  struct pipe_blit_info *blit);
+
 struct pipe_query *
 nine_context_create_query(struct NineDevice9 *device, unsigned query_type);