[Mesa-dev] [PATCH] i965: Drop brw_bo_alloc in ARB_indirect_parameters implementation.

Plamena Manolova plamena.n.manolova at gmail.com
Wed Oct 11 13:58:20 UTC 2017


Hi Ken,
Sorry for missing this and thank you for catching it!

Reviewed-by: Plamena Manolova <plamena.manolova at intel.com>

On 11 Oct 2017 03:27, "Kenneth Graunke" <kenneth at whitecape.org> wrote:

The original implementation allocated a new BO here, but we decided to
switch to intel_upload_space, which returns a reference to the current
upload BO.  We accidentally kept the brw_bo_alloc, even though it's no
longer necessary - intel_upload_space will immediately unreference it,
causing us to allocate and immediately free a buffer.

Cc: Plamena Manolova <plamena.n.manolova at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c
b/src/mesa/drivers/dri/i965/brw_draw.c
index d6aa95b6f60..8f616e76c0d 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -903,7 +903,7 @@ brw_draw_prims(struct gl_context *ctx,
    for (i = 0; i < nr_prims; i++) {
       /* Implementation of ARB_indirect_parameters via predicates */
       if (brw->draw.draw_params_count_bo) {
-         struct brw_bo *draw_id_bo = brw_bo_alloc(brw->bufmgr, "draw_id",
4, 4);
+         struct brw_bo *draw_id_bo;
          uint32_t draw_id_offset;

          intel_upload_data(brw, &prims[i].draw_id, 4, 4, &draw_id_bo,
--
2.14.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171011/e13caf41/attachment.html>


More information about the mesa-dev mailing list