Mesa (master): gallium/u_upload: add u_upload_clone
Marek Olšák
mareko at kemper.freedesktop.org
Mon May 15 11:05:22 UTC 2017
Module: Mesa
Branch: master
Commit: dca19b1d427f0ecbc0bbd530d1fc3f6c0ce2b5c1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dca19b1d427f0ecbc0bbd530d1fc3f6c0ce2b5c1
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sat Feb 18 23:01:14 2017 +0100
gallium/u_upload: add u_upload_clone
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
---
src/gallium/auxiliary/util/u_upload_mgr.c | 7 +++++++
src/gallium/auxiliary/util/u_upload_mgr.h | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 32697b8eda..9528495038 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -97,6 +97,13 @@ u_upload_create_default(struct pipe_context *pipe)
PIPE_USAGE_STREAM);
}
+struct u_upload_mgr *
+u_upload_clone(struct pipe_context *pipe, struct u_upload_mgr *upload)
+{
+ return u_upload_create(pipe, upload->default_size, upload->bind,
+ upload->usage);
+}
+
static void upload_unmap_internal(struct u_upload_mgr *upload, boolean destroying)
{
if (!destroying && upload->map_persistent)
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index 4538291702..536467eb35 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -62,6 +62,13 @@ 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.
*/
void u_upload_destroy( struct u_upload_mgr *upload );
More information about the mesa-commit
mailing list