File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed
Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,10 @@ bool NVD3D11Counters::HasCounter(GPUCounter counterID) const
296296 {
297297 return counterID == GPUCounter::FirstNvidia;
298298 }
299+ if (!m_Impl->CounterEnumerator )
300+ {
301+ return false ;
302+ }
299303 return m_Impl->CounterEnumerator ->HasCounter (counterID);
300304}
301305
Original file line number Diff line number Diff line change @@ -293,6 +293,12 @@ rdcarray<GPUCounter> NVD3D12Counters::EnumerateCounters(WrappedID3D12Device &dev
293293 {
294294 return {GPUCounter::FirstNvidia};
295295 }
296+ // NOTE: Nsight Perf SDK needs access to a D3D12 device handle and command
297+ // queue in order to determine which counters are available on a
298+ // particular NVIDIA device. However, since the D3D12 command queue is
299+ // not available at the time NVD3D12Counters::Init() is called this
300+ // determination must be deferred until the first time
301+ // NVD3D12Counters::EnumerateCounters() is called.
296302 if (!m_Impl->InitCounterEnumerator (device))
297303 {
298304 return {GPUCounter::FirstNvidia};
@@ -306,6 +312,10 @@ bool NVD3D12Counters::HasCounter(GPUCounter counterID) const
306312 {
307313 return counterID == GPUCounter::FirstNvidia;
308314 }
315+ if (!m_Impl->CounterEnumerator )
316+ {
317+ return false ;
318+ }
309319 return m_Impl->CounterEnumerator ->HasCounter (counterID);
310320}
311321
Original file line number Diff line number Diff line change @@ -292,6 +292,10 @@ bool NVGLCounters::HasCounter(GPUCounter counterID) const
292292 {
293293 return counterID == GPUCounter::FirstNvidia;
294294 }
295+ if (!m_Impl->CounterEnumerator )
296+ {
297+ return false ;
298+ }
295299 return m_Impl->CounterEnumerator ->HasCounter (counterID);
296300}
297301
Original file line number Diff line number Diff line change @@ -282,6 +282,10 @@ bool NVVulkanCounters::HasCounter(GPUCounter counterID) const
282282 {
283283 return counterID == GPUCounter::FirstNvidia;
284284 }
285+ if (!m_Impl->CounterEnumerator )
286+ {
287+ return false ;
288+ }
285289 return m_Impl->CounterEnumerator ->HasCounter (counterID);
286290}
287291
You can’t perform that action at this time.
0 commit comments