Esempio n. 1
0
        internal QueryHeap(ComputeDevice device, QueryHeapType type, int numQueries)
        {
            _device    = device;
            _nextQuery = 0;

            if (type == QueryHeapType.CopyTimestamp &&
                _device.QueryFeatureSupport <D3D12_FEATURE_DATA_D3D12_OPTIONS3>(D3D12_FEATURE.D3D12_FEATURE_D3D12_OPTIONS3).CopyQueueTimestampQueriesSupported != TRUE)
            {
                ThrowHelper.ThrowNotSupportedException("Device does not support copy queue timestamps");
            }

            var desc = new D3D12_QUERY_HEAP_DESC
            {
                Count    = (uint)numQueries,
                Type     = (D3D12_QUERY_HEAP_TYPE)type,
                NodeMask = 0, // TODO: MULTI-GPU
            };

            _queryHeap  = device.CreateQueryHeap(desc);
            _numQueries = (uint)numQueries;
        }