public static ulong PIXEventsReplaceBlock( PIXEventsThreadInfo *threadInfo, bool getEarliestTime ) { return(_PIXEventsReplaceBlock(threadInfo, getEarliestTime)); }
public static void EndEvent( ulong *args, uint argsLength, PIXEventsThreadInfo *threadInfo, ulong time ) { SerializeForCpuCapture(args, argsLength, threadInfo, time); }
public static void EndEvent( ID3D12GraphicsCommandList *context, ulong *args, uint argsLength, PIXEventsThreadInfo *threadInfo, ulong time ) { SerializeForCpuCapture(args, argsLength, threadInfo, time); EndGPUEventOnContext(context); }
public static void SetMarker( ID3D12CommandQueue *context, ulong *args, uint argsLength, PIXEventsThreadInfo *threadInfo, ulong time ) { SerializeForCpuCapture(args, argsLength, threadInfo, time); SetGPUMarkerOnContext(context, args, argsLength * sizeof(ulong)); }
/* * This serializes the type, color, context (if not on xbox), etc when a CPU capture occurs * The if else if won't be entered if CPU capture isn't occuring (PIXGetThreadInfo will return an empty struct) */ private static void SerializeForCpuCapture( ulong *args, uint argsLength, PIXEventsThreadInfo *threadInfo, ulong time ) { ulong *destination = threadInfo->Destination; ulong *limit = threadInfo->BiasedLimit; if (CanWrite(destination, limit)) { limit += EventsSafeFastCopySpaceQwords; CopyArgs(ref destination, limit, args, argsLength); *destination = EventsBlockEndMarker; threadInfo->Destination = destination; } else if (limit != null) // the old block had ran out, so we got a new one (yay!) { if (time == 0) { return; } destination = threadInfo->Destination; limit = threadInfo->BiasedLimit; if (destination >= limit) { return; } limit += EventsSafeFastCopySpaceQwords; CopyArgs(ref destination, limit, args, argsLength); *destination = EventsBlockEndMarker; threadInfo->Destination = destination; } }
internal static PIXEventsThreadInfo *RetrieveTimeData(out ulong time) { PIXEventsThreadInfo *threadInfo = PIXGetThreadInfo(); ulong *destination = threadInfo->Destination; ulong *limit = threadInfo->BiasedLimit; if (CanWrite(destination, limit)) { time = PIXGetTimestampCounter(); } else if (limit != null) // old block is full. get a fresh new one { time = PIXEventsReplaceBlock(threadInfo, false); } else { // cpu capture isn't occuring time = default; } return(threadInfo); }
private static extern ulong _PIXEventsReplaceBlock( PIXEventsThreadInfo *threadInfo, bool getEarliestTime );