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

Method EndProfile

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

Source from the content-addressed store, hash-verified

110}
111
112void Profiler::EndProfile(ID3D12GraphicsCommandList* cmdList, uint64 idx)
113{
114 if(enableGPUProfiling == false)
115 return;
116
117 Assert_(idx < numProfiles);
118
119 ProfileData& profileData = profiles[idx];
120 Assert_(profileData.QueryStarted == true);
121 Assert_(profileData.QueryFinished == false);
122
123 // Insert the end timestamp
124 const uint32 startQueryIdx = uint32(idx * 2);
125 const uint32 endQueryIdx = startQueryIdx + 1;
126 cmdList->EndQuery(queryHeap, D3D12_QUERY_TYPE_TIMESTAMP, endQueryIdx);
127
128 // Resolve the data
129 const uint64 dstOffset = ((DX12::CurrFrameIdx * MaxProfiles * 2) + startQueryIdx) * sizeof(uint64);
130 cmdList->ResolveQueryData(queryHeap, D3D12_QUERY_TYPE_TIMESTAMP, startQueryIdx, 2, readbackBuffer.Resource, dstOffset);
131
132 profileData.QueryStarted = false;
133 profileData.QueryFinished = true;
134}
135
136uint64 Profiler::StartCPUProfile(const char* name)
137{

Callers 1

~ProfileBlockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected