MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / GpuTimer

Method GpuTimer

Source/Falcor/Core/API/GpuTimer.cpp:48–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48GpuTimer::GpuTimer(ref<Device> pDevice) : mpDevice(pDevice)
49{
50 FALCOR_ASSERT(mpDevice);
51
52 mpResolveBuffer = mpDevice->createBuffer(sizeof(uint64_t) * 2, ResourceBindFlags::None, MemoryType::DeviceLocal, nullptr);
53 mpResolveBuffer->breakStrongReferenceToDevice();
54 mpResolveStagingBuffer = mpDevice->createBuffer(sizeof(uint64_t) * 2, ResourceBindFlags::None, MemoryType::ReadBack, nullptr);
55 mpResolveStagingBuffer->breakStrongReferenceToDevice();
56
57 // Create timestamp query heap upon first use.
58 mStart = mpDevice->getTimestampQueryHeap()->allocate();
59 mEnd = mpDevice->getTimestampQueryHeap()->allocate();
60 if (mStart == QueryHeap::kInvalidIndex || mEnd == QueryHeap::kInvalidIndex)
61 {
62 FALCOR_THROW("Can't create GPU timer, no available timestamp queries.");
63 }
64 FALCOR_ASSERT(mEnd == (mStart + 1));
65}
66
67GpuTimer::~GpuTimer()
68{

Callers

nothing calls this directly

Calls 3

createBufferMethod · 0.80
allocateMethod · 0.45

Tested by

no test coverage detected