Module: vkd3d
Branch: master
Commit: a0ebcce39863a9d72930d0ecffa783782375c8a7
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=a0ebcce39863a9d72930d0e…
Author: Hans-Kristian Arntzen <post(a)arntzen-software.no>
Date: Tue Oct 1 16:01:55 2019 +0200
vkd3d: Do not use RESET_COMMAND_BUFFERS_BIT.
By setting this flag, command pools cannot efficiently pool allocations.
This flag should be set to 0 so only the VkCommandPool may be reset.
This matches D3D12 API.
Signed-off-by: Hans-Kristian Arntzen <post(a)arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
libs/vkd3d/command.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index 2d6d02d..d420863 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -1723,7 +1723,10 @@ static HRESULT d3d12_command_allocator_init(struct d3d12_command_allocator *allo
command_pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
command_pool_info.pNext = NULL;
- command_pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
+ /* Do not use RESET_COMMAND_BUFFER_BIT. This allows the CommandPool to be a D3D12-style command pool.
+ * Memory is owned by the pool and CommandBuffers become lightweight handles,
+ * assuming a half-decent driver implementation. */
+ command_pool_info.flags = 0;
command_pool_info.queueFamilyIndex = queue->vk_family_index;
if ((vr = VK_CALL(vkCreateCommandPool(device->vk_device, &command_pool_info, NULL,
Module: vkd3d
Branch: master
Commit: 3c86b2341caabd6302b83efd0562910bd5b85d56
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=3c86b2341caabd6302b83ef…
Author: Hans-Kristian Arntzen <post(a)arntzen-software.no>
Date: Tue Oct 1 16:01:54 2019 +0200
vkd3d: Do not release resources in vkResetCommandPool.
D3D12 command allocators are intended to recycle memory across resets,
so we should do the same thing in vkd3d.
Signed-off-by: Hans-Kristian Arntzen <post(a)arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
libs/vkd3d/command.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index ae88910..2d6d02d 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -1648,8 +1648,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_allocator_Reset(ID3D12CommandAllo
allocator->command_buffer_count = 0;
}
- if ((vr = VK_CALL(vkResetCommandPool(device->vk_device, allocator->vk_command_pool,
- VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT))))
+ /* The intent here is to recycle memory, so do not use RELEASE_RESOURCES_BIT here. */
+ if ((vr = VK_CALL(vkResetCommandPool(device->vk_device, allocator->vk_command_pool, 0))))
{
WARN("Resetting command pool failed, vr %d.\n", vr);
return hresult_from_vk_result(vr);