Example #1
0
 internal void ReturnQueryObject(BufferedQuery query)
 {
     lock (_lock)
     {
         _queryPool.Enqueue(query);
     }
 }
Example #2
0
 internal void ReturnQueryObject(BufferedQuery query)
 {
     lock (_lock)
     {
         _pipeline.ResetQuery(query);
         _queryPool.Enqueue(query);
     }
 }
Example #3
0
        public CounterQueueEvent(CounterQueue queue, CounterType type, ulong drawIndex)
        {
            _queue = queue;

            _counter = queue.GetQueryObject();
            Type     = type;

            DrawIndex = drawIndex;

            _counter.Begin();
        }
Example #4
0
        internal BufferedQuery GetQueryObject()
        {
            // Creating/disposing query objects on a context we're sharing with will cause issues.
            // So instead, make a lot of query objects on the main thread and reuse them.

            lock (_lock)
            {
                if (_queryPool.Count > 0)
                {
                    BufferedQuery result = _queryPool.Dequeue();
                    return(result);
                }
                else
                {
                    return(new BufferedQuery(_gd, _device, _pipeline, Type, _gd.IsAmdWindows));
                }
            }
        }