On 02/01/2017 02:23 PM, Brian Paul wrote:
On 01/27/2017 04:00 AM, Marek Olšák wrote:
On Fri, Jan 27, 2017 at 10:05 AM, Nicolai Hähnle <nhaeh...@gmail.com>
wrote:
On 27.01.2017 00:51, Marek Olšák wrote:
From: Marek Olšák <marek.ol...@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)
This makes sense to me, but how are you planning to deal with the bind
flags? They are currently set differently for different upload mgrs. We
should probably do away with them entirely anyway.
Drivers can set the bind flags they need. Some drivers will set all 3
bind flags. Other drivers don't have to set any.
I need to look into this part more closely. I think we may have trouble
mixing constants with index/vertex data in our VMware driver...
Marek,
Your patch series, as-is, did indeed cause trouble with our VMware
driver. We need to keep constants in a separate buffer.
The good news is I don't think this is a huge problem and I've updated
(a subset of) your patches to accommodate both your needs and ours.
The basic idea is to add a pipe_context::get_stream_uploader() hook that
allows drivers to use just one or separate uploaders for
vertex/index/constant data. Plus, I added a
pipe_context::unmap_stream_uploaders() helper, but this isn't strictly
necessary.
WIP patch attached (only lightly tested). Let me know what you think.
-Brian
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index cfef1f0..11662e7 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -86,6 +86,15 @@ u_upload_create(struct pipe_context *pipe, unsigned default_size,
return upload;
}
+struct u_upload_mgr *
+u_upload_create_default(struct pipe_context *pipe)
+{
+ return u_upload_create(pipe, 1024 * 1024,
+ PIPE_BIND_VERTEX_BUFFER |
+ PIPE_BIND_INDEX_BUFFER |
+ PIPE_BIND_CONSTANT_BUFFER,
+ PIPE_USAGE_STREAM);
+}
static void upload_unmap_internal(struct u_upload_mgr *upload, boolean destroying)
{
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index b36e9e5..fcd6235 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -52,6 +52,13 @@ u_upload_create(struct pipe_context *pipe, unsigned default_size,
unsigned bind, enum pipe_resource_usage usage);
/**
+ * 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_default(struct pipe_context *pipe);
+
+/**
* Destroy the upload manager.
*/
void u_upload_destroy( struct u_upload_mgr *upload );
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 532e7c0..a16045c 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -146,7 +146,8 @@ struct u_vbuf {
struct pipe_context *pipe;
struct translate_cache *translate_cache;
struct cso_cache *cso_cache;
- struct u_upload_mgr *uploader;
+ struct u_upload_mgr *index_uploader;
+ struct u_upload_mgr *vertex_uploader;
/* This is what was set in set_vertex_buffers.
* May contain user buffers. */
@@ -314,9 +315,10 @@ u_vbuf_create(struct pipe_context *pipe,
mgr->translate_cache = translate_cache_create();
memset(mgr->fallback_vbs, ~0, sizeof(mgr->fallback_vbs));
- mgr->uploader = u_upload_create(pipe, 1024 * 1024,
- PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STREAM);
+ mgr->vertex_uploader =
+ pipe->get_stream_uploader(pipe, PIPE_BIND_VERTEX_BUFFER);
+ mgr->index_uploader =
+ pipe->get_stream_uploader(pipe, PIPE_BIND_INDEX_BUFFER);
return mgr;
}
@@ -390,7 +392,6 @@ void u_vbuf_destroy(struct u_vbuf *mgr)
pipe_resource_reference(&mgr->aux_vertex_buffer_saved.buffer, NULL);
translate_cache_destroy(mgr->translate_cache);
- u_upload_destroy(mgr->uploader);
cso_cache_delete(mgr->cso_cache);
FREE(mgr);
}
@@ -454,7 +455,7 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
assert((ib->buffer || ib->user_buffer) && ib->index_size);
/* Create and map the output buffer. */
- u_upload_alloc(mgr->uploader, 0,
+ u_upload_alloc(mgr->index_uploader, 0,
key->output_stride * num_indices, 4,
&out_offset, &out_buffer,
(void**)&out_map);
@@ -486,7 +487,7 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
}
} else {
/* Create and map the output buffer. */
- u_upload_alloc(mgr->uploader,
+ u_upload_alloc(mgr->vertex_uploader,
key->output_stride * start_vertex,
key->output_stride * num_vertices, 4,
&out_offset, &out_buffer,
@@ -990,7 +991,7 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
real_vb = &mgr->real_vertex_buffer[i];
ptr = mgr->vertex_buffer[i].user_buffer;
- u_upload_data(mgr->uploader, start, end - start, 4, ptr + start,
+ u_upload_data(mgr->vertex_uploader, start, end - start, 4, ptr + start,
&real_vb->buffer_offset, &real_vb->buffer);
if (!real_vb->buffer)
return PIPE_ERROR_OUT_OF_MEMORY;
@@ -1295,7 +1296,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info)
}
*/
- u_upload_unmap(mgr->uploader);
+ pipe->unmap_stream_uploaders(pipe);
u_vbuf_set_driver_vertex_buffers(mgr);
pipe->draw_vbo(pipe, &new_info);
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 178a8f0..febdbb7 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -37,6 +37,7 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/simple_list.h"
+#include "util/u_upload_mgr.h"
#include "lp_clear.h"
#include "lp_context.h"
#include "lp_flush.h"
@@ -62,6 +63,9 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
util_blitter_destroy(llvmpipe->blitter);
}
+ if (llvmpipe->stream_uploader)
+ u_upload_destroy(llvmpipe->stream_uploader);
+
/* This will also destroy llvmpipe->setup:
*/
if (llvmpipe->draw)
@@ -127,6 +131,24 @@ llvmpipe_render_condition ( struct pipe_context *pipe,
llvmpipe->render_cond_cond = condition;
}
+
+static struct u_upload_mgr *
+llvmpipe_get_stream_uploader(struct pipe_context *pipe, unsigned resource_type)
+{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+ assert(llvmpipe->stream_uploader);
+ return llvmpipe->stream_uploader;
+}
+
+
+static void
+llvmpipe_unmap_stream_uploaders(struct pipe_context *pipe)
+{
+ struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
+ u_upload_unmap(llvmpipe->stream_uploader);
+}
+
+
struct pipe_context *
llvmpipe_create_context(struct pipe_screen *screen, void *priv,
unsigned flags)
@@ -154,6 +176,8 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
llvmpipe->pipe.set_framebuffer_state = llvmpipe_set_framebuffer_state;
llvmpipe->pipe.clear = llvmpipe_clear;
llvmpipe->pipe.flush = do_flush;
+ llvmpipe->pipe.get_stream_uploader = llvmpipe_get_stream_uploader;
+ llvmpipe->pipe.unmap_stream_uploaders = llvmpipe_unmap_stream_uploaders;
llvmpipe->pipe.render_condition = llvmpipe_render_condition;
@@ -195,6 +219,11 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
if (!llvmpipe->setup)
goto fail;
+ /* One stream uploader for all resource types */
+ llvmpipe->stream_uploader = u_upload_create_default(&llvmpipe->pipe);
+ if (!llvmpipe->stream_uploader)
+ goto fail;
+
llvmpipe->blitter = util_blitter_create(&llvmpipe->pipe);
if (!llvmpipe->blitter) {
goto fail;
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index 4c09be2..8801523 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -52,6 +52,7 @@ struct lp_blend_state;
struct lp_setup_context;
struct lp_setup_variant;
struct lp_velems_state;
+struct u_upload_mgr;
struct llvmpipe_context {
struct pipe_context pipe; /**< base class */
@@ -99,6 +100,8 @@ struct llvmpipe_context {
unsigned dirty; /**< Mask of LP_NEW_x flags */
+ struct u_upload_mgr *stream_uploader;
+
/** Mapped vertex buffers */
ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 323f74f..85687d2 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -37,6 +37,7 @@
#include "util/u_memory.h"
#include "util/u_pstipple.h"
#include "util/u_inlines.h"
+#include "util/u_upload_mgr.h"
#include "tgsi/tgsi_exec.h"
#include "sp_buffer.h"
#include "sp_clear.h"
@@ -86,6 +87,9 @@ softpipe_destroy( struct pipe_context *pipe )
if (softpipe->quad.pstipple)
softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
+ if (softpipe->stream_uploader)
+ u_upload_destroy(softpipe->stream_uploader);
+
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
@@ -187,6 +191,22 @@ softpipe_render_condition( struct pipe_context *pipe,
}
+static struct u_upload_mgr *
+softpipe_get_stream_uploader(struct pipe_context *pipe, unsigned resource_type)
+{
+ struct softpipe_context *softpipe = softpipe_context( pipe );
+ assert(softpipe->stream_uploader);
+ return softpipe->stream_uploader;
+}
+
+
+static void
+softpipe_unmap_stream_uploaders(struct pipe_context *pipe)
+{
+ struct softpipe_context *softpipe = softpipe_context( pipe );
+ u_upload_unmap(softpipe->stream_uploader);
+}
+
struct pipe_context *
softpipe_create_context(struct pipe_screen *screen,
@@ -241,7 +261,10 @@ softpipe_create_context(struct pipe_screen *screen,
softpipe->pipe.texture_barrier = softpipe_texture_barrier;
softpipe->pipe.memory_barrier = softpipe_memory_barrier;
softpipe->pipe.render_condition = softpipe_render_condition;
-
+
+ softpipe->pipe.get_stream_uploader = softpipe_get_stream_uploader;
+ softpipe->pipe.unmap_stream_uploaders = softpipe_unmap_stream_uploaders;
+
/*
* Alloc caches for accessing drawing surfaces and textures.
* Must be before quad stage setup!
@@ -267,6 +290,10 @@ softpipe_create_context(struct pipe_screen *screen,
softpipe->quad.blend = sp_quad_blend_stage(softpipe);
softpipe->quad.pstipple = sp_quad_polygon_stipple_stage(softpipe);
+ /* One stream uploader for all resource types */
+ softpipe->stream_uploader = u_upload_create_default(&softpipe->pipe);
+ if (!softpipe->stream_uploader)
+ goto fail;
/*
* Create drawing context and plug our rendering stage into it.
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index a57f587..cba2ecf 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -56,6 +56,7 @@ struct sp_fragment_shader;
struct sp_vertex_shader;
struct sp_velems_state;
struct sp_so_state;
+struct u_upload_mgr;
struct softpipe_context {
struct pipe_context pipe; /**< base class */
@@ -113,6 +114,8 @@ struct softpipe_context {
uint64_t occlusion_count;
unsigned active_query_count;
+ struct u_upload_mgr *stream_uploader;
+
/** Mapped vertex buffers */
ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index 5274f02..f4f7738 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -103,6 +103,9 @@ svga_destroy(struct pipe_context *pipe)
util_bitmask_destroy(svga->stream_output_id_bm);
util_bitmask_destroy(svga->query_id_bm);
u_upload_destroy(svga->const0_upload);
+ u_upload_destroy(svga->const_uploader);
+ u_upload_destroy(svga->vertex_uploader);
+ u_upload_destroy(svga->index_uploader);
svga_texture_transfer_map_upload_destroy(svga);
/* free user's constant buffers */
@@ -116,6 +119,54 @@ svga_destroy(struct pipe_context *pipe)
}
+static struct u_upload_mgr *
+svga_get_stream_uploader(struct pipe_context *pipe, unsigned resource_type)
+{
+ struct svga_context *svga = svga_context(pipe);
+
+ switch (resource_type) {
+ case PIPE_BIND_CONSTANT_BUFFER:
+ if (!svga->const_uploader) {
+ svga->const_uploader =
+ u_upload_create(pipe, 1024 * 1024, resource_type, PIPE_USAGE_STREAM);
+ }
+ return svga->const_uploader;
+ case PIPE_BIND_VERTEX_BUFFER:
+ if (!svga->vertex_uploader) {
+ svga->vertex_uploader =
+ u_upload_create(pipe, 1024 * 1024, resource_type, PIPE_USAGE_STREAM);
+ }
+ return svga->vertex_uploader;
+ case PIPE_BIND_INDEX_BUFFER:
+ if (!svga->index_uploader) {
+ svga->index_uploader =
+ u_upload_create(pipe, 1024 * 1024, resource_type, PIPE_USAGE_STREAM);
+ }
+ return svga->index_uploader;
+ default:
+ assert(!"Unexpected resource_type argument");
+ return NULL;
+ }
+}
+
+
+static void
+svga_unmap_stream_uploaders(struct pipe_context *pipe)
+{
+ struct svga_context *svga = svga_context(pipe);
+
+ if (svga->const_uploader) {
+ u_upload_unmap(svga->const_uploader);
+ }
+ if (svga->vertex_uploader) {
+ u_upload_unmap(svga->vertex_uploader);
+ }
+ if (svga->index_uploader) {
+ u_upload_unmap(svga->index_uploader);
+ }
+}
+
+
struct pipe_context *
svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags)
{
@@ -134,6 +185,8 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags)
svga->pipe.screen = screen;
svga->pipe.priv = priv;
svga->pipe.destroy = svga_destroy;
+ svga->pipe.get_stream_uploader = svga_get_stream_uploader;
+ svga->pipe.unmap_stream_uploaders = svga_unmap_stream_uploaders;
svga->swc = svgascreen->sws->context_create(svgascreen->sws);
if (!svga->swc)
@@ -286,6 +339,13 @@ cleanup:
if (svga->const0_upload)
u_upload_destroy(svga->const0_upload);
+ if (svga->const_uploader)
+ u_upload_destroy(svga->const_uploader);
+ if (svga->vertex_uploader)
+ u_upload_destroy(svga->vertex_uploader);
+ if (svga->index_uploader)
+ u_upload_destroy(svga->index_uploader);
+
svga_texture_transfer_map_upload_destroy(svga);
if (svga->hwtnl)
svga_hwtnl_destroy(svga->hwtnl);
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 88221aa..b943a41 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -436,6 +436,9 @@ struct svga_context
struct u_upload_mgr *const0_upload;
struct u_upload_mgr *tex_upload;
+ /* uploaders returned by pipe_context::get_stream_uploader() */
+ struct u_upload_mgr *const_uploader, *vertex_uploader, *index_uploader;
+
struct {
boolean no_swtnl;
boolean force_swtnl;
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 171dc57..487bf79 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -76,6 +76,7 @@ struct pipe_viewport_state;
struct pipe_compute_state;
union pipe_color_union;
union pipe_query_result;
+struct u_upload_mgr;
/**
* Gallium rendering context. Basically:
@@ -89,6 +90,20 @@ struct pipe_context {
void *priv; /**< context private data (for DRI for example) */
void *draw; /**< private, for draw module (temporary?) */
+ /**
+ * Get a stream uploader for the given type of resource.
+ * resource_type may be one of PIPE_BIND_VERTEX_BUFFER,
+ * PIPE_BIND_INDEX_BUFFER, or PIPE_BIND_CONSTANT_BUFFER. Some drivers may
+ * return a single uploader for all resource types.
+ * The idea is to allow drivers, state trackers and utility modules to use
+ * the same upload manager(s) instead of a bunch of private/separate ones.
+ */
+ struct u_upload_mgr * (*get_stream_uploader)(struct pipe_context *,
+ unsigned resource_type);
+
+ /* Unmap any/all stream uploaders (typically done prior to rendering) */
+ void (*unmap_stream_uploaders)(struct pipe_context *);
+
void (*destroy)( struct pipe_context * );
/**
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 457c416..9d3669a 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -717,7 +717,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
vb.stride = sizeof(struct st_util_vertex);
- u_upload_alloc(st->uploader, 0, num_vert_bytes, 4,
+ u_upload_alloc(st->vertexbuf_uploader, 0, num_vert_bytes, 4,
&vb.buffer_offset, &vb.buffer, (void **) &verts);
/* build quads vertex data */
@@ -789,7 +789,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
ctx->Current.RasterPos[1] += ymove;
}
- u_upload_unmap(st->uploader);
+ pipe->unmap_stream_uploaders(pipe);
cso_set_vertex_buffers(st->cso_context,
cso_get_aux_vertex_buffer_slot(st->cso_context),
diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c
index 85f9a53..a0b9293 100644
--- a/src/mesa/state_tracker/st_cb_drawtex.c
+++ b/src/mesa/state_tracker/st_cb_drawtex.c
@@ -156,7 +156,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
GLfloat *vbuf = NULL;
GLuint tex_attr;
- u_upload_alloc(st->uploader, 0,
+ u_upload_alloc(st->vertexbuf_uploader, 0,
numAttribs * 4 * 4 * sizeof(GLfloat), 4,
&offset, &vbuffer, (void **) &vbuf);
if (!vbuffer) {
@@ -228,7 +228,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
}
}
- u_upload_unmap(st->uploader);
+ pipe->unmap_stream_uploaders(pipe);
#undef SET_ATTRIB
}
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index f4ea1b4..5cf04b9 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -302,14 +302,6 @@ st_destroy_context_priv(struct st_context *st)
}
}
- u_upload_destroy(st->uploader);
- if (st->indexbuf_uploader) {
- u_upload_destroy(st->indexbuf_uploader);
- }
- if (st->constbuf_uploader) {
- u_upload_destroy(st->constbuf_uploader);
- }
-
/* free glDrawPixels cache data */
free(st->drawpix_cache.image);
pipe_resource_reference(&st->drawpix_cache.texture, NULL);
@@ -398,19 +390,18 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
/* Create upload manager for vertex data for glBitmap, glDrawPixels,
* glClear, etc.
*/
- st->uploader = u_upload_create(pipe, 65536, PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STREAM);
+ st->vertexbuf_uploader =
+ pipe->get_stream_uploader(pipe, PIPE_BIND_VERTEX_BUFFER);
if (!screen->get_param(screen, PIPE_CAP_USER_INDEX_BUFFERS)) {
- st->indexbuf_uploader = u_upload_create(pipe, 128 * 1024,
- PIPE_BIND_INDEX_BUFFER,
- PIPE_USAGE_STREAM);
+ st->indexbuf_uploader =
+ pipe->get_stream_uploader(pipe, PIPE_BIND_INDEX_BUFFER);
}
- if (!screen->get_param(screen, PIPE_CAP_USER_CONSTANT_BUFFERS))
- st->constbuf_uploader = u_upload_create(pipe, 128 * 1024,
- PIPE_BIND_CONSTANT_BUFFER,
- PIPE_USAGE_STREAM);
+ if (!screen->get_param(screen, PIPE_CAP_USER_CONSTANT_BUFFERS)) {
+ st->constbuf_uploader =
+ pipe->get_stream_uploader(pipe, PIPE_BIND_CONSTANT_BUFFER);
+ }
st->cso_context = cso_create_context(pipe);
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 79c40bb..22ba773 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -68,7 +68,8 @@ struct st_context
struct pipe_context *pipe;
- struct u_upload_mgr *uploader, *indexbuf_uploader, *constbuf_uploader;
+ struct u_upload_mgr *vertexbuf_uploader, *indexbuf_uploader,
+ *constbuf_uploader;
struct draw_context *draw; /**< For selection/feedback/rastpos only */
struct draw_stage *feedback_stage; /**< For GL_FEEDBACK rendermode */
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index c1a1d2d..4e3685b 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -413,13 +413,14 @@ st_draw_quad(struct st_context *st,
const float *color,
unsigned num_instances)
{
+ struct pipe_context *pipe = st->pipe;
struct pipe_vertex_buffer vb = {0};
struct st_util_vertex *verts;
vb.stride = sizeof(struct st_util_vertex);
- u_upload_alloc(st->uploader, 0, 4 * sizeof(struct st_util_vertex), 4,
- &vb.buffer_offset, &vb.buffer, (void **) &verts);
+ u_upload_alloc(st->vertexbuf_uploader, 0, 4 * sizeof(struct st_util_vertex),
+ 4, &vb.buffer_offset, &vb.buffer, (void **) &verts);
if (!vb.buffer) {
return false;
}
@@ -468,7 +469,7 @@ st_draw_quad(struct st_context *st,
verts[3].s = s0;
verts[3].t = t1;
- u_upload_unmap(st->uploader);
+ pipe->unmap_stream_uploaders(pipe);
/* At the time of writing, cso_get_aux_vertex_buffer_slot() always returns
* zero. If that ever changes we need to audit the calls to that function
diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c
index a9ea6ea..300a829 100644
--- a/src/mesa/state_tracker/st_pbo.c
+++ b/src/mesa/state_tracker/st_pbo.c
@@ -190,6 +190,7 @@ bool
st_pbo_draw(struct st_context *st, const struct st_pbo_addresses *addr,
unsigned surface_width, unsigned surface_height)
{
+ struct pipe_context *pipe = st->pipe;
struct cso_context *cso = st->cso_context;
/* Setup vertex and geometry shaders */
@@ -229,7 +230,7 @@ st_pbo_draw(struct st_context *st, const struct st_pbo_addresses *addr,
vbo.buffer = NULL;
vbo.stride = 2 * sizeof(float);
- u_upload_alloc(st->uploader, 0, 8 * sizeof(float), 4,
+ u_upload_alloc(st->vertexbuf_uploader, 0, 8 * sizeof(float), 4,
&vbo.buffer_offset, &vbo.buffer, (void **) &verts);
if (!verts)
return false;
@@ -243,7 +244,7 @@ st_pbo_draw(struct st_context *st, const struct st_pbo_addresses *addr,
verts[6] = x1;
verts[7] = y1;
- u_upload_unmap(st->uploader);
+ pipe->unmap_stream_uploaders(pipe);
velem.src_offset = 0;
velem.instance_divisor = 0;
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev