Mesa (main): d3d12: Delete make_resource_writeable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 8 21:13:47 UTC 2022


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

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Feb  7 20:36:18 2022 -0800

d3d12: Delete make_resource_writeable

This never did anything useful AFAICT since we didn't actually
suballocate buffers, and when this ended up being invoked it breaks
the ability to read back XFB data.

Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>

---

 src/gallium/drivers/d3d12/d3d12_draw.cpp     |  2 --
 src/gallium/drivers/d3d12/d3d12_resource.cpp | 37 ----------------------------
 src/gallium/drivers/d3d12/d3d12_resource.h   |  4 ---
 3 files changed, 43 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_draw.cpp b/src/gallium/drivers/d3d12/d3d12_draw.cpp
index d47422fc288..d49cdf62fb9 100644
--- a/src/gallium/drivers/d3d12/d3d12_draw.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_draw.cpp
@@ -1165,8 +1165,6 @@ d3d12_draw_vbo(struct pipe_context *pctx,
       struct d3d12_resource *so_buffer = d3d12_resource(target->base.buffer);
       struct d3d12_resource *fill_buffer = d3d12_resource(target->fill_buffer);
 
-      d3d12_resource_make_writeable(pctx, target->base.buffer);
-
       if (ctx->cmdlist_dirty & D3D12_DIRTY_STREAM_OUTPUT) {
          d3d12_batch_reference_resource(batch, so_buffer, true);
          d3d12_batch_reference_resource(batch, fill_buffer, true);
diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp
index ed6e55491f9..14851beb7bf 100644
--- a/src/gallium/drivers/d3d12/d3d12_resource.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp
@@ -1387,43 +1387,6 @@ d3d12_transfer_unmap(struct pipe_context *pctx,
    slab_free(&d3d12_context(pctx)->transfer_pool, ptrans);
 }
 
-void
-d3d12_resource_make_writeable(struct pipe_context *pctx,
-                              struct pipe_resource *pres)
-{
-   struct d3d12_context *ctx = d3d12_context(pctx);
-   struct d3d12_resource *res = d3d12_resource(pres);
-   struct d3d12_resource *dup_res;
-
-   if (!res->bo || !d3d12_bo_is_suballocated(res->bo))
-      return;
-
-   dup_res = d3d12_resource(pipe_buffer_create(pres->screen,
-                                               pres->bind & PIPE_BIND_STREAM_OUTPUT,
-                                               (pipe_resource_usage) pres->usage,
-                                               pres->width0));
-
-   if (res->valid_buffer_range.end > res->valid_buffer_range.start) {
-      struct pipe_box box;
-
-      box.x = res->valid_buffer_range.start;
-      box.y = 0;
-      box.z = 0;
-      box.width = res->valid_buffer_range.end - res->valid_buffer_range.start;
-      box.height = 1;
-      box.depth = 1;
-
-      d3d12_direct_copy(ctx, dup_res, 0, &box, res, 0, &box, PIPE_MASK_RGBAZS);
-   }
-
-   /* Move new BO to old resource */
-   d3d12_bo_unreference(res->bo);
-   res->bo = dup_res->bo;
-   d3d12_bo_reference(res->bo);
-
-   d3d12_resource_destroy(dup_res->base.b.screen, &dup_res->base.b);
-}
-
 void
 d3d12_context_resource_init(struct pipe_context *pctx)
 {
diff --git a/src/gallium/drivers/d3d12/d3d12_resource.h b/src/gallium/drivers/d3d12/d3d12_resource.h
index dc725f7cafa..ed7cb6565b8 100644
--- a/src/gallium/drivers/d3d12/d3d12_resource.h
+++ b/src/gallium/drivers/d3d12/d3d12_resource.h
@@ -121,10 +121,6 @@ d3d12_resource_wait_idle(struct d3d12_context *ctx,
                          struct d3d12_resource *res,
                          bool want_to_write);
 
-void
-d3d12_resource_make_writeable(struct pipe_context *pctx,
-                              struct pipe_resource *pres);
-
 void
 d3d12_screen_resource_init(struct pipe_screen *pscreen);
 



More information about the mesa-commit mailing list