OSDN Git Service

st/nine: Implement nine_context_range_upload
authorAxel Davy <axel.davy@ens.fr>
Thu, 1 Dec 2016 21:44:06 +0000 (22:44 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:47:08 +0000 (23:47 +0100)
Will be used to upload buffers.

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

index d09dabc..57a5c74 100644 (file)
@@ -2692,6 +2692,17 @@ CSMT_ITEM_NO_WAIT(nine_context_clear_render_target,
     context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false);
 }
 
+CSMT_ITEM_NO_WAIT_WITH_COUNTER(nine_context_range_upload,
+                               ARG_BIND_RES(struct pipe_resource, res),
+                               ARG_VAL(unsigned, offset),
+                               ARG_VAL(unsigned, size),
+                               ARG_VAL(const void *, data))
+{
+    struct nine_context *context = &device->context;
+
+    context->pipe->buffer_subdata(context->pipe, res, 0, offset, size, data);
+}
+
 struct pipe_query *
 nine_context_create_query(struct NineDevice9 *device, unsigned query_type)
 {
index 6578be3..c0afbe0 100644 (file)
@@ -539,6 +539,14 @@ nine_context_clear_render_target(struct NineDevice9 *device,
                                  UINT width,
                                  UINT height);
 
+void
+nine_context_range_upload(struct NineDevice9 *device,
+                          unsigned *counter,
+                          struct pipe_resource *res,
+                          unsigned offset,
+                          unsigned size,
+                          const void *data);
+
 struct pipe_query *
 nine_context_create_query(struct NineDevice9 *device, unsigned query_type);