From 7e5af314f1c328311b34cf0cf9c256d6ce2135f4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 28 Aug 2017 20:05:18 +0200 Subject: [PATCH] libs/vkd3d: Validation should happen in the d3d12/Vulkan validation layers. Unless we have tests that say otherwise. --- libs/vkd3d/command.c | 59 -------------------------------------- libs/vkd3d/resource.c | 1 - libs/vkd3d/vkd3d_private.h | 2 -- 3 files changed, 62 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index efe2297b..ea4bd8fc 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3075,32 +3075,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_DiscardResource(ID3D12GraphicsC FIXME("iface %p, resource %p, region %p stub!\n", iface, resource, region); } -static D3D12_QUERY_HEAP_TYPE vkd3d_query_heap_type_from_query_type(D3D12_QUERY_TYPE type) -{ - switch (type) - { - case D3D12_QUERY_TYPE_OCCLUSION: - case D3D12_QUERY_TYPE_BINARY_OCCLUSION: - return D3D12_QUERY_HEAP_TYPE_OCCLUSION; - - case D3D12_QUERY_TYPE_TIMESTAMP: - return D3D12_QUERY_HEAP_TYPE_TIMESTAMP; - - case D3D12_QUERY_TYPE_PIPELINE_STATISTICS: - return D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS; - - case D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0: - case D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1: - case D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2: - case D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3: - return D3D12_QUERY_HEAP_TYPE_SO_STATISTICS; - - default: - WARN("Invalid query type %#x.\n", type); - return (D3D12_QUERY_HEAP_TYPE)-1; - } -} - static UINT64 vkd3d_query_type_result_size(D3D12_QUERY_TYPE type) { switch (type) @@ -3132,12 +3106,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsComman TRACE("iface %p, heap %p, type %#x, index %u.\n", iface, heap, type, index); - if (query_heap->desc.Type != vkd3d_query_heap_type_from_query_type(type)) - { - WARN("Query type %u not supported by query heap.\n", type); - return; - } - switch (type) { case D3D12_QUERY_TYPE_TIMESTAMP: @@ -3168,12 +3136,6 @@ static void STDMETHODCALLTYPE d3d12_command_list_EndQuery(ID3D12GraphicsCommandL TRACE("iface %p, heap %p, type %#x, index %u.\n", iface, heap, type, index); - if (query_heap->desc.Type != vkd3d_query_heap_type_from_query_type(type)) - { - WARN("Query type %u not supported by query heap.\n", type); - return; - } - switch (type) { case D3D12_QUERY_TYPE_TIMESTAMP: @@ -3210,32 +3172,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12Graphics iface, heap, type, start_index, query_count, dst_buffer, aligned_dst_buffer_offset); - if (query_heap->desc.Type != vkd3d_query_heap_type_from_query_type(type)) - { - WARN("Query type %u not supported by query heap.\n", type); - return; - } - if ((start_index + query_count) > query_heap->desc.Count) - { - WARN("Query indices out of range (%u + %u > %u).\n", start_index, query_count, query_heap->desc.Count); - return; - } - if ((aligned_dst_buffer_offset % 8) != 0) - { - WARN("Buffer offset is not a multiple of eight (%"PRIu64".\n", aligned_dst_buffer_offset); - return; - } if (buffer->desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER) { WARN("Destination resource is not a buffer.\n"); return; } - if ((aligned_dst_buffer_offset + vkd3d_query_type_result_size(type)) > buffer->desc.Width) - { - WARN("Would overflow destination buffer (%"PRIu64" + %"PRIu64" > %"PRIu64").\n", - aligned_dst_buffer_offset, vkd3d_query_type_result_size(type), buffer->desc.Width); - return; - } switch (type) { diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 3025d099..e1b518f3 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1740,7 +1740,6 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H object->ID3D12QueryHeap_iface.lpVtbl = &d3d12_query_heap_vtbl; object->refcount = 1; object->device = device; - object->desc = *desc; pool_info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO; pool_info.pNext = NULL; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index e1eab2ee..cb2120e2 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -258,8 +258,6 @@ struct d3d12_query_heap ID3D12QueryHeap ID3D12QueryHeap_iface; LONG refcount; - D3D12_QUERY_HEAP_DESC desc; - VkQueryPool vk_query_pool; struct d3d12_device *device;