mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
libs/vkd3d: Avoid vkCmdCopyQueryPoolResults() for not issued queries.
The Vulkan spec states:
* "If the query does not become available in a finite amount of time
(e.g. due to not issuing a query since the last reset), a
VK_ERROR_DEVICE_LOST error may occur."
* "If queries will never finish (e.g. due to being reset but not
issued), then vkGetQueryPoolResults may not return in finite time."
This commit is contained in:
@@ -1871,14 +1871,17 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
||||
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
|
||||
struct d3d12_query_heap *object;
|
||||
VkQueryPoolCreateInfo pool_info;
|
||||
unsigned int element_count;
|
||||
VkResult vr;
|
||||
|
||||
if (!(object = vkd3d_malloc(sizeof(*object))))
|
||||
element_count = DIV_ROUND_UP(desc->Count, sizeof(*object->availability_mask) * CHAR_BIT);
|
||||
if (!(object = vkd3d_malloc(offsetof(struct d3d12_query_heap, availability_mask[element_count]))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
object->ID3D12QueryHeap_iface.lpVtbl = &d3d12_query_heap_vtbl;
|
||||
object->refcount = 1;
|
||||
object->device = device;
|
||||
memset(object->availability_mask, 0, element_count * sizeof(*object->availability_mask));
|
||||
|
||||
pool_info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
|
||||
pool_info.pNext = NULL;
|
||||
|
||||
Reference in New Issue
Block a user