MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / Initialize

Method Initialize

SampleFramework12/v1.00/Graphics/Profiler.cpp:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42};
43
44void Profiler::Initialize()
45{
46 Shutdown();
47
48 enableGPUProfiling = SUCCEEDED(DX12::Device->SetStablePowerState(TRUE));
49
50 if(enableGPUProfiling)
51 {
52 D3D12_QUERY_HEAP_DESC heapDesc = { };
53 heapDesc.Count = MaxProfiles * 2;
54 heapDesc.NodeMask = 0;
55 heapDesc.Type = D3D12_QUERY_HEAP_TYPE_TIMESTAMP;
56 DX12::Device->CreateQueryHeap(&heapDesc, IID_PPV_ARGS(&queryHeap));
57
58 readbackBuffer.Initialize(MaxProfiles * DX12::RenderLatency * 2 * sizeof(uint64));
59 }
60
61 profiles.Init(MaxProfiles);
62 cpuProfiles.Init(MaxProfiles);
63}
64
65void Profiler::Shutdown()
66{

Callers

nothing calls this directly

Calls 2

ShutdownFunction · 0.70
InitMethod · 0.45

Tested by

no test coverage detected