Exemplo n.º 1
0
        public virtual int CreateQueryHeap(
            ref D3D12_QUERY_HEAP_DESC pDesc,
            ref Guid riid,
            out IntPtr ppvHeap
            )
        {
            var fp = GetFunctionPointer(39);

            if (m_CreateQueryHeapFunc == null)
            {
                m_CreateQueryHeapFunc = (CreateQueryHeapFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateQueryHeapFunc));
            }

            return(m_CreateQueryHeapFunc(m_ptr, ref pDesc, ref riid, out ppvHeap));
        }
Exemplo n.º 2
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;
        }