vkd3d: Do not create query pool for inline query types.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
parent
7b524590ab
commit
c6095e740d
|
@ -6168,19 +6168,20 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
|||
struct d3d12_query_heap *object;
|
||||
VkQueryPoolCreateInfo pool_info;
|
||||
D3D12_RESOURCE_DESC buffer_desc;
|
||||
size_t data_size;
|
||||
VkResult vr;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(object = vkd3d_malloc(sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
memset(object, 0, sizeof(*object));
|
||||
object->ID3D12QueryHeap_iface.lpVtbl = &d3d12_query_heap_vtbl;
|
||||
object->refcount = 1;
|
||||
object->device = device;
|
||||
object->desc = *desc;
|
||||
object->initialized = 0;
|
||||
|
||||
if (!d3d12_query_heap_type_is_inline(desc->Type))
|
||||
{
|
||||
pool_info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
|
||||
pool_info.pNext = NULL;
|
||||
pool_info.flags = 0;
|
||||
|
@ -6188,11 +6189,6 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
|||
|
||||
switch (desc->Type)
|
||||
{
|
||||
case D3D12_QUERY_HEAP_TYPE_OCCLUSION:
|
||||
pool_info.queryType = VK_QUERY_TYPE_OCCLUSION;
|
||||
pool_info.pipelineStatistics = 0;
|
||||
break;
|
||||
|
||||
case D3D12_QUERY_HEAP_TYPE_TIMESTAMP:
|
||||
pool_info.queryType = VK_QUERY_TYPE_TIMESTAMP;
|
||||
pool_info.pipelineStatistics = 0;
|
||||
|
@ -6213,18 +6209,6 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
|||
| VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT;
|
||||
break;
|
||||
|
||||
case D3D12_QUERY_HEAP_TYPE_SO_STATISTICS:
|
||||
if (!device->vk_info.transform_feedback_queries)
|
||||
{
|
||||
FIXME("Transform feedback queries are not supported by Vulkan implementation.\n");
|
||||
vkd3d_free(object);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
pool_info.queryType = VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT;
|
||||
pool_info.pipelineStatistics = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
WARN("Invalid query heap type %u.\n", desc->Type);
|
||||
vkd3d_free(object);
|
||||
|
@ -6237,15 +6221,15 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
|||
vkd3d_free(object);
|
||||
return hresult_from_vk_result(vr);
|
||||
}
|
||||
|
||||
if ((data_size = (d3d12_query_heap_type_get_data_size(desc->Type) * desc->Count)))
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(&heap_properties, 0, sizeof(heap_properties));
|
||||
heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
|
||||
|
||||
buffer_desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
buffer_desc.Alignment = 0;
|
||||
buffer_desc.Width = data_size;
|
||||
buffer_desc.Width = d3d12_query_heap_type_get_data_size(desc->Type) * desc->Count;
|
||||
buffer_desc.Height = 1;
|
||||
buffer_desc.DepthOrArraySize = 1;
|
||||
buffer_desc.MipLevels = 1;
|
||||
|
@ -6269,11 +6253,10 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
|
|||
vkd3d_free(object);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
object->vk_memory = VK_NULL_HANDLE;
|
||||
object->vk_buffer = VK_NULL_HANDLE;
|
||||
|
||||
/* Explicit initialization is not required for these since
|
||||
* we can expect the buffer to be zero-initialized. */
|
||||
object->initialized = 1;
|
||||
}
|
||||
|
||||
if (FAILED(hr = vkd3d_private_store_init(&object->private_store)))
|
||||
|
|
Loading…
Reference in New Issue