#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.
* \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.
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