[Mesa-dev] [RFC PATCH] gallium: add a common uploader to pipe_context

Marek Olšák maraeo at gmail.com
Thu Jan 26 23:51:11 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

For lower memory usage and more efficient updates of the buffer residency
list. (e.g. if drivers keep seeing the same buffer for many consecutive
"add" calls, the calls can be turned into no-ops trivially)
---
 src/gallium/include/pipe/p_context.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 45098c9..5876968 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -69,33 +69,40 @@ struct pipe_stream_output_target;
 struct pipe_surface;
 struct pipe_transfer;
 struct pipe_vertex_buffer;
 struct pipe_vertex_element;
 struct pipe_video_buffer;
 struct pipe_video_codec;
 struct pipe_viewport_state;
 struct pipe_compute_state;
 union pipe_color_union;
 union pipe_query_result;
+struct u_upload_mgr;
 
 /**
  * Gallium rendering context.  Basically:
  *  - state setting functions
  *  - VBO drawing functions
  *  - surface functions
  */
 struct pipe_context {
    struct pipe_screen *screen;
 
    void *priv;  /**< context private data (for DRI for example) */
    void *draw;  /**< private, for draw module (temporary?) */
 
+   /**
+    * Stream uploader created by the driver. All drivers, state trackers, and
+    * modules should use it.
+    */
+   struct u_upload_mgr *stream_uploader;
+
    void (*destroy)( struct pipe_context * );
 
    /**
     * VBO drawing
     */
    /*@{*/
    void (*draw_vbo)( struct pipe_context *pipe,
                      const struct pipe_draw_info *info );
    /*@}*/
 
-- 
2.7.4



More information about the mesa-dev mailing list