util: Move u_debug to utils
[mesa.git] / src / gallium / auxiliary / util / u_transfer.h
index e3a38730f214aea837b80e5a4fbd180cc76973c7..14084983daf984d1dde97f42756670150d2f1231 100644 (file)
 struct pipe_context;
 struct winsys_handle;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 boolean u_default_resource_get_handle(struct pipe_screen *screen,
-                                     struct pipe_resource *resource,
-                                     struct winsys_handle *handle);
-
-void u_default_transfer_inline_write( struct pipe_context *pipe,
-                             struct pipe_resource *resource,
-                             struct pipe_subresource sr,
-                             unsigned usage,
-                             const struct pipe_box *box,
-                             const void *data,
-                             unsigned stride,
-                             unsigned slice_stride);
+                                      struct pipe_resource *resource,
+                                      struct winsys_handle *handle);
+
+void u_default_buffer_subdata(struct pipe_context *pipe,
+                              struct pipe_resource *resource,
+                              unsigned usage, unsigned offset,
+                              unsigned size, const void *data);
+
+void u_default_texture_subdata(struct pipe_context *pipe,
+                               struct pipe_resource *resource,
+                               unsigned level,
+                               unsigned usage,
+                               const struct pipe_box *box,
+                               const void *data,
+                               unsigned stride,
+                               unsigned layer_stride);
 
 void u_default_transfer_flush_region( struct pipe_context *pipe,
-                                     struct pipe_transfer *transfer,
-                                     const struct pipe_box *box);
-
-unsigned u_default_is_resource_referenced( struct pipe_context *pipe,
-                                          struct pipe_resource *resource,
-                                          unsigned face, unsigned level);
-
-struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
-                                             struct pipe_resource *resource,
-                                             struct pipe_subresource sr,
-                                             unsigned usage,
-                                             const struct pipe_box *box);
+                                      struct pipe_transfer *transfer,
+                                      const struct pipe_box *box);
 
 void u_default_transfer_unmap( struct pipe_context *pipe,
-                              struct pipe_transfer *transfer );
-
-void u_default_transfer_destroy(struct pipe_context *pipe,
-                               struct pipe_transfer *transfer);
+                               struct pipe_transfer *transfer );
 
 
 
@@ -51,96 +47,60 @@ void u_default_transfer_destroy(struct pipe_context *pipe,
 struct u_resource_vtbl {
 
    boolean (*resource_get_handle)(struct pipe_screen *,
-                                 struct pipe_resource *tex,
-                                 struct winsys_handle *handle);
+                                  struct pipe_resource *tex,
+                                  struct winsys_handle *handle);
 
    void (*resource_destroy)(struct pipe_screen *,
-                           struct pipe_resource *pt);
+                            struct pipe_resource *pt);
 
-   unsigned (*is_resource_referenced)(struct pipe_context *pipe,
-                                     struct pipe_resource *texture,
-                                     unsigned face, unsigned level);
+   void *(*transfer_map)(struct pipe_context *,
+                         struct pipe_resource *resource,
+                         unsigned level,
+                         unsigned usage,
+                         const struct pipe_box *,
+                         struct pipe_transfer **);
 
-   struct pipe_transfer *(*get_transfer)(struct pipe_context *,
-                                        struct pipe_resource *resource,
-                                        struct pipe_subresource,
-                                        unsigned usage,
-                                        const struct pipe_box *);
-
-   void (*transfer_destroy)(struct pipe_context *,
-                           struct pipe_transfer *);
-
-   void *(*transfer_map)( struct pipe_context *,
-                         struct pipe_transfer *transfer );
 
    void (*transfer_flush_region)( struct pipe_context *,
-                                 struct pipe_transfer *transfer,
-                                 const struct pipe_box *);
+                                  struct pipe_transfer *transfer,
+                                  const struct pipe_box *);
 
    void (*transfer_unmap)( struct pipe_context *,
-                          struct pipe_transfer *transfer );
-
-   void (*transfer_inline_write)( struct pipe_context *pipe,
-                                 struct pipe_resource *resource,
-                                 struct pipe_subresource sr,
-                                 unsigned usage,
-                                 const struct pipe_box *box,
-                                 const void *data,
-                                 unsigned stride,
-                                 unsigned slice_stride);
+                           struct pipe_transfer *transfer );
 };
 
 
 struct u_resource {
    struct pipe_resource b;
-   struct u_resource_vtbl *vtbl;
+   const struct u_resource_vtbl *vtbl;
 };
 
 
 boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
-                             struct pipe_resource *resource,
-                             struct winsys_handle *handle);
+                                   struct pipe_context *ctx,
+                                   struct pipe_resource *resource,
+                                   struct winsys_handle *handle,
+                                   unsigned usage);
 
 void u_resource_destroy_vtbl(struct pipe_screen *screen,
-                       struct pipe_resource *resource);
-
-unsigned u_is_resource_referenced_vtbl( struct pipe_context *pipe,
-                                       struct pipe_resource *resource,
-                                       unsigned face, unsigned level);
-
-struct pipe_transfer *u_get_transfer_vtbl(struct pipe_context *context,
-                                    struct pipe_resource *resource,
-                                    struct pipe_subresource sr,
-                                    unsigned usage,
-                                    const struct pipe_box *box);
+                             struct pipe_resource *resource);
 
-void u_transfer_destroy_vtbl(struct pipe_context *pipe,
-                       struct pipe_transfer *transfer);
-
-void *u_transfer_map_vtbl( struct pipe_context *pipe,
-                     struct pipe_transfer *transfer );
+void *u_transfer_map_vtbl(struct pipe_context *context,
+                          struct pipe_resource *resource,
+                          unsigned level,
+                          unsigned usage,
+                          const struct pipe_box *box,
+                          struct pipe_transfer **transfer);
 
 void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
-                             struct pipe_transfer *transfer,
-                             const struct pipe_box *box);
+                                   struct pipe_transfer *transfer,
+                                   const struct pipe_box *box);
 
 void u_transfer_unmap_vtbl( struct pipe_context *rm_ctx,
-                      struct pipe_transfer *transfer );
-
-void u_transfer_inline_write_vtbl( struct pipe_context *rm_ctx,
-                                  struct pipe_resource *resource,
-                                  struct pipe_subresource sr,
-                                  unsigned usage,
-                                  const struct pipe_box *box,
-                                  const void *data,
-                                  unsigned stride,
-                                  unsigned slice_stride);
-
-
-
-
-
-
+                            struct pipe_transfer *transfer );
 
+#ifdef __cplusplus
+} // extern "C" {
+#endif
 
 #endif