d3d12: Delete make_resource_writeable
authorJesse Natalie <jenatali@microsoft.com>
Tue, 8 Feb 2022 04:36:18 +0000 (20:36 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 8 Feb 2022 20:36:29 +0000 (20:36 +0000)
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@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14933>

src/gallium/drivers/d3d12/d3d12_draw.cpp
src/gallium/drivers/d3d12/d3d12_resource.cpp
src/gallium/drivers/d3d12/d3d12_resource.h

index d47422f..d49cdf6 100644 (file)
@@ -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);
index ed6e554..14851be 100644 (file)
@@ -1388,43 +1388,6 @@ d3d12_transfer_unmap(struct pipe_context *pctx,
 }
 
 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)
 {
    pctx->buffer_map = d3d12_transfer_map;
index dc725f7..ed7cb65 100644 (file)
@@ -122,10 +122,6 @@ d3d12_resource_wait_idle(struct d3d12_context *ctx,
                          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);
 
 void