d3d12: Add ID3D12GraphicsCommandList8 to the context
authorGiancarlo Devich <gdevich@microsoft.com>
Wed, 12 Apr 2023 17:56:35 +0000 (10:56 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 14 Apr 2023 03:19:22 +0000 (03:19 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22454>

src/gallium/drivers/d3d12/d3d12_batch.cpp
src/gallium/drivers/d3d12/d3d12_context.cpp
src/gallium/drivers/d3d12/d3d12_context.h

index ac096d7..357fc1d 100644 (file)
@@ -218,6 +218,9 @@ d3d12_start_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
          batch->has_errors = true;
          return;
       }
+      if (FAILED(ctx->cmdlist->QueryInterface(IID_PPV_ARGS(&ctx->cmdlist8)))) {
+         ctx->cmdlist8 = nullptr;
+      }
    }
 
    ctx->cmdlist->SetDescriptorHeaps(2, heaps);
index 08de834..0ba6abd 100644 (file)
@@ -93,6 +93,8 @@ d3d12_context_destroy(struct pipe_context *pctx)
    for (unsigned i = 0; i < ARRAY_SIZE(ctx->batches); ++i)
       d3d12_destroy_batch(ctx, &ctx->batches[i]);
    ctx->cmdlist->Release();
+   if (ctx->cmdlist8)
+      ctx->cmdlist8->Release();
    d3d12_descriptor_pool_free(ctx->sampler_pool);
    util_primconvert_destroy(ctx->primconvert);
    slab_destroy_child(&ctx->transfer_pool);
index 19b1720..148ba6d 100644 (file)
@@ -257,6 +257,7 @@ struct d3d12_context {
 
    uint64_t submit_id;
    ID3D12GraphicsCommandList *cmdlist;
+   ID3D12GraphicsCommandList8 *cmdlist8;
    ID3D12GraphicsCommandList *state_fixup_cmdlist;
 
    struct list_head active_queries;