gallium/u_threaded: increase batch size to increase performance
[mesa.git] / src / gallium / auxiliary / util / u_upload_mgr.h
index 54e839bbdff0249f5e56cebc6077ee95e1a4464d..a66b73655657d3c7daffef773202390c8c4ea6a1 100644 (file)
 #define U_UPLOAD_MGR_H
 
 #include "pipe/p_compiler.h"
+#include "pipe/p_defines.h"
 
 struct pipe_context;
 struct pipe_resource;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /**
  * Create the upload manager.
@@ -44,10 +48,26 @@ struct pipe_resource;
  * \param pipe          Pipe driver.
  * \param default_size  Minimum size of the upload buffer, in bytes.
  * \param bind          Bitmask of PIPE_BIND_* flags.
+ * \param usage         PIPE_USAGE_*
+ * \param flags         bitmask of PIPE_RESOURCE_FLAG_* flags.
+ */
+struct u_upload_mgr *
+u_upload_create(struct pipe_context *pipe, unsigned default_size,
+                unsigned bind, enum pipe_resource_usage usage, unsigned flags);
+
+/**
+ * Create the default uploader for pipe_context. Only pipe_context::screen
+ * needs to be set for this to succeed.
  */
-struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
-                                      unsigned default_size,
-                                      unsigned bind );
+struct u_upload_mgr *
+u_upload_create_default(struct pipe_context *pipe);
+
+/**
+ * Create an uploader with identical parameters as another one, but using
+ * the given pipe_context instead.
+ */
+struct u_upload_mgr *
+u_upload_clone(struct pipe_context *pipe, struct u_upload_mgr *upload);
 
 /**
  * Destroy the upload manager.
@@ -100,23 +120,8 @@ void u_upload_data(struct u_upload_mgr *upload,
                    unsigned *out_offset,
                    struct pipe_resource **outbuf);
 
-
-/**
- * Allocate space in an upload buffer and copy an input buffer to it.
- *
- * Same as u_upload_data, except that the input data comes from a buffer
- * instead of a user pointer.
- */
-void u_upload_buffer(struct u_upload_mgr *upload,
-                     unsigned min_out_offset,
-                     unsigned offset,
-                     unsigned size,
-                     unsigned alignment,
-                     struct pipe_resource *inbuf,
-                     unsigned *out_offset,
-                     struct pipe_resource **outbuf);
-
-
-
+#ifdef __cplusplus
+} // extern "C" {
 #endif
 
+#endif