Mesa (main): dzn: Pass the right type to CreateCommandList() in the reset path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 12:50:44 UTC 2022


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Tue Apr 19 01:00:51 2022 -0700

dzn: Pass the right type to CreateCommandList() in the reset path

The Command allocator and command list type must match, but we
are forcing it to D3D12_COMMAND_LIST_TYPE_DIRECT in the reset path.

Fixes: a012b219640 ("microsoft: Initial vulkan-on-12 driver")
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16023>

---

 src/microsoft/vulkan/dzn_cmd_buffer.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/microsoft/vulkan/dzn_cmd_buffer.cpp b/src/microsoft/vulkan/dzn_cmd_buffer.cpp
index 155d705ecbf..2f379f809d9 100644
--- a/src/microsoft/vulkan/dzn_cmd_buffer.cpp
+++ b/src/microsoft/vulkan/dzn_cmd_buffer.cpp
@@ -207,6 +207,9 @@ static VkResult
 dzn_cmd_buffer_reset(dzn_cmd_buffer *cmdbuf)
 {
    dzn_device *device = container_of(cmdbuf->vk.base.device, dzn_device, vk);
+   const struct dzn_physical_device *pdev =
+      container_of(device->vk.physical, dzn_physical_device, vk);
+   const struct vk_command_pool *pool = cmdbuf->vk.pool;
 
    /* Reset the state */
    memset(&cmdbuf->state, 0, sizeof(cmdbuf->state));
@@ -255,7 +258,9 @@ dzn_cmd_buffer_reset(dzn_cmd_buffer *cmdbuf)
    cmdbuf->cmdlist->Release();
    cmdbuf->cmdlist = NULL;
    cmdbuf->cmdalloc->Reset();
-   if (FAILED(device->dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT,
+   D3D12_COMMAND_LIST_TYPE type =
+      pdev->queue_families[pool->queue_family_index].desc.Type;
+   if (FAILED(device->dev->CreateCommandList(0, type,
                                              cmdbuf->cmdalloc, NULL,
                                              IID_PPV_ARGS(&cmdbuf->cmdlist)))) {
       cmdbuf->error = vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);



More information about the mesa-commit mailing list