From e597adb83aae74307a9cee6ad7b956ab8e51b595 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 21 Sep 2021 09:55:56 +0100 Subject: [PATCH] vkd3d: Move d3d12_query_heap_type_get_data_size to header This should be inlined. Signed-off-by: Joshua Ashton --- libs/vkd3d/resource.c | 18 ------------------ libs/vkd3d/vkd3d_private.h | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index af0924f7..d33c3a08 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -5755,24 +5755,6 @@ struct d3d12_query_heap *unsafe_impl_from_ID3D12QueryHeap(ID3D12QueryHeap *iface return impl_from_ID3D12QueryHeap(iface); } -size_t d3d12_query_heap_type_get_data_size(D3D12_QUERY_HEAP_TYPE heap_type) -{ - switch (heap_type) - { - case D3D12_QUERY_HEAP_TYPE_OCCLUSION: - case D3D12_QUERY_HEAP_TYPE_TIMESTAMP: - case D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP: - return sizeof(uint64_t); - case D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS: - return sizeof(D3D12_QUERY_DATA_PIPELINE_STATISTICS); - case D3D12_QUERY_HEAP_TYPE_SO_STATISTICS: - return sizeof(D3D12_QUERY_DATA_SO_STATISTICS); - default: - ERR("Unhandled query pool type %u.\n", heap_type); - return 0; - } -} - HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_HEAP_DESC *desc, struct d3d12_query_heap **heap) { diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index ca0583cc..60ef2ba0 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1178,7 +1178,24 @@ struct d3d12_query_heap HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_HEAP_DESC *desc, struct d3d12_query_heap **heap); struct d3d12_query_heap *unsafe_impl_from_ID3D12QueryHeap(ID3D12QueryHeap *iface); -size_t d3d12_query_heap_type_get_data_size(D3D12_QUERY_HEAP_TYPE heap_type); + +static inline size_t d3d12_query_heap_type_get_data_size(D3D12_QUERY_HEAP_TYPE heap_type) +{ + switch (heap_type) + { + case D3D12_QUERY_HEAP_TYPE_OCCLUSION: + case D3D12_QUERY_HEAP_TYPE_TIMESTAMP: + case D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP: + return sizeof(uint64_t); + case D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS: + return sizeof(D3D12_QUERY_DATA_PIPELINE_STATISTICS); + case D3D12_QUERY_HEAP_TYPE_SO_STATISTICS: + return sizeof(D3D12_QUERY_DATA_SO_STATISTICS); + default: + ERR("Unhandled query pool type %u.\n", heap_type); + return 0; + } +} static inline bool d3d12_query_heap_type_is_inline(D3D12_QUERY_HEAP_TYPE heap_type) {