Ejemplo n.º 1
0
 public static ulong PIXEventsReplaceBlock(
     PIXEventsThreadInfo *threadInfo,
     bool getEarliestTime
     )
 {
     return(_PIXEventsReplaceBlock(threadInfo, getEarliestTime));
 }
Ejemplo n.º 2
0
 public static void EndEvent(
     ulong *args,
     uint argsLength,
     PIXEventsThreadInfo *threadInfo,
     ulong time
     )
 {
     SerializeForCpuCapture(args, argsLength, threadInfo, time);
 }
Ejemplo n.º 3
0
        public static void EndEvent(
            ID3D12GraphicsCommandList *context,
            ulong *args,
            uint argsLength,
            PIXEventsThreadInfo *threadInfo,
            ulong time
            )
        {
            SerializeForCpuCapture(args, argsLength, threadInfo, time);

            EndGPUEventOnContext(context);
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        /*
         * 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;
            }
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 private static extern ulong _PIXEventsReplaceBlock(
     PIXEventsThreadInfo *threadInfo,
     bool getEarliestTime
     );