MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / RegisterContext

Method RegisterContext

PresentData/GpuTrace.cpp:102–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void GpuTrace::RegisterContext(uint64_t hContext, uint64_t hDevice, uint32_t nodeOrdinal, uint32_t processId)
103{
104 auto deviceIter = mDevices.find(hDevice);
105 if (deviceIter == mDevices.end()) {
106 return;
107 }
108 auto pDxgAdapter = deviceIter->second;
109 auto node = &mNodes[pDxgAdapter].emplace(nodeOrdinal, Node{}).first->second;
110
111 // Sometimes there are duplicate start events, make sure that they say the same thing
112 DebugAssert(mContexts.find(hContext) == mContexts.end() || mContexts.find(hContext)->second.mNode == node);
113
114 auto context = &mContexts.emplace(hContext, Context()).first->second;
115 context->mPacketTrace = nullptr;
116 context->mNode = node;
117 context->mParentContext = 0;
118 context->mIsParentContext = false;
119 context->mIsHwQueue = false;
120
121 if (processId != 0) {
122 SetContextProcessId(context, processId);
123 }
124}
125
126// HwQueue's are similar to Contexts, but are used with HWS nodes and use the
127// following pattern:

Callers 1

HandleDXGKEventMethod · 0.80

Calls 2

ContextClass · 0.70
endMethod · 0.45

Tested by

no test coverage detected