MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / StartProfile

Method StartProfile

SampleFramework11/v1.02/Graphics/Profiler.cpp:33–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void Profiler::StartProfile(const wstring& name)
34{
35 ProfileData& profileData = profiles[name];
36 Assert_(profileData.QueryStarted == false);
37 Assert_(profileData.QueryFinished == false);
38 profileData.CPUProfile = false;
39 profileData.Active = true;
40
41 if(profileData.DisjointQuery[currFrame] == NULL)
42 {
43 // Create the queries
44 D3D11_QUERY_DESC desc;
45 desc.Query = D3D11_QUERY_TIMESTAMP_DISJOINT;
46 desc.MiscFlags = 0;
47 DXCall(device->CreateQuery(&desc, &profileData.DisjointQuery[currFrame]));
48
49 desc.Query = D3D11_QUERY_TIMESTAMP;
50 DXCall(device->CreateQuery(&desc, &profileData.TimestampStartQuery[currFrame]));
51 DXCall(device->CreateQuery(&desc, &profileData.TimestampEndQuery[currFrame]));
52 }
53
54 // Start a disjoint query first
55 context->Begin(profileData.DisjointQuery[currFrame]);
56
57 // Insert the start timestamp
58 context->End(profileData.TimestampStartQuery[currFrame]);
59
60 profileData.QueryStarted = true;
61}
62
63void Profiler::EndProfile(const wstring& name)
64{

Callers 1

ProfileBlockMethod · 0.80

Calls 3

DXCallFunction · 0.85
BeginMethod · 0.80
EndMethod · 0.80

Tested by

no test coverage detected