internal void ReturnQueryObject(BufferedQuery query) { lock (_lock) { _queryPool.Enqueue(query); } }
internal void ReturnQueryObject(BufferedQuery query) { lock (_lock) { _pipeline.ResetQuery(query); _queryPool.Enqueue(query); } }
public CounterQueueEvent(CounterQueue queue, CounterType type, ulong drawIndex) { _queue = queue; _counter = queue.GetQueryObject(); Type = type; DrawIndex = drawIndex; _counter.Begin(); }
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)); } } }