SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnResolveMarker()

void Spices::GpuCrashTracker::OnResolveMarker ( const void * pMarkerData,
const uint32_t markerDataSize,
void ** ppResolvedMarkerData,
uint32_t * pResolvedMarkerDataSize )
private

Handler for app-managed marker resolve callback.

Parameters
[in]pMarkerData.
[in]markerDataSize.
[in]ppResolvedMarkerData.
[in]pResolvedMarkerDataSize.

Important: the pointer passed back via ppResolvedMarkerData must remain valid after this function returns using references for all of the m_markerMap accesses ensures that the pointers refer to the persistent data

Important: the pointer passed back via ppResolvedMarkerData must remain valid after this function returns using references for all of the m_markerMap accesses ensures that the pointers refer to the persistent data

Definition at line 204 of file NsightAftermathGpuCrashTracker.cpp.

210 {
212
217 for (auto& map : m_MarkerMap)
218 {
219 const auto& foundMarker = map.find(reinterpret_cast<uint64_t>(pMarkerData));
220 if (foundMarker != map.end())
221 {
222 const std::string& foundMarkerData = foundMarker->second;
223 // std::string::data() will return a valid pointer until the string is next modified
224 // we don't modify the string after calling data() here, so the pointer should remain valid
225 *ppResolvedMarkerData = (void*)foundMarkerData.data();
226 *pResolvedMarkerDataSize = static_cast<uint32_t>(foundMarkerData.length());
227 return;
228 }
229 }
230 }
#define SPICES_PROFILE_ZONE
MarkerMap m_MarkerMap
App-managed marker tracking.
typename detail::map< TypeList, F >::type map
Replace type with a new type.
Definition TypeList.h:297

Referenced by ResolveMarkerCallback().