diff --git a/src/gallium/auxiliary/postprocess/pp_run.c b/src/gallium/auxiliary/postprocess/pp_run.c index 565aab720a4..8f22667efc2 100644 --- a/src/gallium/auxiliary/postprocess/pp_run.c +++ b/src/gallium/auxiliary/postprocess/pp_run.c @@ -293,7 +293,7 @@ pp_filter_misc_state(struct pp_program *p) void pp_filter_draw(struct pp_program *p) { - util_draw_vertex_buffer(p->pipe, p->cso, p->vbuf, 0, + util_draw_vertex_buffer(p->pipe, p->cso, p->vbuf, 0, false, MESA_PRIM_QUADS, 4, 2); } diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c index a6c92deee00..06cedcf2739 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.c +++ b/src/gallium/auxiliary/util/u_draw_quad.c @@ -43,6 +43,7 @@ util_draw_vertex_buffer(struct pipe_context *pipe, struct cso_context *cso, struct pipe_resource *vbuf, unsigned offset, + bool vb_take_ownership, enum mesa_prim prim_type, unsigned num_verts, unsigned num_attribs) @@ -59,10 +60,10 @@ util_draw_vertex_buffer(struct pipe_context *pipe, /* note: vertex elements already set by caller */ if (cso) { - cso_set_vertex_buffers(cso, 1, false, &vbuffer); + cso_set_vertex_buffers(cso, 1, vb_take_ownership, &vbuffer); cso_draw_arrays(cso, prim_type, 0, num_verts); } else { - pipe->set_vertex_buffers(pipe, 1, false, &vbuffer); + pipe->set_vertex_buffers(pipe, 1, vb_take_ownership, &vbuffer); util_draw_arrays(pipe, prim_type, 0, num_verts); } } diff --git a/src/gallium/auxiliary/util/u_draw_quad.h b/src/gallium/auxiliary/util/u_draw_quad.h index c79bf40a3e3..af84ef0371c 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.h +++ b/src/gallium/auxiliary/util/u_draw_quad.h @@ -45,8 +45,8 @@ struct cso_velems_state; extern void util_draw_vertex_buffer(struct pipe_context *pipe, struct cso_context *cso, struct pipe_resource *vbuf, unsigned offset, - enum mesa_prim prim_type, unsigned num_attribs, - unsigned num_verts); + bool vb_take_ownership, enum mesa_prim prim_type, + unsigned num_attribs, unsigned num_verts); void util_draw_user_vertex_buffer(struct cso_context *cso, void *buffer, diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c index c07fa5ecc8a..2b93cd23806 100644 --- a/src/gallium/tests/trivial/quad-tex.c +++ b/src/gallium/tests/trivial/quad-tex.c @@ -337,7 +337,7 @@ static void draw(struct program *p) cso_set_vertex_elements(p->cso, &p->velem); util_draw_vertex_buffer(p->pipe, p->cso, - p->vbuf, 0, + p->vbuf, 0, false, MESA_PRIM_QUADS, 4, /* verts */ 2); /* attribs/vert */ diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c index 94572e80d25..4a3990d33e1 100644 --- a/src/gallium/tests/trivial/tri.c +++ b/src/gallium/tests/trivial/tri.c @@ -269,7 +269,7 @@ static void draw(struct program *p) cso_set_vertex_elements(p->cso, &p->velem); util_draw_vertex_buffer(p->pipe, p->cso, - p->vbuf, 0, + p->vbuf, 0, false, MESA_PRIM_TRIANGLES, 3, /* verts */ 2); /* attribs/vert */ diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 8c1e4217ccf..db938779aa6 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -297,7 +297,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, } util_draw_vertex_buffer(pipe, cso, vbuffer, - offset, /* offset */ + offset, false, MESA_PRIM_TRIANGLE_FAN, 4, /* verts */ numAttribs); /* attribs/vert */