Mesa (master): mesa/st: Avoid extra references in the feedback draw function scope.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 26 07:00:50 UTC 2018


Module: Mesa
Branch: master
Commit: a00a8fb8d19e274c454c69cc0c88cec05d4d6e9a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a00a8fb8d19e274c454c69cc0c88cec05d4d6e9a

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Thu Nov  1 19:03:26 2018 +0100

mesa/st: Avoid extra references in the feedback draw function scope.

The change removes the reference that is held on the entries of the
vbuffers[] array. The new code does not do that anymore as following
the code into draw_set_vertex_buffers() the draw context holds an
other reference as long as it is reset down the function again.
So it should be already by that argument save to remove that
additional reference count.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

---

 src/mesa/state_tracker/st_draw_feedback.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 11097b4cac..82f2feb86e 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -185,7 +185,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
 
          vbuffers[attr].buffer.resource = NULL;
          vbuffers[attr].is_user_buffer = false;
-         pipe_resource_reference(&vbuffers[attr].buffer.resource, stobj->buffer);
+         vbuffers[attr].buffer.resource = stobj->buffer;
          vbuffers[attr].buffer_offset = _mesa_draw_binding_offset(binding);
          velements[attr].src_offset =
             _mesa_draw_attributes_relative_offset(attrib);
@@ -275,7 +275,6 @@ st_feedback_draw_vbo(struct gl_context *ctx,
       if (vb_transfer[attr])
          pipe_buffer_unmap(pipe, vb_transfer[attr]);
       draw_set_mapped_vertex_buffer(draw, attr, NULL, 0);
-      pipe_vertex_buffer_unreference(&vbuffers[attr]);
    }
    draw_set_vertex_buffers(draw, 0, vp->num_inputs, NULL);
 }




More information about the mesa-commit mailing list