BRE12
PIXEventsGenerated.h
1 //This is a generated file.
2 #pragma once
3 
4 #ifndef _PIXEventsGenerated_H_
5 #define _PIXEventsGenerated_H_
6 
7 #ifndef _PIX3_H_
8 #error Don't include this file directly - use pix3.h
9 #endif
10 
11 #include "PIXEventsCommon.h"
12 
13 //__declspec(noinline) is specified to stop compiler from making bad inlining decisions
14 //inline has to be specified for functions fully defined in header due to one definition rule
15 //supported context types for TContext are ID3D11DeviceContextX, ID3D11ComputeContextX and ID3D11DmaEngineContextX
16 
17 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString)
18 {
19  UINT64 time = PIXEventsReplaceBlock(false);
20  if (time)
21  {
22  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
23  UINT64* destination = threadInfo->destination;
24  UINT64* limit = threadInfo->limit;
25  if (destination < limit)
26  {
27  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_NoArgs);
28  *destination++ = color;
29 
30  PIXCopyEventArgument(destination, limit, formatString);
31  *destination = PIXEventsBlockEndMarker;
32  threadInfo->destination = destination;
33  }
34  }
35 }
36 
37 template<class T1>
38 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1)
39 {
40  UINT64 time = PIXEventsReplaceBlock(false);
41  if (time)
42  {
43  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
44  UINT64* destination = threadInfo->destination;
45  UINT64* limit = threadInfo->limit;
46  if (destination < limit)
47  {
48  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
49  *destination++ = color;
50 
51  PIXCopyEventArgument(destination, limit, formatString);
52  PIXCopyEventArgument(destination, limit, a1);
53  *destination = PIXEventsBlockEndMarker;
54  threadInfo->destination = destination;
55  }
56  }
57 }
58 
59 template<class T1, class T2>
60 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
61 {
62  UINT64 time = PIXEventsReplaceBlock(false);
63  if (time)
64  {
65  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
66  UINT64* destination = threadInfo->destination;
67  UINT64* limit = threadInfo->limit;
68  if (destination < limit)
69  {
70  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
71  *destination++ = color;
72 
73  PIXCopyEventArgument(destination, limit, formatString);
74  PIXCopyEventArgument(destination, limit, a1);
75  PIXCopyEventArgument(destination, limit, a2);
76  *destination = PIXEventsBlockEndMarker;
77  threadInfo->destination = destination;
78  }
79  }
80 }
81 
82 template<class T1, class T2, class T3>
83 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
84 {
85  UINT64 time = PIXEventsReplaceBlock(false);
86  if (time)
87  {
88  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
89  UINT64* destination = threadInfo->destination;
90  UINT64* limit = threadInfo->limit;
91  if (destination < limit)
92  {
93  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
94  *destination++ = color;
95 
96  PIXCopyEventArgument(destination, limit, formatString);
97  PIXCopyEventArgument(destination, limit, a1);
98  PIXCopyEventArgument(destination, limit, a2);
99  PIXCopyEventArgument(destination, limit, a3);
100  *destination = PIXEventsBlockEndMarker;
101  threadInfo->destination = destination;
102  }
103  }
104 }
105 
106 template<class T1, class T2, class T3, class T4>
107 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
108 {
109  UINT64 time = PIXEventsReplaceBlock(false);
110  if (time)
111  {
112  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
113  UINT64* destination = threadInfo->destination;
114  UINT64* limit = threadInfo->limit;
115  if (destination < limit)
116  {
117  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
118  *destination++ = color;
119 
120  PIXCopyEventArgument(destination, limit, formatString);
121  PIXCopyEventArgument(destination, limit, a1);
122  PIXCopyEventArgument(destination, limit, a2);
123  PIXCopyEventArgument(destination, limit, a3);
124  PIXCopyEventArgument(destination, limit, a4);
125  *destination = PIXEventsBlockEndMarker;
126  threadInfo->destination = destination;
127  }
128  }
129 }
130 
131 template<class T1, class T2, class T3, class T4, class T5>
132 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
133 {
134  UINT64 time = PIXEventsReplaceBlock(false);
135  if (time)
136  {
137  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
138  UINT64* destination = threadInfo->destination;
139  UINT64* limit = threadInfo->limit;
140  if (destination < limit)
141  {
142  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
143  *destination++ = color;
144 
145  PIXCopyEventArgument(destination, limit, formatString);
146  PIXCopyEventArgument(destination, limit, a1);
147  PIXCopyEventArgument(destination, limit, a2);
148  PIXCopyEventArgument(destination, limit, a3);
149  PIXCopyEventArgument(destination, limit, a4);
150  PIXCopyEventArgument(destination, limit, a5);
151  *destination = PIXEventsBlockEndMarker;
152  threadInfo->destination = destination;
153  }
154  }
155 }
156 
157 template<class T1, class T2, class T3, class T4, class T5, class T6>
158 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
159 {
160  UINT64 time = PIXEventsReplaceBlock(false);
161  if (time)
162  {
163  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
164  UINT64* destination = threadInfo->destination;
165  UINT64* limit = threadInfo->limit;
166  if (destination < limit)
167  {
168  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
169  *destination++ = color;
170 
171  PIXCopyEventArgument(destination, limit, formatString);
172  PIXCopyEventArgument(destination, limit, a1);
173  PIXCopyEventArgument(destination, limit, a2);
174  PIXCopyEventArgument(destination, limit, a3);
175  PIXCopyEventArgument(destination, limit, a4);
176  PIXCopyEventArgument(destination, limit, a5);
177  PIXCopyEventArgument(destination, limit, a6);
178  *destination = PIXEventsBlockEndMarker;
179  threadInfo->destination = destination;
180  }
181  }
182 }
183 
184 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
185 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
186 {
187  UINT64 time = PIXEventsReplaceBlock(false);
188  if (time)
189  {
190  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
191  UINT64* destination = threadInfo->destination;
192  UINT64* limit = threadInfo->limit;
193  if (destination < limit)
194  {
195  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
196  *destination++ = color;
197 
198  PIXCopyEventArgument(destination, limit, formatString);
199  PIXCopyEventArgument(destination, limit, a1);
200  PIXCopyEventArgument(destination, limit, a2);
201  PIXCopyEventArgument(destination, limit, a3);
202  PIXCopyEventArgument(destination, limit, a4);
203  PIXCopyEventArgument(destination, limit, a5);
204  PIXCopyEventArgument(destination, limit, a6);
205  PIXCopyEventArgument(destination, limit, a7);
206  *destination = PIXEventsBlockEndMarker;
207  threadInfo->destination = destination;
208  }
209  }
210 }
211 
212 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
213 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
214 {
215  UINT64 time = PIXEventsReplaceBlock(false);
216  if (time)
217  {
218  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
219  UINT64* destination = threadInfo->destination;
220  UINT64* limit = threadInfo->limit;
221  if (destination < limit)
222  {
223  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
224  *destination++ = color;
225 
226  PIXCopyEventArgument(destination, limit, formatString);
227  PIXCopyEventArgument(destination, limit, a1);
228  PIXCopyEventArgument(destination, limit, a2);
229  PIXCopyEventArgument(destination, limit, a3);
230  PIXCopyEventArgument(destination, limit, a4);
231  PIXCopyEventArgument(destination, limit, a5);
232  PIXCopyEventArgument(destination, limit, a6);
233  PIXCopyEventArgument(destination, limit, a7);
234  PIXCopyEventArgument(destination, limit, a8);
235  *destination = PIXEventsBlockEndMarker;
236  threadInfo->destination = destination;
237  }
238  }
239 }
240 
241 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
242 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
243 {
244  UINT64 time = PIXEventsReplaceBlock(false);
245  if (time)
246  {
247  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
248  UINT64* destination = threadInfo->destination;
249  UINT64* limit = threadInfo->limit;
250  if (destination < limit)
251  {
252  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
253  *destination++ = color;
254 
255  PIXCopyEventArgument(destination, limit, formatString);
256  PIXCopyEventArgument(destination, limit, a1);
257  PIXCopyEventArgument(destination, limit, a2);
258  PIXCopyEventArgument(destination, limit, a3);
259  PIXCopyEventArgument(destination, limit, a4);
260  PIXCopyEventArgument(destination, limit, a5);
261  PIXCopyEventArgument(destination, limit, a6);
262  PIXCopyEventArgument(destination, limit, a7);
263  PIXCopyEventArgument(destination, limit, a8);
264  PIXCopyEventArgument(destination, limit, a9);
265  *destination = PIXEventsBlockEndMarker;
266  threadInfo->destination = destination;
267  }
268  }
269 }
270 
271 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
272 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
273 {
274  UINT64 time = PIXEventsReplaceBlock(false);
275  if (time)
276  {
277  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
278  UINT64* destination = threadInfo->destination;
279  UINT64* limit = threadInfo->limit;
280  if (destination < limit)
281  {
282  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
283  *destination++ = color;
284 
285  PIXCopyEventArgument(destination, limit, formatString);
286  PIXCopyEventArgument(destination, limit, a1);
287  PIXCopyEventArgument(destination, limit, a2);
288  PIXCopyEventArgument(destination, limit, a3);
289  PIXCopyEventArgument(destination, limit, a4);
290  PIXCopyEventArgument(destination, limit, a5);
291  PIXCopyEventArgument(destination, limit, a6);
292  PIXCopyEventArgument(destination, limit, a7);
293  PIXCopyEventArgument(destination, limit, a8);
294  PIXCopyEventArgument(destination, limit, a9);
295  PIXCopyEventArgument(destination, limit, a10);
296  *destination = PIXEventsBlockEndMarker;
297  threadInfo->destination = destination;
298  }
299  }
300 }
301 
302 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
303 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
304 {
305  UINT64 time = PIXEventsReplaceBlock(false);
306  if (time)
307  {
308  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
309  UINT64* destination = threadInfo->destination;
310  UINT64* limit = threadInfo->limit;
311  if (destination < limit)
312  {
313  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
314  *destination++ = color;
315 
316  PIXCopyEventArgument(destination, limit, formatString);
317  PIXCopyEventArgument(destination, limit, a1);
318  PIXCopyEventArgument(destination, limit, a2);
319  PIXCopyEventArgument(destination, limit, a3);
320  PIXCopyEventArgument(destination, limit, a4);
321  PIXCopyEventArgument(destination, limit, a5);
322  PIXCopyEventArgument(destination, limit, a6);
323  PIXCopyEventArgument(destination, limit, a7);
324  PIXCopyEventArgument(destination, limit, a8);
325  PIXCopyEventArgument(destination, limit, a9);
326  PIXCopyEventArgument(destination, limit, a10);
327  PIXCopyEventArgument(destination, limit, a11);
328  *destination = PIXEventsBlockEndMarker;
329  threadInfo->destination = destination;
330  }
331  }
332 }
333 
334 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
335 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
336 {
337  UINT64 time = PIXEventsReplaceBlock(false);
338  if (time)
339  {
340  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
341  UINT64* destination = threadInfo->destination;
342  UINT64* limit = threadInfo->limit;
343  if (destination < limit)
344  {
345  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
346  *destination++ = color;
347 
348  PIXCopyEventArgument(destination, limit, formatString);
349  PIXCopyEventArgument(destination, limit, a1);
350  PIXCopyEventArgument(destination, limit, a2);
351  PIXCopyEventArgument(destination, limit, a3);
352  PIXCopyEventArgument(destination, limit, a4);
353  PIXCopyEventArgument(destination, limit, a5);
354  PIXCopyEventArgument(destination, limit, a6);
355  PIXCopyEventArgument(destination, limit, a7);
356  PIXCopyEventArgument(destination, limit, a8);
357  PIXCopyEventArgument(destination, limit, a9);
358  PIXCopyEventArgument(destination, limit, a10);
359  PIXCopyEventArgument(destination, limit, a11);
360  PIXCopyEventArgument(destination, limit, a12);
361  *destination = PIXEventsBlockEndMarker;
362  threadInfo->destination = destination;
363  }
364  }
365 }
366 
367 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
368 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
369 {
370  UINT64 time = PIXEventsReplaceBlock(false);
371  if (time)
372  {
373  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
374  UINT64* destination = threadInfo->destination;
375  UINT64* limit = threadInfo->limit;
376  if (destination < limit)
377  {
378  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
379  *destination++ = color;
380 
381  PIXCopyEventArgument(destination, limit, formatString);
382  PIXCopyEventArgument(destination, limit, a1);
383  PIXCopyEventArgument(destination, limit, a2);
384  PIXCopyEventArgument(destination, limit, a3);
385  PIXCopyEventArgument(destination, limit, a4);
386  PIXCopyEventArgument(destination, limit, a5);
387  PIXCopyEventArgument(destination, limit, a6);
388  PIXCopyEventArgument(destination, limit, a7);
389  PIXCopyEventArgument(destination, limit, a8);
390  PIXCopyEventArgument(destination, limit, a9);
391  PIXCopyEventArgument(destination, limit, a10);
392  PIXCopyEventArgument(destination, limit, a11);
393  PIXCopyEventArgument(destination, limit, a12);
394  PIXCopyEventArgument(destination, limit, a13);
395  *destination = PIXEventsBlockEndMarker;
396  threadInfo->destination = destination;
397  }
398  }
399 }
400 
401 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
402 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
403 {
404  UINT64 time = PIXEventsReplaceBlock(false);
405  if (time)
406  {
407  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
408  UINT64* destination = threadInfo->destination;
409  UINT64* limit = threadInfo->limit;
410  if (destination < limit)
411  {
412  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
413  *destination++ = color;
414 
415  PIXCopyEventArgument(destination, limit, formatString);
416  PIXCopyEventArgument(destination, limit, a1);
417  PIXCopyEventArgument(destination, limit, a2);
418  PIXCopyEventArgument(destination, limit, a3);
419  PIXCopyEventArgument(destination, limit, a4);
420  PIXCopyEventArgument(destination, limit, a5);
421  PIXCopyEventArgument(destination, limit, a6);
422  PIXCopyEventArgument(destination, limit, a7);
423  PIXCopyEventArgument(destination, limit, a8);
424  PIXCopyEventArgument(destination, limit, a9);
425  PIXCopyEventArgument(destination, limit, a10);
426  PIXCopyEventArgument(destination, limit, a11);
427  PIXCopyEventArgument(destination, limit, a12);
428  PIXCopyEventArgument(destination, limit, a13);
429  PIXCopyEventArgument(destination, limit, a14);
430  *destination = PIXEventsBlockEndMarker;
431  threadInfo->destination = destination;
432  }
433  }
434 }
435 
436 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
437 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
438 {
439  UINT64 time = PIXEventsReplaceBlock(false);
440  if (time)
441  {
442  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
443  UINT64* destination = threadInfo->destination;
444  UINT64* limit = threadInfo->limit;
445  if (destination < limit)
446  {
447  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
448  *destination++ = color;
449 
450  PIXCopyEventArgument(destination, limit, formatString);
451  PIXCopyEventArgument(destination, limit, a1);
452  PIXCopyEventArgument(destination, limit, a2);
453  PIXCopyEventArgument(destination, limit, a3);
454  PIXCopyEventArgument(destination, limit, a4);
455  PIXCopyEventArgument(destination, limit, a5);
456  PIXCopyEventArgument(destination, limit, a6);
457  PIXCopyEventArgument(destination, limit, a7);
458  PIXCopyEventArgument(destination, limit, a8);
459  PIXCopyEventArgument(destination, limit, a9);
460  PIXCopyEventArgument(destination, limit, a10);
461  PIXCopyEventArgument(destination, limit, a11);
462  PIXCopyEventArgument(destination, limit, a12);
463  PIXCopyEventArgument(destination, limit, a13);
464  PIXCopyEventArgument(destination, limit, a14);
465  PIXCopyEventArgument(destination, limit, a15);
466  *destination = PIXEventsBlockEndMarker;
467  threadInfo->destination = destination;
468  }
469  }
470 }
471 
472 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
473 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
474 {
475  UINT64 time = PIXEventsReplaceBlock(false);
476  if (time)
477  {
478  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
479  UINT64* destination = threadInfo->destination;
480  UINT64* limit = threadInfo->limit;
481  if (destination < limit)
482  {
483  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
484  *destination++ = color;
485 
486  PIXCopyEventArgument(destination, limit, formatString);
487  PIXCopyEventArgument(destination, limit, a1);
488  PIXCopyEventArgument(destination, limit, a2);
489  PIXCopyEventArgument(destination, limit, a3);
490  PIXCopyEventArgument(destination, limit, a4);
491  PIXCopyEventArgument(destination, limit, a5);
492  PIXCopyEventArgument(destination, limit, a6);
493  PIXCopyEventArgument(destination, limit, a7);
494  PIXCopyEventArgument(destination, limit, a8);
495  PIXCopyEventArgument(destination, limit, a9);
496  PIXCopyEventArgument(destination, limit, a10);
497  PIXCopyEventArgument(destination, limit, a11);
498  PIXCopyEventArgument(destination, limit, a12);
499  PIXCopyEventArgument(destination, limit, a13);
500  PIXCopyEventArgument(destination, limit, a14);
501  PIXCopyEventArgument(destination, limit, a15);
502  PIXCopyEventArgument(destination, limit, a16);
503  *destination = PIXEventsBlockEndMarker;
504  threadInfo->destination = destination;
505  }
506  }
507 }
508 
509 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString)
510 {
511  UINT64 time = PIXEventsReplaceBlock(false);
512  if (time)
513  {
514  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
515  UINT64* destination = threadInfo->destination;
516  UINT64* limit = threadInfo->limit;
517  if (destination < limit)
518  {
519  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_NoArgs);
520  *destination++ = color;
521 
522  PIXCopyEventArgument(destination, limit, formatString);
523  *destination = PIXEventsBlockEndMarker;
524  threadInfo->destination = destination;
525  }
526  }
527 }
528 
529 template<class T1>
530 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1)
531 {
532  UINT64 time = PIXEventsReplaceBlock(false);
533  if (time)
534  {
535  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
536  UINT64* destination = threadInfo->destination;
537  UINT64* limit = threadInfo->limit;
538  if (destination < limit)
539  {
540  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
541  *destination++ = color;
542 
543  PIXCopyEventArgument(destination, limit, formatString);
544  PIXCopyEventArgument(destination, limit, a1);
545  *destination = PIXEventsBlockEndMarker;
546  threadInfo->destination = destination;
547  }
548  }
549 }
550 
551 template<class T1, class T2>
552 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
553 {
554  UINT64 time = PIXEventsReplaceBlock(false);
555  if (time)
556  {
557  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
558  UINT64* destination = threadInfo->destination;
559  UINT64* limit = threadInfo->limit;
560  if (destination < limit)
561  {
562  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
563  *destination++ = color;
564 
565  PIXCopyEventArgument(destination, limit, formatString);
566  PIXCopyEventArgument(destination, limit, a1);
567  PIXCopyEventArgument(destination, limit, a2);
568  *destination = PIXEventsBlockEndMarker;
569  threadInfo->destination = destination;
570  }
571  }
572 }
573 
574 template<class T1, class T2, class T3>
575 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
576 {
577  UINT64 time = PIXEventsReplaceBlock(false);
578  if (time)
579  {
580  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
581  UINT64* destination = threadInfo->destination;
582  UINT64* limit = threadInfo->limit;
583  if (destination < limit)
584  {
585  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
586  *destination++ = color;
587 
588  PIXCopyEventArgument(destination, limit, formatString);
589  PIXCopyEventArgument(destination, limit, a1);
590  PIXCopyEventArgument(destination, limit, a2);
591  PIXCopyEventArgument(destination, limit, a3);
592  *destination = PIXEventsBlockEndMarker;
593  threadInfo->destination = destination;
594  }
595  }
596 }
597 
598 template<class T1, class T2, class T3, class T4>
599 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
600 {
601  UINT64 time = PIXEventsReplaceBlock(false);
602  if (time)
603  {
604  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
605  UINT64* destination = threadInfo->destination;
606  UINT64* limit = threadInfo->limit;
607  if (destination < limit)
608  {
609  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
610  *destination++ = color;
611 
612  PIXCopyEventArgument(destination, limit, formatString);
613  PIXCopyEventArgument(destination, limit, a1);
614  PIXCopyEventArgument(destination, limit, a2);
615  PIXCopyEventArgument(destination, limit, a3);
616  PIXCopyEventArgument(destination, limit, a4);
617  *destination = PIXEventsBlockEndMarker;
618  threadInfo->destination = destination;
619  }
620  }
621 }
622 
623 template<class T1, class T2, class T3, class T4, class T5>
624 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
625 {
626  UINT64 time = PIXEventsReplaceBlock(false);
627  if (time)
628  {
629  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
630  UINT64* destination = threadInfo->destination;
631  UINT64* limit = threadInfo->limit;
632  if (destination < limit)
633  {
634  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
635  *destination++ = color;
636 
637  PIXCopyEventArgument(destination, limit, formatString);
638  PIXCopyEventArgument(destination, limit, a1);
639  PIXCopyEventArgument(destination, limit, a2);
640  PIXCopyEventArgument(destination, limit, a3);
641  PIXCopyEventArgument(destination, limit, a4);
642  PIXCopyEventArgument(destination, limit, a5);
643  *destination = PIXEventsBlockEndMarker;
644  threadInfo->destination = destination;
645  }
646  }
647 }
648 
649 template<class T1, class T2, class T3, class T4, class T5, class T6>
650 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
651 {
652  UINT64 time = PIXEventsReplaceBlock(false);
653  if (time)
654  {
655  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
656  UINT64* destination = threadInfo->destination;
657  UINT64* limit = threadInfo->limit;
658  if (destination < limit)
659  {
660  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
661  *destination++ = color;
662 
663  PIXCopyEventArgument(destination, limit, formatString);
664  PIXCopyEventArgument(destination, limit, a1);
665  PIXCopyEventArgument(destination, limit, a2);
666  PIXCopyEventArgument(destination, limit, a3);
667  PIXCopyEventArgument(destination, limit, a4);
668  PIXCopyEventArgument(destination, limit, a5);
669  PIXCopyEventArgument(destination, limit, a6);
670  *destination = PIXEventsBlockEndMarker;
671  threadInfo->destination = destination;
672  }
673  }
674 }
675 
676 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
677 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
678 {
679  UINT64 time = PIXEventsReplaceBlock(false);
680  if (time)
681  {
682  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
683  UINT64* destination = threadInfo->destination;
684  UINT64* limit = threadInfo->limit;
685  if (destination < limit)
686  {
687  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
688  *destination++ = color;
689 
690  PIXCopyEventArgument(destination, limit, formatString);
691  PIXCopyEventArgument(destination, limit, a1);
692  PIXCopyEventArgument(destination, limit, a2);
693  PIXCopyEventArgument(destination, limit, a3);
694  PIXCopyEventArgument(destination, limit, a4);
695  PIXCopyEventArgument(destination, limit, a5);
696  PIXCopyEventArgument(destination, limit, a6);
697  PIXCopyEventArgument(destination, limit, a7);
698  *destination = PIXEventsBlockEndMarker;
699  threadInfo->destination = destination;
700  }
701  }
702 }
703 
704 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
705 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
706 {
707  UINT64 time = PIXEventsReplaceBlock(false);
708  if (time)
709  {
710  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
711  UINT64* destination = threadInfo->destination;
712  UINT64* limit = threadInfo->limit;
713  if (destination < limit)
714  {
715  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
716  *destination++ = color;
717 
718  PIXCopyEventArgument(destination, limit, formatString);
719  PIXCopyEventArgument(destination, limit, a1);
720  PIXCopyEventArgument(destination, limit, a2);
721  PIXCopyEventArgument(destination, limit, a3);
722  PIXCopyEventArgument(destination, limit, a4);
723  PIXCopyEventArgument(destination, limit, a5);
724  PIXCopyEventArgument(destination, limit, a6);
725  PIXCopyEventArgument(destination, limit, a7);
726  PIXCopyEventArgument(destination, limit, a8);
727  *destination = PIXEventsBlockEndMarker;
728  threadInfo->destination = destination;
729  }
730  }
731 }
732 
733 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
734 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
735 {
736  UINT64 time = PIXEventsReplaceBlock(false);
737  if (time)
738  {
739  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
740  UINT64* destination = threadInfo->destination;
741  UINT64* limit = threadInfo->limit;
742  if (destination < limit)
743  {
744  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
745  *destination++ = color;
746 
747  PIXCopyEventArgument(destination, limit, formatString);
748  PIXCopyEventArgument(destination, limit, a1);
749  PIXCopyEventArgument(destination, limit, a2);
750  PIXCopyEventArgument(destination, limit, a3);
751  PIXCopyEventArgument(destination, limit, a4);
752  PIXCopyEventArgument(destination, limit, a5);
753  PIXCopyEventArgument(destination, limit, a6);
754  PIXCopyEventArgument(destination, limit, a7);
755  PIXCopyEventArgument(destination, limit, a8);
756  PIXCopyEventArgument(destination, limit, a9);
757  *destination = PIXEventsBlockEndMarker;
758  threadInfo->destination = destination;
759  }
760  }
761 }
762 
763 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
764 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
765 {
766  UINT64 time = PIXEventsReplaceBlock(false);
767  if (time)
768  {
769  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
770  UINT64* destination = threadInfo->destination;
771  UINT64* limit = threadInfo->limit;
772  if (destination < limit)
773  {
774  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
775  *destination++ = color;
776 
777  PIXCopyEventArgument(destination, limit, formatString);
778  PIXCopyEventArgument(destination, limit, a1);
779  PIXCopyEventArgument(destination, limit, a2);
780  PIXCopyEventArgument(destination, limit, a3);
781  PIXCopyEventArgument(destination, limit, a4);
782  PIXCopyEventArgument(destination, limit, a5);
783  PIXCopyEventArgument(destination, limit, a6);
784  PIXCopyEventArgument(destination, limit, a7);
785  PIXCopyEventArgument(destination, limit, a8);
786  PIXCopyEventArgument(destination, limit, a9);
787  PIXCopyEventArgument(destination, limit, a10);
788  *destination = PIXEventsBlockEndMarker;
789  threadInfo->destination = destination;
790  }
791  }
792 }
793 
794 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
795 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
796 {
797  UINT64 time = PIXEventsReplaceBlock(false);
798  if (time)
799  {
800  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
801  UINT64* destination = threadInfo->destination;
802  UINT64* limit = threadInfo->limit;
803  if (destination < limit)
804  {
805  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
806  *destination++ = color;
807 
808  PIXCopyEventArgument(destination, limit, formatString);
809  PIXCopyEventArgument(destination, limit, a1);
810  PIXCopyEventArgument(destination, limit, a2);
811  PIXCopyEventArgument(destination, limit, a3);
812  PIXCopyEventArgument(destination, limit, a4);
813  PIXCopyEventArgument(destination, limit, a5);
814  PIXCopyEventArgument(destination, limit, a6);
815  PIXCopyEventArgument(destination, limit, a7);
816  PIXCopyEventArgument(destination, limit, a8);
817  PIXCopyEventArgument(destination, limit, a9);
818  PIXCopyEventArgument(destination, limit, a10);
819  PIXCopyEventArgument(destination, limit, a11);
820  *destination = PIXEventsBlockEndMarker;
821  threadInfo->destination = destination;
822  }
823  }
824 }
825 
826 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
827 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
828 {
829  UINT64 time = PIXEventsReplaceBlock(false);
830  if (time)
831  {
832  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
833  UINT64* destination = threadInfo->destination;
834  UINT64* limit = threadInfo->limit;
835  if (destination < limit)
836  {
837  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
838  *destination++ = color;
839 
840  PIXCopyEventArgument(destination, limit, formatString);
841  PIXCopyEventArgument(destination, limit, a1);
842  PIXCopyEventArgument(destination, limit, a2);
843  PIXCopyEventArgument(destination, limit, a3);
844  PIXCopyEventArgument(destination, limit, a4);
845  PIXCopyEventArgument(destination, limit, a5);
846  PIXCopyEventArgument(destination, limit, a6);
847  PIXCopyEventArgument(destination, limit, a7);
848  PIXCopyEventArgument(destination, limit, a8);
849  PIXCopyEventArgument(destination, limit, a9);
850  PIXCopyEventArgument(destination, limit, a10);
851  PIXCopyEventArgument(destination, limit, a11);
852  PIXCopyEventArgument(destination, limit, a12);
853  *destination = PIXEventsBlockEndMarker;
854  threadInfo->destination = destination;
855  }
856  }
857 }
858 
859 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
860 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
861 {
862  UINT64 time = PIXEventsReplaceBlock(false);
863  if (time)
864  {
865  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
866  UINT64* destination = threadInfo->destination;
867  UINT64* limit = threadInfo->limit;
868  if (destination < limit)
869  {
870  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
871  *destination++ = color;
872 
873  PIXCopyEventArgument(destination, limit, formatString);
874  PIXCopyEventArgument(destination, limit, a1);
875  PIXCopyEventArgument(destination, limit, a2);
876  PIXCopyEventArgument(destination, limit, a3);
877  PIXCopyEventArgument(destination, limit, a4);
878  PIXCopyEventArgument(destination, limit, a5);
879  PIXCopyEventArgument(destination, limit, a6);
880  PIXCopyEventArgument(destination, limit, a7);
881  PIXCopyEventArgument(destination, limit, a8);
882  PIXCopyEventArgument(destination, limit, a9);
883  PIXCopyEventArgument(destination, limit, a10);
884  PIXCopyEventArgument(destination, limit, a11);
885  PIXCopyEventArgument(destination, limit, a12);
886  PIXCopyEventArgument(destination, limit, a13);
887  *destination = PIXEventsBlockEndMarker;
888  threadInfo->destination = destination;
889  }
890  }
891 }
892 
893 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
894 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
895 {
896  UINT64 time = PIXEventsReplaceBlock(false);
897  if (time)
898  {
899  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
900  UINT64* destination = threadInfo->destination;
901  UINT64* limit = threadInfo->limit;
902  if (destination < limit)
903  {
904  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
905  *destination++ = color;
906 
907  PIXCopyEventArgument(destination, limit, formatString);
908  PIXCopyEventArgument(destination, limit, a1);
909  PIXCopyEventArgument(destination, limit, a2);
910  PIXCopyEventArgument(destination, limit, a3);
911  PIXCopyEventArgument(destination, limit, a4);
912  PIXCopyEventArgument(destination, limit, a5);
913  PIXCopyEventArgument(destination, limit, a6);
914  PIXCopyEventArgument(destination, limit, a7);
915  PIXCopyEventArgument(destination, limit, a8);
916  PIXCopyEventArgument(destination, limit, a9);
917  PIXCopyEventArgument(destination, limit, a10);
918  PIXCopyEventArgument(destination, limit, a11);
919  PIXCopyEventArgument(destination, limit, a12);
920  PIXCopyEventArgument(destination, limit, a13);
921  PIXCopyEventArgument(destination, limit, a14);
922  *destination = PIXEventsBlockEndMarker;
923  threadInfo->destination = destination;
924  }
925  }
926 }
927 
928 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
929 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
930 {
931  UINT64 time = PIXEventsReplaceBlock(false);
932  if (time)
933  {
934  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
935  UINT64* destination = threadInfo->destination;
936  UINT64* limit = threadInfo->limit;
937  if (destination < limit)
938  {
939  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
940  *destination++ = color;
941 
942  PIXCopyEventArgument(destination, limit, formatString);
943  PIXCopyEventArgument(destination, limit, a1);
944  PIXCopyEventArgument(destination, limit, a2);
945  PIXCopyEventArgument(destination, limit, a3);
946  PIXCopyEventArgument(destination, limit, a4);
947  PIXCopyEventArgument(destination, limit, a5);
948  PIXCopyEventArgument(destination, limit, a6);
949  PIXCopyEventArgument(destination, limit, a7);
950  PIXCopyEventArgument(destination, limit, a8);
951  PIXCopyEventArgument(destination, limit, a9);
952  PIXCopyEventArgument(destination, limit, a10);
953  PIXCopyEventArgument(destination, limit, a11);
954  PIXCopyEventArgument(destination, limit, a12);
955  PIXCopyEventArgument(destination, limit, a13);
956  PIXCopyEventArgument(destination, limit, a14);
957  PIXCopyEventArgument(destination, limit, a15);
958  *destination = PIXEventsBlockEndMarker;
959  threadInfo->destination = destination;
960  }
961  }
962 }
963 
964 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
965 __declspec(noinline) inline void PIXBeginEventAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
966 {
967  UINT64 time = PIXEventsReplaceBlock(false);
968  if (time)
969  {
970  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
971  UINT64* destination = threadInfo->destination;
972  UINT64* limit = threadInfo->limit;
973  if (destination < limit)
974  {
975  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
976  *destination++ = color;
977 
978  PIXCopyEventArgument(destination, limit, formatString);
979  PIXCopyEventArgument(destination, limit, a1);
980  PIXCopyEventArgument(destination, limit, a2);
981  PIXCopyEventArgument(destination, limit, a3);
982  PIXCopyEventArgument(destination, limit, a4);
983  PIXCopyEventArgument(destination, limit, a5);
984  PIXCopyEventArgument(destination, limit, a6);
985  PIXCopyEventArgument(destination, limit, a7);
986  PIXCopyEventArgument(destination, limit, a8);
987  PIXCopyEventArgument(destination, limit, a9);
988  PIXCopyEventArgument(destination, limit, a10);
989  PIXCopyEventArgument(destination, limit, a11);
990  PIXCopyEventArgument(destination, limit, a12);
991  PIXCopyEventArgument(destination, limit, a13);
992  PIXCopyEventArgument(destination, limit, a14);
993  PIXCopyEventArgument(destination, limit, a15);
994  PIXCopyEventArgument(destination, limit, a16);
995  *destination = PIXEventsBlockEndMarker;
996  threadInfo->destination = destination;
997  }
998  }
999 }
1000 
1001 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString)
1002 {
1003  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1004  UINT64* destination = threadInfo->destination;
1005  UINT64* limit = threadInfo->biasedLimit;
1006  if (destination < limit)
1007  {
1008  limit += PIXEventsSafeFastCopySpaceQwords;
1009  UINT64 time = PIXGetTimestampCounter();
1010  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_NoArgs);
1011  *destination++ = color;
1012 
1013  PIXCopyEventArgument(destination, limit, formatString);
1014 
1015  *destination = PIXEventsBlockEndMarker;
1016  threadInfo->destination = destination;
1017  }
1018  else if (limit != nullptr)
1019  {
1020  PIXBeginEventAllocate(color, formatString);
1021  }
1022 }
1023 
1024 template<class T1>
1025 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1)
1026 {
1027  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1028  UINT64* destination = threadInfo->destination;
1029  UINT64* limit = threadInfo->biasedLimit;
1030  if (destination < limit)
1031  {
1032  limit += PIXEventsSafeFastCopySpaceQwords;
1033  UINT64 time = PIXGetTimestampCounter();
1034  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1035  *destination++ = color;
1036 
1037  PIXCopyEventArgument(destination, limit, formatString);
1038  PIXCopyEventArgument(destination, limit, a1);
1039 
1040  *destination = PIXEventsBlockEndMarker;
1041  threadInfo->destination = destination;
1042  }
1043  else if (limit != nullptr)
1044  {
1045  PIXBeginEventAllocate(color, formatString, a1);
1046  }
1047 }
1048 
1049 template<class T1, class T2>
1050 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
1051 {
1052  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1053  UINT64* destination = threadInfo->destination;
1054  UINT64* limit = threadInfo->biasedLimit;
1055  if (destination < limit)
1056  {
1057  limit += PIXEventsSafeFastCopySpaceQwords;
1058  UINT64 time = PIXGetTimestampCounter();
1059  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1060  *destination++ = color;
1061 
1062  PIXCopyEventArgument(destination, limit, formatString);
1063  PIXCopyEventArgument(destination, limit, a1);
1064  PIXCopyEventArgument(destination, limit, a2);
1065 
1066  *destination = PIXEventsBlockEndMarker;
1067  threadInfo->destination = destination;
1068  }
1069  else if (limit != nullptr)
1070  {
1071  PIXBeginEventAllocate(color, formatString, a1, a2);
1072  }
1073 }
1074 
1075 template<class T1, class T2, class T3>
1076 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
1077 {
1078  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1079  UINT64* destination = threadInfo->destination;
1080  UINT64* limit = threadInfo->biasedLimit;
1081  if (destination < limit)
1082  {
1083  limit += PIXEventsSafeFastCopySpaceQwords;
1084  UINT64 time = PIXGetTimestampCounter();
1085  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1086  *destination++ = color;
1087 
1088  PIXCopyEventArgument(destination, limit, formatString);
1089  PIXCopyEventArgument(destination, limit, a1);
1090  PIXCopyEventArgument(destination, limit, a2);
1091  PIXCopyEventArgument(destination, limit, a3);
1092 
1093  *destination = PIXEventsBlockEndMarker;
1094  threadInfo->destination = destination;
1095  }
1096  else if (limit != nullptr)
1097  {
1098  PIXBeginEventAllocate(color, formatString, a1, a2, a3);
1099  }
1100 }
1101 
1102 template<class T1, class T2, class T3, class T4>
1103 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
1104 {
1105  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1106  UINT64* destination = threadInfo->destination;
1107  UINT64* limit = threadInfo->biasedLimit;
1108  if (destination < limit)
1109  {
1110  limit += PIXEventsSafeFastCopySpaceQwords;
1111  UINT64 time = PIXGetTimestampCounter();
1112  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1113  *destination++ = color;
1114 
1115  PIXCopyEventArgument(destination, limit, formatString);
1116  PIXCopyEventArgument(destination, limit, a1);
1117  PIXCopyEventArgument(destination, limit, a2);
1118  PIXCopyEventArgument(destination, limit, a3);
1119  PIXCopyEventArgument(destination, limit, a4);
1120 
1121  *destination = PIXEventsBlockEndMarker;
1122  threadInfo->destination = destination;
1123  }
1124  else if (limit != nullptr)
1125  {
1126  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4);
1127  }
1128 }
1129 
1130 template<class T1, class T2, class T3, class T4, class T5>
1131 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1132 {
1133  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1134  UINT64* destination = threadInfo->destination;
1135  UINT64* limit = threadInfo->biasedLimit;
1136  if (destination < limit)
1137  {
1138  limit += PIXEventsSafeFastCopySpaceQwords;
1139  UINT64 time = PIXGetTimestampCounter();
1140  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1141  *destination++ = color;
1142 
1143  PIXCopyEventArgument(destination, limit, formatString);
1144  PIXCopyEventArgument(destination, limit, a1);
1145  PIXCopyEventArgument(destination, limit, a2);
1146  PIXCopyEventArgument(destination, limit, a3);
1147  PIXCopyEventArgument(destination, limit, a4);
1148  PIXCopyEventArgument(destination, limit, a5);
1149 
1150  *destination = PIXEventsBlockEndMarker;
1151  threadInfo->destination = destination;
1152  }
1153  else if (limit != nullptr)
1154  {
1155  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5);
1156  }
1157 }
1158 
1159 template<class T1, class T2, class T3, class T4, class T5, class T6>
1160 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
1161 {
1162  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1163  UINT64* destination = threadInfo->destination;
1164  UINT64* limit = threadInfo->biasedLimit;
1165  if (destination < limit)
1166  {
1167  limit += PIXEventsSafeFastCopySpaceQwords;
1168  UINT64 time = PIXGetTimestampCounter();
1169  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1170  *destination++ = color;
1171 
1172  PIXCopyEventArgument(destination, limit, formatString);
1173  PIXCopyEventArgument(destination, limit, a1);
1174  PIXCopyEventArgument(destination, limit, a2);
1175  PIXCopyEventArgument(destination, limit, a3);
1176  PIXCopyEventArgument(destination, limit, a4);
1177  PIXCopyEventArgument(destination, limit, a5);
1178  PIXCopyEventArgument(destination, limit, a6);
1179 
1180  *destination = PIXEventsBlockEndMarker;
1181  threadInfo->destination = destination;
1182  }
1183  else if (limit != nullptr)
1184  {
1185  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6);
1186  }
1187 }
1188 
1189 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
1190 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
1191 {
1192  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1193  UINT64* destination = threadInfo->destination;
1194  UINT64* limit = threadInfo->biasedLimit;
1195  if (destination < limit)
1196  {
1197  limit += PIXEventsSafeFastCopySpaceQwords;
1198  UINT64 time = PIXGetTimestampCounter();
1199  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1200  *destination++ = color;
1201 
1202  PIXCopyEventArgument(destination, limit, formatString);
1203  PIXCopyEventArgument(destination, limit, a1);
1204  PIXCopyEventArgument(destination, limit, a2);
1205  PIXCopyEventArgument(destination, limit, a3);
1206  PIXCopyEventArgument(destination, limit, a4);
1207  PIXCopyEventArgument(destination, limit, a5);
1208  PIXCopyEventArgument(destination, limit, a6);
1209  PIXCopyEventArgument(destination, limit, a7);
1210 
1211  *destination = PIXEventsBlockEndMarker;
1212  threadInfo->destination = destination;
1213  }
1214  else if (limit != nullptr)
1215  {
1216  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7);
1217  }
1218 }
1219 
1220 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
1221 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
1222 {
1223  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1224  UINT64* destination = threadInfo->destination;
1225  UINT64* limit = threadInfo->biasedLimit;
1226  if (destination < limit)
1227  {
1228  limit += PIXEventsSafeFastCopySpaceQwords;
1229  UINT64 time = PIXGetTimestampCounter();
1230  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1231  *destination++ = color;
1232 
1233  PIXCopyEventArgument(destination, limit, formatString);
1234  PIXCopyEventArgument(destination, limit, a1);
1235  PIXCopyEventArgument(destination, limit, a2);
1236  PIXCopyEventArgument(destination, limit, a3);
1237  PIXCopyEventArgument(destination, limit, a4);
1238  PIXCopyEventArgument(destination, limit, a5);
1239  PIXCopyEventArgument(destination, limit, a6);
1240  PIXCopyEventArgument(destination, limit, a7);
1241  PIXCopyEventArgument(destination, limit, a8);
1242 
1243  *destination = PIXEventsBlockEndMarker;
1244  threadInfo->destination = destination;
1245  }
1246  else if (limit != nullptr)
1247  {
1248  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
1249  }
1250 }
1251 
1252 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
1253 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
1254 {
1255  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1256  UINT64* destination = threadInfo->destination;
1257  UINT64* limit = threadInfo->biasedLimit;
1258  if (destination < limit)
1259  {
1260  limit += PIXEventsSafeFastCopySpaceQwords;
1261  UINT64 time = PIXGetTimestampCounter();
1262  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1263  *destination++ = color;
1264 
1265  PIXCopyEventArgument(destination, limit, formatString);
1266  PIXCopyEventArgument(destination, limit, a1);
1267  PIXCopyEventArgument(destination, limit, a2);
1268  PIXCopyEventArgument(destination, limit, a3);
1269  PIXCopyEventArgument(destination, limit, a4);
1270  PIXCopyEventArgument(destination, limit, a5);
1271  PIXCopyEventArgument(destination, limit, a6);
1272  PIXCopyEventArgument(destination, limit, a7);
1273  PIXCopyEventArgument(destination, limit, a8);
1274  PIXCopyEventArgument(destination, limit, a9);
1275 
1276  *destination = PIXEventsBlockEndMarker;
1277  threadInfo->destination = destination;
1278  }
1279  else if (limit != nullptr)
1280  {
1281  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
1282  }
1283 }
1284 
1285 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
1286 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
1287 {
1288  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1289  UINT64* destination = threadInfo->destination;
1290  UINT64* limit = threadInfo->biasedLimit;
1291  if (destination < limit)
1292  {
1293  limit += PIXEventsSafeFastCopySpaceQwords;
1294  UINT64 time = PIXGetTimestampCounter();
1295  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1296  *destination++ = color;
1297 
1298  PIXCopyEventArgument(destination, limit, formatString);
1299  PIXCopyEventArgument(destination, limit, a1);
1300  PIXCopyEventArgument(destination, limit, a2);
1301  PIXCopyEventArgument(destination, limit, a3);
1302  PIXCopyEventArgument(destination, limit, a4);
1303  PIXCopyEventArgument(destination, limit, a5);
1304  PIXCopyEventArgument(destination, limit, a6);
1305  PIXCopyEventArgument(destination, limit, a7);
1306  PIXCopyEventArgument(destination, limit, a8);
1307  PIXCopyEventArgument(destination, limit, a9);
1308  PIXCopyEventArgument(destination, limit, a10);
1309 
1310  *destination = PIXEventsBlockEndMarker;
1311  threadInfo->destination = destination;
1312  }
1313  else if (limit != nullptr)
1314  {
1315  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
1316  }
1317 }
1318 
1319 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
1320 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
1321 {
1322  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1323  UINT64* destination = threadInfo->destination;
1324  UINT64* limit = threadInfo->biasedLimit;
1325  if (destination < limit)
1326  {
1327  limit += PIXEventsSafeFastCopySpaceQwords;
1328  UINT64 time = PIXGetTimestampCounter();
1329  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1330  *destination++ = color;
1331 
1332  PIXCopyEventArgument(destination, limit, formatString);
1333  PIXCopyEventArgument(destination, limit, a1);
1334  PIXCopyEventArgument(destination, limit, a2);
1335  PIXCopyEventArgument(destination, limit, a3);
1336  PIXCopyEventArgument(destination, limit, a4);
1337  PIXCopyEventArgument(destination, limit, a5);
1338  PIXCopyEventArgument(destination, limit, a6);
1339  PIXCopyEventArgument(destination, limit, a7);
1340  PIXCopyEventArgument(destination, limit, a8);
1341  PIXCopyEventArgument(destination, limit, a9);
1342  PIXCopyEventArgument(destination, limit, a10);
1343  PIXCopyEventArgument(destination, limit, a11);
1344 
1345  *destination = PIXEventsBlockEndMarker;
1346  threadInfo->destination = destination;
1347  }
1348  else if (limit != nullptr)
1349  {
1350  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
1351  }
1352 }
1353 
1354 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
1355 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
1356 {
1357  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1358  UINT64* destination = threadInfo->destination;
1359  UINT64* limit = threadInfo->biasedLimit;
1360  if (destination < limit)
1361  {
1362  limit += PIXEventsSafeFastCopySpaceQwords;
1363  UINT64 time = PIXGetTimestampCounter();
1364  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1365  *destination++ = color;
1366 
1367  PIXCopyEventArgument(destination, limit, formatString);
1368  PIXCopyEventArgument(destination, limit, a1);
1369  PIXCopyEventArgument(destination, limit, a2);
1370  PIXCopyEventArgument(destination, limit, a3);
1371  PIXCopyEventArgument(destination, limit, a4);
1372  PIXCopyEventArgument(destination, limit, a5);
1373  PIXCopyEventArgument(destination, limit, a6);
1374  PIXCopyEventArgument(destination, limit, a7);
1375  PIXCopyEventArgument(destination, limit, a8);
1376  PIXCopyEventArgument(destination, limit, a9);
1377  PIXCopyEventArgument(destination, limit, a10);
1378  PIXCopyEventArgument(destination, limit, a11);
1379  PIXCopyEventArgument(destination, limit, a12);
1380 
1381  *destination = PIXEventsBlockEndMarker;
1382  threadInfo->destination = destination;
1383  }
1384  else if (limit != nullptr)
1385  {
1386  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
1387  }
1388 }
1389 
1390 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
1391 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
1392 {
1393  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1394  UINT64* destination = threadInfo->destination;
1395  UINT64* limit = threadInfo->biasedLimit;
1396  if (destination < limit)
1397  {
1398  limit += PIXEventsSafeFastCopySpaceQwords;
1399  UINT64 time = PIXGetTimestampCounter();
1400  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1401  *destination++ = color;
1402 
1403  PIXCopyEventArgument(destination, limit, formatString);
1404  PIXCopyEventArgument(destination, limit, a1);
1405  PIXCopyEventArgument(destination, limit, a2);
1406  PIXCopyEventArgument(destination, limit, a3);
1407  PIXCopyEventArgument(destination, limit, a4);
1408  PIXCopyEventArgument(destination, limit, a5);
1409  PIXCopyEventArgument(destination, limit, a6);
1410  PIXCopyEventArgument(destination, limit, a7);
1411  PIXCopyEventArgument(destination, limit, a8);
1412  PIXCopyEventArgument(destination, limit, a9);
1413  PIXCopyEventArgument(destination, limit, a10);
1414  PIXCopyEventArgument(destination, limit, a11);
1415  PIXCopyEventArgument(destination, limit, a12);
1416  PIXCopyEventArgument(destination, limit, a13);
1417 
1418  *destination = PIXEventsBlockEndMarker;
1419  threadInfo->destination = destination;
1420  }
1421  else if (limit != nullptr)
1422  {
1423  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
1424  }
1425 }
1426 
1427 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
1428 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
1429 {
1430  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1431  UINT64* destination = threadInfo->destination;
1432  UINT64* limit = threadInfo->biasedLimit;
1433  if (destination < limit)
1434  {
1435  limit += PIXEventsSafeFastCopySpaceQwords;
1436  UINT64 time = PIXGetTimestampCounter();
1437  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1438  *destination++ = color;
1439 
1440  PIXCopyEventArgument(destination, limit, formatString);
1441  PIXCopyEventArgument(destination, limit, a1);
1442  PIXCopyEventArgument(destination, limit, a2);
1443  PIXCopyEventArgument(destination, limit, a3);
1444  PIXCopyEventArgument(destination, limit, a4);
1445  PIXCopyEventArgument(destination, limit, a5);
1446  PIXCopyEventArgument(destination, limit, a6);
1447  PIXCopyEventArgument(destination, limit, a7);
1448  PIXCopyEventArgument(destination, limit, a8);
1449  PIXCopyEventArgument(destination, limit, a9);
1450  PIXCopyEventArgument(destination, limit, a10);
1451  PIXCopyEventArgument(destination, limit, a11);
1452  PIXCopyEventArgument(destination, limit, a12);
1453  PIXCopyEventArgument(destination, limit, a13);
1454  PIXCopyEventArgument(destination, limit, a14);
1455 
1456  *destination = PIXEventsBlockEndMarker;
1457  threadInfo->destination = destination;
1458  }
1459  else if (limit != nullptr)
1460  {
1461  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
1462  }
1463 }
1464 
1465 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
1466 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
1467 {
1468  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1469  UINT64* destination = threadInfo->destination;
1470  UINT64* limit = threadInfo->biasedLimit;
1471  if (destination < limit)
1472  {
1473  limit += PIXEventsSafeFastCopySpaceQwords;
1474  UINT64 time = PIXGetTimestampCounter();
1475  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1476  *destination++ = color;
1477 
1478  PIXCopyEventArgument(destination, limit, formatString);
1479  PIXCopyEventArgument(destination, limit, a1);
1480  PIXCopyEventArgument(destination, limit, a2);
1481  PIXCopyEventArgument(destination, limit, a3);
1482  PIXCopyEventArgument(destination, limit, a4);
1483  PIXCopyEventArgument(destination, limit, a5);
1484  PIXCopyEventArgument(destination, limit, a6);
1485  PIXCopyEventArgument(destination, limit, a7);
1486  PIXCopyEventArgument(destination, limit, a8);
1487  PIXCopyEventArgument(destination, limit, a9);
1488  PIXCopyEventArgument(destination, limit, a10);
1489  PIXCopyEventArgument(destination, limit, a11);
1490  PIXCopyEventArgument(destination, limit, a12);
1491  PIXCopyEventArgument(destination, limit, a13);
1492  PIXCopyEventArgument(destination, limit, a14);
1493  PIXCopyEventArgument(destination, limit, a15);
1494 
1495  *destination = PIXEventsBlockEndMarker;
1496  threadInfo->destination = destination;
1497  }
1498  else if (limit != nullptr)
1499  {
1500  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
1501  }
1502 }
1503 
1504 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
1505 inline void PIXBeginEvent(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
1506 {
1507  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1508  UINT64* destination = threadInfo->destination;
1509  UINT64* limit = threadInfo->biasedLimit;
1510  if (destination < limit)
1511  {
1512  limit += PIXEventsSafeFastCopySpaceQwords;
1513  UINT64 time = PIXGetTimestampCounter();
1514  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1515  *destination++ = color;
1516 
1517  PIXCopyEventArgument(destination, limit, formatString);
1518  PIXCopyEventArgument(destination, limit, a1);
1519  PIXCopyEventArgument(destination, limit, a2);
1520  PIXCopyEventArgument(destination, limit, a3);
1521  PIXCopyEventArgument(destination, limit, a4);
1522  PIXCopyEventArgument(destination, limit, a5);
1523  PIXCopyEventArgument(destination, limit, a6);
1524  PIXCopyEventArgument(destination, limit, a7);
1525  PIXCopyEventArgument(destination, limit, a8);
1526  PIXCopyEventArgument(destination, limit, a9);
1527  PIXCopyEventArgument(destination, limit, a10);
1528  PIXCopyEventArgument(destination, limit, a11);
1529  PIXCopyEventArgument(destination, limit, a12);
1530  PIXCopyEventArgument(destination, limit, a13);
1531  PIXCopyEventArgument(destination, limit, a14);
1532  PIXCopyEventArgument(destination, limit, a15);
1533  PIXCopyEventArgument(destination, limit, a16);
1534 
1535  *destination = PIXEventsBlockEndMarker;
1536  threadInfo->destination = destination;
1537  }
1538  else if (limit != nullptr)
1539  {
1540  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
1541  }
1542 }
1543 
1544 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString)
1545 {
1546  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1547  UINT64* destination = threadInfo->destination;
1548  UINT64* limit = threadInfo->biasedLimit;
1549  if (destination < limit)
1550  {
1551  limit += PIXEventsSafeFastCopySpaceQwords;
1552  UINT64 time = PIXGetTimestampCounter();
1553  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_NoArgs);
1554  *destination++ = color;
1555 
1556  PIXCopyEventArgument(destination, limit, formatString);
1557 
1558  *destination = PIXEventsBlockEndMarker;
1559  threadInfo->destination = destination;
1560  }
1561  else if (limit != nullptr)
1562  {
1563  PIXBeginEventAllocate(color, formatString);
1564  }
1565 }
1566 
1567 template<class T1>
1568 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1)
1569 {
1570  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1571  UINT64* destination = threadInfo->destination;
1572  UINT64* limit = threadInfo->biasedLimit;
1573  if (destination < limit)
1574  {
1575  limit += PIXEventsSafeFastCopySpaceQwords;
1576  UINT64 time = PIXGetTimestampCounter();
1577  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1578  *destination++ = color;
1579 
1580  PIXCopyEventArgument(destination, limit, formatString);
1581  PIXCopyEventArgument(destination, limit, a1);
1582 
1583  *destination = PIXEventsBlockEndMarker;
1584  threadInfo->destination = destination;
1585  }
1586  else if (limit != nullptr)
1587  {
1588  PIXBeginEventAllocate(color, formatString, a1);
1589  }
1590 }
1591 
1592 template<class T1, class T2>
1593 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
1594 {
1595  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1596  UINT64* destination = threadInfo->destination;
1597  UINT64* limit = threadInfo->biasedLimit;
1598  if (destination < limit)
1599  {
1600  limit += PIXEventsSafeFastCopySpaceQwords;
1601  UINT64 time = PIXGetTimestampCounter();
1602  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1603  *destination++ = color;
1604 
1605  PIXCopyEventArgument(destination, limit, formatString);
1606  PIXCopyEventArgument(destination, limit, a1);
1607  PIXCopyEventArgument(destination, limit, a2);
1608 
1609  *destination = PIXEventsBlockEndMarker;
1610  threadInfo->destination = destination;
1611  }
1612  else if (limit != nullptr)
1613  {
1614  PIXBeginEventAllocate(color, formatString, a1, a2);
1615  }
1616 }
1617 
1618 template<class T1, class T2, class T3>
1619 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
1620 {
1621  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1622  UINT64* destination = threadInfo->destination;
1623  UINT64* limit = threadInfo->biasedLimit;
1624  if (destination < limit)
1625  {
1626  limit += PIXEventsSafeFastCopySpaceQwords;
1627  UINT64 time = PIXGetTimestampCounter();
1628  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1629  *destination++ = color;
1630 
1631  PIXCopyEventArgument(destination, limit, formatString);
1632  PIXCopyEventArgument(destination, limit, a1);
1633  PIXCopyEventArgument(destination, limit, a2);
1634  PIXCopyEventArgument(destination, limit, a3);
1635 
1636  *destination = PIXEventsBlockEndMarker;
1637  threadInfo->destination = destination;
1638  }
1639  else if (limit != nullptr)
1640  {
1641  PIXBeginEventAllocate(color, formatString, a1, a2, a3);
1642  }
1643 }
1644 
1645 template<class T1, class T2, class T3, class T4>
1646 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
1647 {
1648  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1649  UINT64* destination = threadInfo->destination;
1650  UINT64* limit = threadInfo->biasedLimit;
1651  if (destination < limit)
1652  {
1653  limit += PIXEventsSafeFastCopySpaceQwords;
1654  UINT64 time = PIXGetTimestampCounter();
1655  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1656  *destination++ = color;
1657 
1658  PIXCopyEventArgument(destination, limit, formatString);
1659  PIXCopyEventArgument(destination, limit, a1);
1660  PIXCopyEventArgument(destination, limit, a2);
1661  PIXCopyEventArgument(destination, limit, a3);
1662  PIXCopyEventArgument(destination, limit, a4);
1663 
1664  *destination = PIXEventsBlockEndMarker;
1665  threadInfo->destination = destination;
1666  }
1667  else if (limit != nullptr)
1668  {
1669  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4);
1670  }
1671 }
1672 
1673 template<class T1, class T2, class T3, class T4, class T5>
1674 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
1675 {
1676  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1677  UINT64* destination = threadInfo->destination;
1678  UINT64* limit = threadInfo->biasedLimit;
1679  if (destination < limit)
1680  {
1681  limit += PIXEventsSafeFastCopySpaceQwords;
1682  UINT64 time = PIXGetTimestampCounter();
1683  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1684  *destination++ = color;
1685 
1686  PIXCopyEventArgument(destination, limit, formatString);
1687  PIXCopyEventArgument(destination, limit, a1);
1688  PIXCopyEventArgument(destination, limit, a2);
1689  PIXCopyEventArgument(destination, limit, a3);
1690  PIXCopyEventArgument(destination, limit, a4);
1691  PIXCopyEventArgument(destination, limit, a5);
1692 
1693  *destination = PIXEventsBlockEndMarker;
1694  threadInfo->destination = destination;
1695  }
1696  else if (limit != nullptr)
1697  {
1698  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5);
1699  }
1700 }
1701 
1702 template<class T1, class T2, class T3, class T4, class T5, class T6>
1703 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
1704 {
1705  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1706  UINT64* destination = threadInfo->destination;
1707  UINT64* limit = threadInfo->biasedLimit;
1708  if (destination < limit)
1709  {
1710  limit += PIXEventsSafeFastCopySpaceQwords;
1711  UINT64 time = PIXGetTimestampCounter();
1712  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1713  *destination++ = color;
1714 
1715  PIXCopyEventArgument(destination, limit, formatString);
1716  PIXCopyEventArgument(destination, limit, a1);
1717  PIXCopyEventArgument(destination, limit, a2);
1718  PIXCopyEventArgument(destination, limit, a3);
1719  PIXCopyEventArgument(destination, limit, a4);
1720  PIXCopyEventArgument(destination, limit, a5);
1721  PIXCopyEventArgument(destination, limit, a6);
1722 
1723  *destination = PIXEventsBlockEndMarker;
1724  threadInfo->destination = destination;
1725  }
1726  else if (limit != nullptr)
1727  {
1728  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6);
1729  }
1730 }
1731 
1732 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
1733 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
1734 {
1735  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1736  UINT64* destination = threadInfo->destination;
1737  UINT64* limit = threadInfo->biasedLimit;
1738  if (destination < limit)
1739  {
1740  limit += PIXEventsSafeFastCopySpaceQwords;
1741  UINT64 time = PIXGetTimestampCounter();
1742  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1743  *destination++ = color;
1744 
1745  PIXCopyEventArgument(destination, limit, formatString);
1746  PIXCopyEventArgument(destination, limit, a1);
1747  PIXCopyEventArgument(destination, limit, a2);
1748  PIXCopyEventArgument(destination, limit, a3);
1749  PIXCopyEventArgument(destination, limit, a4);
1750  PIXCopyEventArgument(destination, limit, a5);
1751  PIXCopyEventArgument(destination, limit, a6);
1752  PIXCopyEventArgument(destination, limit, a7);
1753 
1754  *destination = PIXEventsBlockEndMarker;
1755  threadInfo->destination = destination;
1756  }
1757  else if (limit != nullptr)
1758  {
1759  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7);
1760  }
1761 }
1762 
1763 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
1764 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
1765 {
1766  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1767  UINT64* destination = threadInfo->destination;
1768  UINT64* limit = threadInfo->biasedLimit;
1769  if (destination < limit)
1770  {
1771  limit += PIXEventsSafeFastCopySpaceQwords;
1772  UINT64 time = PIXGetTimestampCounter();
1773  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1774  *destination++ = color;
1775 
1776  PIXCopyEventArgument(destination, limit, formatString);
1777  PIXCopyEventArgument(destination, limit, a1);
1778  PIXCopyEventArgument(destination, limit, a2);
1779  PIXCopyEventArgument(destination, limit, a3);
1780  PIXCopyEventArgument(destination, limit, a4);
1781  PIXCopyEventArgument(destination, limit, a5);
1782  PIXCopyEventArgument(destination, limit, a6);
1783  PIXCopyEventArgument(destination, limit, a7);
1784  PIXCopyEventArgument(destination, limit, a8);
1785 
1786  *destination = PIXEventsBlockEndMarker;
1787  threadInfo->destination = destination;
1788  }
1789  else if (limit != nullptr)
1790  {
1791  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
1792  }
1793 }
1794 
1795 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
1796 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
1797 {
1798  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1799  UINT64* destination = threadInfo->destination;
1800  UINT64* limit = threadInfo->biasedLimit;
1801  if (destination < limit)
1802  {
1803  limit += PIXEventsSafeFastCopySpaceQwords;
1804  UINT64 time = PIXGetTimestampCounter();
1805  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1806  *destination++ = color;
1807 
1808  PIXCopyEventArgument(destination, limit, formatString);
1809  PIXCopyEventArgument(destination, limit, a1);
1810  PIXCopyEventArgument(destination, limit, a2);
1811  PIXCopyEventArgument(destination, limit, a3);
1812  PIXCopyEventArgument(destination, limit, a4);
1813  PIXCopyEventArgument(destination, limit, a5);
1814  PIXCopyEventArgument(destination, limit, a6);
1815  PIXCopyEventArgument(destination, limit, a7);
1816  PIXCopyEventArgument(destination, limit, a8);
1817  PIXCopyEventArgument(destination, limit, a9);
1818 
1819  *destination = PIXEventsBlockEndMarker;
1820  threadInfo->destination = destination;
1821  }
1822  else if (limit != nullptr)
1823  {
1824  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
1825  }
1826 }
1827 
1828 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
1829 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
1830 {
1831  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1832  UINT64* destination = threadInfo->destination;
1833  UINT64* limit = threadInfo->biasedLimit;
1834  if (destination < limit)
1835  {
1836  limit += PIXEventsSafeFastCopySpaceQwords;
1837  UINT64 time = PIXGetTimestampCounter();
1838  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1839  *destination++ = color;
1840 
1841  PIXCopyEventArgument(destination, limit, formatString);
1842  PIXCopyEventArgument(destination, limit, a1);
1843  PIXCopyEventArgument(destination, limit, a2);
1844  PIXCopyEventArgument(destination, limit, a3);
1845  PIXCopyEventArgument(destination, limit, a4);
1846  PIXCopyEventArgument(destination, limit, a5);
1847  PIXCopyEventArgument(destination, limit, a6);
1848  PIXCopyEventArgument(destination, limit, a7);
1849  PIXCopyEventArgument(destination, limit, a8);
1850  PIXCopyEventArgument(destination, limit, a9);
1851  PIXCopyEventArgument(destination, limit, a10);
1852 
1853  *destination = PIXEventsBlockEndMarker;
1854  threadInfo->destination = destination;
1855  }
1856  else if (limit != nullptr)
1857  {
1858  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
1859  }
1860 }
1861 
1862 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
1863 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
1864 {
1865  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1866  UINT64* destination = threadInfo->destination;
1867  UINT64* limit = threadInfo->biasedLimit;
1868  if (destination < limit)
1869  {
1870  limit += PIXEventsSafeFastCopySpaceQwords;
1871  UINT64 time = PIXGetTimestampCounter();
1872  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1873  *destination++ = color;
1874 
1875  PIXCopyEventArgument(destination, limit, formatString);
1876  PIXCopyEventArgument(destination, limit, a1);
1877  PIXCopyEventArgument(destination, limit, a2);
1878  PIXCopyEventArgument(destination, limit, a3);
1879  PIXCopyEventArgument(destination, limit, a4);
1880  PIXCopyEventArgument(destination, limit, a5);
1881  PIXCopyEventArgument(destination, limit, a6);
1882  PIXCopyEventArgument(destination, limit, a7);
1883  PIXCopyEventArgument(destination, limit, a8);
1884  PIXCopyEventArgument(destination, limit, a9);
1885  PIXCopyEventArgument(destination, limit, a10);
1886  PIXCopyEventArgument(destination, limit, a11);
1887 
1888  *destination = PIXEventsBlockEndMarker;
1889  threadInfo->destination = destination;
1890  }
1891  else if (limit != nullptr)
1892  {
1893  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
1894  }
1895 }
1896 
1897 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
1898 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
1899 {
1900  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1901  UINT64* destination = threadInfo->destination;
1902  UINT64* limit = threadInfo->biasedLimit;
1903  if (destination < limit)
1904  {
1905  limit += PIXEventsSafeFastCopySpaceQwords;
1906  UINT64 time = PIXGetTimestampCounter();
1907  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1908  *destination++ = color;
1909 
1910  PIXCopyEventArgument(destination, limit, formatString);
1911  PIXCopyEventArgument(destination, limit, a1);
1912  PIXCopyEventArgument(destination, limit, a2);
1913  PIXCopyEventArgument(destination, limit, a3);
1914  PIXCopyEventArgument(destination, limit, a4);
1915  PIXCopyEventArgument(destination, limit, a5);
1916  PIXCopyEventArgument(destination, limit, a6);
1917  PIXCopyEventArgument(destination, limit, a7);
1918  PIXCopyEventArgument(destination, limit, a8);
1919  PIXCopyEventArgument(destination, limit, a9);
1920  PIXCopyEventArgument(destination, limit, a10);
1921  PIXCopyEventArgument(destination, limit, a11);
1922  PIXCopyEventArgument(destination, limit, a12);
1923 
1924  *destination = PIXEventsBlockEndMarker;
1925  threadInfo->destination = destination;
1926  }
1927  else if (limit != nullptr)
1928  {
1929  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
1930  }
1931 }
1932 
1933 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
1934 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
1935 {
1936  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1937  UINT64* destination = threadInfo->destination;
1938  UINT64* limit = threadInfo->biasedLimit;
1939  if (destination < limit)
1940  {
1941  limit += PIXEventsSafeFastCopySpaceQwords;
1942  UINT64 time = PIXGetTimestampCounter();
1943  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1944  *destination++ = color;
1945 
1946  PIXCopyEventArgument(destination, limit, formatString);
1947  PIXCopyEventArgument(destination, limit, a1);
1948  PIXCopyEventArgument(destination, limit, a2);
1949  PIXCopyEventArgument(destination, limit, a3);
1950  PIXCopyEventArgument(destination, limit, a4);
1951  PIXCopyEventArgument(destination, limit, a5);
1952  PIXCopyEventArgument(destination, limit, a6);
1953  PIXCopyEventArgument(destination, limit, a7);
1954  PIXCopyEventArgument(destination, limit, a8);
1955  PIXCopyEventArgument(destination, limit, a9);
1956  PIXCopyEventArgument(destination, limit, a10);
1957  PIXCopyEventArgument(destination, limit, a11);
1958  PIXCopyEventArgument(destination, limit, a12);
1959  PIXCopyEventArgument(destination, limit, a13);
1960 
1961  *destination = PIXEventsBlockEndMarker;
1962  threadInfo->destination = destination;
1963  }
1964  else if (limit != nullptr)
1965  {
1966  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
1967  }
1968 }
1969 
1970 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
1971 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
1972 {
1973  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
1974  UINT64* destination = threadInfo->destination;
1975  UINT64* limit = threadInfo->biasedLimit;
1976  if (destination < limit)
1977  {
1978  limit += PIXEventsSafeFastCopySpaceQwords;
1979  UINT64 time = PIXGetTimestampCounter();
1980  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
1981  *destination++ = color;
1982 
1983  PIXCopyEventArgument(destination, limit, formatString);
1984  PIXCopyEventArgument(destination, limit, a1);
1985  PIXCopyEventArgument(destination, limit, a2);
1986  PIXCopyEventArgument(destination, limit, a3);
1987  PIXCopyEventArgument(destination, limit, a4);
1988  PIXCopyEventArgument(destination, limit, a5);
1989  PIXCopyEventArgument(destination, limit, a6);
1990  PIXCopyEventArgument(destination, limit, a7);
1991  PIXCopyEventArgument(destination, limit, a8);
1992  PIXCopyEventArgument(destination, limit, a9);
1993  PIXCopyEventArgument(destination, limit, a10);
1994  PIXCopyEventArgument(destination, limit, a11);
1995  PIXCopyEventArgument(destination, limit, a12);
1996  PIXCopyEventArgument(destination, limit, a13);
1997  PIXCopyEventArgument(destination, limit, a14);
1998 
1999  *destination = PIXEventsBlockEndMarker;
2000  threadInfo->destination = destination;
2001  }
2002  else if (limit != nullptr)
2003  {
2004  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
2005  }
2006 }
2007 
2008 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
2009 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
2010 {
2011  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2012  UINT64* destination = threadInfo->destination;
2013  UINT64* limit = threadInfo->biasedLimit;
2014  if (destination < limit)
2015  {
2016  limit += PIXEventsSafeFastCopySpaceQwords;
2017  UINT64 time = PIXGetTimestampCounter();
2018  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
2019  *destination++ = color;
2020 
2021  PIXCopyEventArgument(destination, limit, formatString);
2022  PIXCopyEventArgument(destination, limit, a1);
2023  PIXCopyEventArgument(destination, limit, a2);
2024  PIXCopyEventArgument(destination, limit, a3);
2025  PIXCopyEventArgument(destination, limit, a4);
2026  PIXCopyEventArgument(destination, limit, a5);
2027  PIXCopyEventArgument(destination, limit, a6);
2028  PIXCopyEventArgument(destination, limit, a7);
2029  PIXCopyEventArgument(destination, limit, a8);
2030  PIXCopyEventArgument(destination, limit, a9);
2031  PIXCopyEventArgument(destination, limit, a10);
2032  PIXCopyEventArgument(destination, limit, a11);
2033  PIXCopyEventArgument(destination, limit, a12);
2034  PIXCopyEventArgument(destination, limit, a13);
2035  PIXCopyEventArgument(destination, limit, a14);
2036  PIXCopyEventArgument(destination, limit, a15);
2037 
2038  *destination = PIXEventsBlockEndMarker;
2039  threadInfo->destination = destination;
2040  }
2041  else if (limit != nullptr)
2042  {
2043  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
2044  }
2045 }
2046 
2047 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
2048 inline void PIXBeginEvent(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
2049 {
2050  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2051  UINT64* destination = threadInfo->destination;
2052  UINT64* limit = threadInfo->biasedLimit;
2053  if (destination < limit)
2054  {
2055  limit += PIXEventsSafeFastCopySpaceQwords;
2056  UINT64 time = PIXGetTimestampCounter();
2057  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_VarArgs);
2058  *destination++ = color;
2059 
2060  PIXCopyEventArgument(destination, limit, formatString);
2061  PIXCopyEventArgument(destination, limit, a1);
2062  PIXCopyEventArgument(destination, limit, a2);
2063  PIXCopyEventArgument(destination, limit, a3);
2064  PIXCopyEventArgument(destination, limit, a4);
2065  PIXCopyEventArgument(destination, limit, a5);
2066  PIXCopyEventArgument(destination, limit, a6);
2067  PIXCopyEventArgument(destination, limit, a7);
2068  PIXCopyEventArgument(destination, limit, a8);
2069  PIXCopyEventArgument(destination, limit, a9);
2070  PIXCopyEventArgument(destination, limit, a10);
2071  PIXCopyEventArgument(destination, limit, a11);
2072  PIXCopyEventArgument(destination, limit, a12);
2073  PIXCopyEventArgument(destination, limit, a13);
2074  PIXCopyEventArgument(destination, limit, a14);
2075  PIXCopyEventArgument(destination, limit, a15);
2076  PIXCopyEventArgument(destination, limit, a16);
2077 
2078  *destination = PIXEventsBlockEndMarker;
2079  threadInfo->destination = destination;
2080  }
2081  else if (limit != nullptr)
2082  {
2083  PIXBeginEventAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
2084  }
2085 }
2086 
2087 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString)
2088 {
2089  UINT64 time = PIXEventsReplaceBlock(false);
2090  if (time)
2091  {
2092  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2093  UINT64* destination = threadInfo->destination;
2094  UINT64* limit = threadInfo->limit;
2095  if (destination < limit)
2096  {
2097  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_NoArgs);
2098  *destination++ = color;
2099 
2100  PIXCopyEventArgument(destination, limit, formatString);
2101 
2102  *destination = PIXEventsBlockEndMarker;
2103  threadInfo->destination = destination;
2104  }
2105  }
2106 }
2107 
2108 template<class T1>
2109 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1)
2110 {
2111  UINT64 time = PIXEventsReplaceBlock(false);
2112  if (time)
2113  {
2114  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2115  UINT64* destination = threadInfo->destination;
2116  UINT64* limit = threadInfo->limit;
2117  if (destination < limit)
2118  {
2119  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2120  *destination++ = color;
2121 
2122  PIXCopyEventArgument(destination, limit, formatString);
2123  PIXCopyEventArgument(destination, limit, a1);
2124 
2125  *destination = PIXEventsBlockEndMarker;
2126  threadInfo->destination = destination;
2127  }
2128  }
2129 }
2130 
2131 template<class T1, class T2>
2132 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
2133 {
2134  UINT64 time = PIXEventsReplaceBlock(false);
2135  if (time)
2136  {
2137  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2138  UINT64* destination = threadInfo->destination;
2139  UINT64* limit = threadInfo->limit;
2140  if (destination < limit)
2141  {
2142  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2143  *destination++ = color;
2144 
2145  PIXCopyEventArgument(destination, limit, formatString);
2146  PIXCopyEventArgument(destination, limit, a1);
2147  PIXCopyEventArgument(destination, limit, a2);
2148 
2149  *destination = PIXEventsBlockEndMarker;
2150  threadInfo->destination = destination;
2151  }
2152  }
2153 }
2154 
2155 template<class T1, class T2, class T3>
2156 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
2157 {
2158  UINT64 time = PIXEventsReplaceBlock(false);
2159  if (time)
2160  {
2161  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2162  UINT64* destination = threadInfo->destination;
2163  UINT64* limit = threadInfo->limit;
2164  if (destination < limit)
2165  {
2166  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2167  *destination++ = color;
2168 
2169  PIXCopyEventArgument(destination, limit, formatString);
2170  PIXCopyEventArgument(destination, limit, a1);
2171  PIXCopyEventArgument(destination, limit, a2);
2172  PIXCopyEventArgument(destination, limit, a3);
2173 
2174  *destination = PIXEventsBlockEndMarker;
2175  threadInfo->destination = destination;
2176  }
2177  }
2178 }
2179 
2180 template<class T1, class T2, class T3, class T4>
2181 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
2182 {
2183  UINT64 time = PIXEventsReplaceBlock(false);
2184  if (time)
2185  {
2186  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2187  UINT64* destination = threadInfo->destination;
2188  UINT64* limit = threadInfo->limit;
2189  if (destination < limit)
2190  {
2191  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2192  *destination++ = color;
2193 
2194  PIXCopyEventArgument(destination, limit, formatString);
2195  PIXCopyEventArgument(destination, limit, a1);
2196  PIXCopyEventArgument(destination, limit, a2);
2197  PIXCopyEventArgument(destination, limit, a3);
2198  PIXCopyEventArgument(destination, limit, a4);
2199 
2200  *destination = PIXEventsBlockEndMarker;
2201  threadInfo->destination = destination;
2202  }
2203  }
2204 }
2205 
2206 template<class T1, class T2, class T3, class T4, class T5>
2207 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
2208 {
2209  UINT64 time = PIXEventsReplaceBlock(false);
2210  if (time)
2211  {
2212  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2213  UINT64* destination = threadInfo->destination;
2214  UINT64* limit = threadInfo->limit;
2215  if (destination < limit)
2216  {
2217  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2218  *destination++ = color;
2219 
2220  PIXCopyEventArgument(destination, limit, formatString);
2221  PIXCopyEventArgument(destination, limit, a1);
2222  PIXCopyEventArgument(destination, limit, a2);
2223  PIXCopyEventArgument(destination, limit, a3);
2224  PIXCopyEventArgument(destination, limit, a4);
2225  PIXCopyEventArgument(destination, limit, a5);
2226 
2227  *destination = PIXEventsBlockEndMarker;
2228  threadInfo->destination = destination;
2229  }
2230  }
2231 }
2232 
2233 template<class T1, class T2, class T3, class T4, class T5, class T6>
2234 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
2235 {
2236  UINT64 time = PIXEventsReplaceBlock(false);
2237  if (time)
2238  {
2239  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2240  UINT64* destination = threadInfo->destination;
2241  UINT64* limit = threadInfo->limit;
2242  if (destination < limit)
2243  {
2244  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2245  *destination++ = color;
2246 
2247  PIXCopyEventArgument(destination, limit, formatString);
2248  PIXCopyEventArgument(destination, limit, a1);
2249  PIXCopyEventArgument(destination, limit, a2);
2250  PIXCopyEventArgument(destination, limit, a3);
2251  PIXCopyEventArgument(destination, limit, a4);
2252  PIXCopyEventArgument(destination, limit, a5);
2253  PIXCopyEventArgument(destination, limit, a6);
2254 
2255  *destination = PIXEventsBlockEndMarker;
2256  threadInfo->destination = destination;
2257  }
2258  }
2259 }
2260 
2261 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
2262 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
2263 {
2264  UINT64 time = PIXEventsReplaceBlock(false);
2265  if (time)
2266  {
2267  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2268  UINT64* destination = threadInfo->destination;
2269  UINT64* limit = threadInfo->limit;
2270  if (destination < limit)
2271  {
2272  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2273  *destination++ = color;
2274 
2275  PIXCopyEventArgument(destination, limit, formatString);
2276  PIXCopyEventArgument(destination, limit, a1);
2277  PIXCopyEventArgument(destination, limit, a2);
2278  PIXCopyEventArgument(destination, limit, a3);
2279  PIXCopyEventArgument(destination, limit, a4);
2280  PIXCopyEventArgument(destination, limit, a5);
2281  PIXCopyEventArgument(destination, limit, a6);
2282  PIXCopyEventArgument(destination, limit, a7);
2283 
2284  *destination = PIXEventsBlockEndMarker;
2285  threadInfo->destination = destination;
2286  }
2287  }
2288 }
2289 
2290 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
2291 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
2292 {
2293  UINT64 time = PIXEventsReplaceBlock(false);
2294  if (time)
2295  {
2296  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2297  UINT64* destination = threadInfo->destination;
2298  UINT64* limit = threadInfo->limit;
2299  if (destination < limit)
2300  {
2301  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2302  *destination++ = color;
2303 
2304  PIXCopyEventArgument(destination, limit, formatString);
2305  PIXCopyEventArgument(destination, limit, a1);
2306  PIXCopyEventArgument(destination, limit, a2);
2307  PIXCopyEventArgument(destination, limit, a3);
2308  PIXCopyEventArgument(destination, limit, a4);
2309  PIXCopyEventArgument(destination, limit, a5);
2310  PIXCopyEventArgument(destination, limit, a6);
2311  PIXCopyEventArgument(destination, limit, a7);
2312  PIXCopyEventArgument(destination, limit, a8);
2313 
2314  *destination = PIXEventsBlockEndMarker;
2315  threadInfo->destination = destination;
2316  }
2317  }
2318 }
2319 
2320 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
2321 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
2322 {
2323  UINT64 time = PIXEventsReplaceBlock(false);
2324  if (time)
2325  {
2326  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2327  UINT64* destination = threadInfo->destination;
2328  UINT64* limit = threadInfo->limit;
2329  if (destination < limit)
2330  {
2331  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2332  *destination++ = color;
2333 
2334  PIXCopyEventArgument(destination, limit, formatString);
2335  PIXCopyEventArgument(destination, limit, a1);
2336  PIXCopyEventArgument(destination, limit, a2);
2337  PIXCopyEventArgument(destination, limit, a3);
2338  PIXCopyEventArgument(destination, limit, a4);
2339  PIXCopyEventArgument(destination, limit, a5);
2340  PIXCopyEventArgument(destination, limit, a6);
2341  PIXCopyEventArgument(destination, limit, a7);
2342  PIXCopyEventArgument(destination, limit, a8);
2343  PIXCopyEventArgument(destination, limit, a9);
2344 
2345  *destination = PIXEventsBlockEndMarker;
2346  threadInfo->destination = destination;
2347  }
2348  }
2349 }
2350 
2351 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
2352 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
2353 {
2354  UINT64 time = PIXEventsReplaceBlock(false);
2355  if (time)
2356  {
2357  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2358  UINT64* destination = threadInfo->destination;
2359  UINT64* limit = threadInfo->limit;
2360  if (destination < limit)
2361  {
2362  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2363  *destination++ = color;
2364 
2365  PIXCopyEventArgument(destination, limit, formatString);
2366  PIXCopyEventArgument(destination, limit, a1);
2367  PIXCopyEventArgument(destination, limit, a2);
2368  PIXCopyEventArgument(destination, limit, a3);
2369  PIXCopyEventArgument(destination, limit, a4);
2370  PIXCopyEventArgument(destination, limit, a5);
2371  PIXCopyEventArgument(destination, limit, a6);
2372  PIXCopyEventArgument(destination, limit, a7);
2373  PIXCopyEventArgument(destination, limit, a8);
2374  PIXCopyEventArgument(destination, limit, a9);
2375  PIXCopyEventArgument(destination, limit, a10);
2376 
2377  *destination = PIXEventsBlockEndMarker;
2378  threadInfo->destination = destination;
2379  }
2380  }
2381 }
2382 
2383 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
2384 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
2385 {
2386  UINT64 time = PIXEventsReplaceBlock(false);
2387  if (time)
2388  {
2389  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2390  UINT64* destination = threadInfo->destination;
2391  UINT64* limit = threadInfo->limit;
2392  if (destination < limit)
2393  {
2394  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2395  *destination++ = color;
2396 
2397  PIXCopyEventArgument(destination, limit, formatString);
2398  PIXCopyEventArgument(destination, limit, a1);
2399  PIXCopyEventArgument(destination, limit, a2);
2400  PIXCopyEventArgument(destination, limit, a3);
2401  PIXCopyEventArgument(destination, limit, a4);
2402  PIXCopyEventArgument(destination, limit, a5);
2403  PIXCopyEventArgument(destination, limit, a6);
2404  PIXCopyEventArgument(destination, limit, a7);
2405  PIXCopyEventArgument(destination, limit, a8);
2406  PIXCopyEventArgument(destination, limit, a9);
2407  PIXCopyEventArgument(destination, limit, a10);
2408  PIXCopyEventArgument(destination, limit, a11);
2409 
2410  *destination = PIXEventsBlockEndMarker;
2411  threadInfo->destination = destination;
2412  }
2413  }
2414 }
2415 
2416 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
2417 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
2418 {
2419  UINT64 time = PIXEventsReplaceBlock(false);
2420  if (time)
2421  {
2422  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2423  UINT64* destination = threadInfo->destination;
2424  UINT64* limit = threadInfo->limit;
2425  if (destination < limit)
2426  {
2427  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2428  *destination++ = color;
2429 
2430  PIXCopyEventArgument(destination, limit, formatString);
2431  PIXCopyEventArgument(destination, limit, a1);
2432  PIXCopyEventArgument(destination, limit, a2);
2433  PIXCopyEventArgument(destination, limit, a3);
2434  PIXCopyEventArgument(destination, limit, a4);
2435  PIXCopyEventArgument(destination, limit, a5);
2436  PIXCopyEventArgument(destination, limit, a6);
2437  PIXCopyEventArgument(destination, limit, a7);
2438  PIXCopyEventArgument(destination, limit, a8);
2439  PIXCopyEventArgument(destination, limit, a9);
2440  PIXCopyEventArgument(destination, limit, a10);
2441  PIXCopyEventArgument(destination, limit, a11);
2442  PIXCopyEventArgument(destination, limit, a12);
2443 
2444  *destination = PIXEventsBlockEndMarker;
2445  threadInfo->destination = destination;
2446  }
2447  }
2448 }
2449 
2450 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
2451 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
2452 {
2453  UINT64 time = PIXEventsReplaceBlock(false);
2454  if (time)
2455  {
2456  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2457  UINT64* destination = threadInfo->destination;
2458  UINT64* limit = threadInfo->limit;
2459  if (destination < limit)
2460  {
2461  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2462  *destination++ = color;
2463 
2464  PIXCopyEventArgument(destination, limit, formatString);
2465  PIXCopyEventArgument(destination, limit, a1);
2466  PIXCopyEventArgument(destination, limit, a2);
2467  PIXCopyEventArgument(destination, limit, a3);
2468  PIXCopyEventArgument(destination, limit, a4);
2469  PIXCopyEventArgument(destination, limit, a5);
2470  PIXCopyEventArgument(destination, limit, a6);
2471  PIXCopyEventArgument(destination, limit, a7);
2472  PIXCopyEventArgument(destination, limit, a8);
2473  PIXCopyEventArgument(destination, limit, a9);
2474  PIXCopyEventArgument(destination, limit, a10);
2475  PIXCopyEventArgument(destination, limit, a11);
2476  PIXCopyEventArgument(destination, limit, a12);
2477  PIXCopyEventArgument(destination, limit, a13);
2478 
2479  *destination = PIXEventsBlockEndMarker;
2480  threadInfo->destination = destination;
2481  }
2482  }
2483 }
2484 
2485 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
2486 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
2487 {
2488  UINT64 time = PIXEventsReplaceBlock(false);
2489  if (time)
2490  {
2491  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2492  UINT64* destination = threadInfo->destination;
2493  UINT64* limit = threadInfo->limit;
2494  if (destination < limit)
2495  {
2496  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2497  *destination++ = color;
2498 
2499  PIXCopyEventArgument(destination, limit, formatString);
2500  PIXCopyEventArgument(destination, limit, a1);
2501  PIXCopyEventArgument(destination, limit, a2);
2502  PIXCopyEventArgument(destination, limit, a3);
2503  PIXCopyEventArgument(destination, limit, a4);
2504  PIXCopyEventArgument(destination, limit, a5);
2505  PIXCopyEventArgument(destination, limit, a6);
2506  PIXCopyEventArgument(destination, limit, a7);
2507  PIXCopyEventArgument(destination, limit, a8);
2508  PIXCopyEventArgument(destination, limit, a9);
2509  PIXCopyEventArgument(destination, limit, a10);
2510  PIXCopyEventArgument(destination, limit, a11);
2511  PIXCopyEventArgument(destination, limit, a12);
2512  PIXCopyEventArgument(destination, limit, a13);
2513  PIXCopyEventArgument(destination, limit, a14);
2514 
2515  *destination = PIXEventsBlockEndMarker;
2516  threadInfo->destination = destination;
2517  }
2518  }
2519 }
2520 
2521 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
2522 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
2523 {
2524  UINT64 time = PIXEventsReplaceBlock(false);
2525  if (time)
2526  {
2527  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2528  UINT64* destination = threadInfo->destination;
2529  UINT64* limit = threadInfo->limit;
2530  if (destination < limit)
2531  {
2532  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2533  *destination++ = color;
2534 
2535  PIXCopyEventArgument(destination, limit, formatString);
2536  PIXCopyEventArgument(destination, limit, a1);
2537  PIXCopyEventArgument(destination, limit, a2);
2538  PIXCopyEventArgument(destination, limit, a3);
2539  PIXCopyEventArgument(destination, limit, a4);
2540  PIXCopyEventArgument(destination, limit, a5);
2541  PIXCopyEventArgument(destination, limit, a6);
2542  PIXCopyEventArgument(destination, limit, a7);
2543  PIXCopyEventArgument(destination, limit, a8);
2544  PIXCopyEventArgument(destination, limit, a9);
2545  PIXCopyEventArgument(destination, limit, a10);
2546  PIXCopyEventArgument(destination, limit, a11);
2547  PIXCopyEventArgument(destination, limit, a12);
2548  PIXCopyEventArgument(destination, limit, a13);
2549  PIXCopyEventArgument(destination, limit, a14);
2550  PIXCopyEventArgument(destination, limit, a15);
2551 
2552  *destination = PIXEventsBlockEndMarker;
2553  threadInfo->destination = destination;
2554  }
2555  }
2556 }
2557 
2558 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
2559 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
2560 {
2561  UINT64 time = PIXEventsReplaceBlock(false);
2562  if (time)
2563  {
2564  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2565  UINT64* destination = threadInfo->destination;
2566  UINT64* limit = threadInfo->limit;
2567  if (destination < limit)
2568  {
2569  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2570  *destination++ = color;
2571 
2572  PIXCopyEventArgument(destination, limit, formatString);
2573  PIXCopyEventArgument(destination, limit, a1);
2574  PIXCopyEventArgument(destination, limit, a2);
2575  PIXCopyEventArgument(destination, limit, a3);
2576  PIXCopyEventArgument(destination, limit, a4);
2577  PIXCopyEventArgument(destination, limit, a5);
2578  PIXCopyEventArgument(destination, limit, a6);
2579  PIXCopyEventArgument(destination, limit, a7);
2580  PIXCopyEventArgument(destination, limit, a8);
2581  PIXCopyEventArgument(destination, limit, a9);
2582  PIXCopyEventArgument(destination, limit, a10);
2583  PIXCopyEventArgument(destination, limit, a11);
2584  PIXCopyEventArgument(destination, limit, a12);
2585  PIXCopyEventArgument(destination, limit, a13);
2586  PIXCopyEventArgument(destination, limit, a14);
2587  PIXCopyEventArgument(destination, limit, a15);
2588  PIXCopyEventArgument(destination, limit, a16);
2589 
2590  *destination = PIXEventsBlockEndMarker;
2591  threadInfo->destination = destination;
2592  }
2593  }
2594 }
2595 
2596 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString)
2597 {
2598  UINT64 time = PIXEventsReplaceBlock(false);
2599  if (time)
2600  {
2601  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2602  UINT64* destination = threadInfo->destination;
2603  UINT64* limit = threadInfo->limit;
2604  if (destination < limit)
2605  {
2606  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_NoArgs);
2607  *destination++ = color;
2608 
2609  PIXCopyEventArgument(destination, limit, formatString);
2610 
2611  *destination = PIXEventsBlockEndMarker;
2612  threadInfo->destination = destination;
2613  }
2614  }
2615 }
2616 
2617 template<class T1>
2618 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1)
2619 {
2620  UINT64 time = PIXEventsReplaceBlock(false);
2621  if (time)
2622  {
2623  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2624  UINT64* destination = threadInfo->destination;
2625  UINT64* limit = threadInfo->limit;
2626  if (destination < limit)
2627  {
2628  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2629  *destination++ = color;
2630 
2631  PIXCopyEventArgument(destination, limit, formatString);
2632  PIXCopyEventArgument(destination, limit, a1);
2633 
2634  *destination = PIXEventsBlockEndMarker;
2635  threadInfo->destination = destination;
2636  }
2637  }
2638 }
2639 
2640 template<class T1, class T2>
2641 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
2642 {
2643  UINT64 time = PIXEventsReplaceBlock(false);
2644  if (time)
2645  {
2646  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2647  UINT64* destination = threadInfo->destination;
2648  UINT64* limit = threadInfo->limit;
2649  if (destination < limit)
2650  {
2651  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2652  *destination++ = color;
2653 
2654  PIXCopyEventArgument(destination, limit, formatString);
2655  PIXCopyEventArgument(destination, limit, a1);
2656  PIXCopyEventArgument(destination, limit, a2);
2657 
2658  *destination = PIXEventsBlockEndMarker;
2659  threadInfo->destination = destination;
2660  }
2661  }
2662 }
2663 
2664 template<class T1, class T2, class T3>
2665 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
2666 {
2667  UINT64 time = PIXEventsReplaceBlock(false);
2668  if (time)
2669  {
2670  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2671  UINT64* destination = threadInfo->destination;
2672  UINT64* limit = threadInfo->limit;
2673  if (destination < limit)
2674  {
2675  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2676  *destination++ = color;
2677 
2678  PIXCopyEventArgument(destination, limit, formatString);
2679  PIXCopyEventArgument(destination, limit, a1);
2680  PIXCopyEventArgument(destination, limit, a2);
2681  PIXCopyEventArgument(destination, limit, a3);
2682 
2683  *destination = PIXEventsBlockEndMarker;
2684  threadInfo->destination = destination;
2685  }
2686  }
2687 }
2688 
2689 template<class T1, class T2, class T3, class T4>
2690 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
2691 {
2692  UINT64 time = PIXEventsReplaceBlock(false);
2693  if (time)
2694  {
2695  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2696  UINT64* destination = threadInfo->destination;
2697  UINT64* limit = threadInfo->limit;
2698  if (destination < limit)
2699  {
2700  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2701  *destination++ = color;
2702 
2703  PIXCopyEventArgument(destination, limit, formatString);
2704  PIXCopyEventArgument(destination, limit, a1);
2705  PIXCopyEventArgument(destination, limit, a2);
2706  PIXCopyEventArgument(destination, limit, a3);
2707  PIXCopyEventArgument(destination, limit, a4);
2708 
2709  *destination = PIXEventsBlockEndMarker;
2710  threadInfo->destination = destination;
2711  }
2712  }
2713 }
2714 
2715 template<class T1, class T2, class T3, class T4, class T5>
2716 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
2717 {
2718  UINT64 time = PIXEventsReplaceBlock(false);
2719  if (time)
2720  {
2721  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2722  UINT64* destination = threadInfo->destination;
2723  UINT64* limit = threadInfo->limit;
2724  if (destination < limit)
2725  {
2726  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2727  *destination++ = color;
2728 
2729  PIXCopyEventArgument(destination, limit, formatString);
2730  PIXCopyEventArgument(destination, limit, a1);
2731  PIXCopyEventArgument(destination, limit, a2);
2732  PIXCopyEventArgument(destination, limit, a3);
2733  PIXCopyEventArgument(destination, limit, a4);
2734  PIXCopyEventArgument(destination, limit, a5);
2735 
2736  *destination = PIXEventsBlockEndMarker;
2737  threadInfo->destination = destination;
2738  }
2739  }
2740 }
2741 
2742 template<class T1, class T2, class T3, class T4, class T5, class T6>
2743 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
2744 {
2745  UINT64 time = PIXEventsReplaceBlock(false);
2746  if (time)
2747  {
2748  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2749  UINT64* destination = threadInfo->destination;
2750  UINT64* limit = threadInfo->limit;
2751  if (destination < limit)
2752  {
2753  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2754  *destination++ = color;
2755 
2756  PIXCopyEventArgument(destination, limit, formatString);
2757  PIXCopyEventArgument(destination, limit, a1);
2758  PIXCopyEventArgument(destination, limit, a2);
2759  PIXCopyEventArgument(destination, limit, a3);
2760  PIXCopyEventArgument(destination, limit, a4);
2761  PIXCopyEventArgument(destination, limit, a5);
2762  PIXCopyEventArgument(destination, limit, a6);
2763 
2764  *destination = PIXEventsBlockEndMarker;
2765  threadInfo->destination = destination;
2766  }
2767  }
2768 }
2769 
2770 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
2771 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
2772 {
2773  UINT64 time = PIXEventsReplaceBlock(false);
2774  if (time)
2775  {
2776  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2777  UINT64* destination = threadInfo->destination;
2778  UINT64* limit = threadInfo->limit;
2779  if (destination < limit)
2780  {
2781  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2782  *destination++ = color;
2783 
2784  PIXCopyEventArgument(destination, limit, formatString);
2785  PIXCopyEventArgument(destination, limit, a1);
2786  PIXCopyEventArgument(destination, limit, a2);
2787  PIXCopyEventArgument(destination, limit, a3);
2788  PIXCopyEventArgument(destination, limit, a4);
2789  PIXCopyEventArgument(destination, limit, a5);
2790  PIXCopyEventArgument(destination, limit, a6);
2791  PIXCopyEventArgument(destination, limit, a7);
2792 
2793  *destination = PIXEventsBlockEndMarker;
2794  threadInfo->destination = destination;
2795  }
2796  }
2797 }
2798 
2799 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
2800 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
2801 {
2802  UINT64 time = PIXEventsReplaceBlock(false);
2803  if (time)
2804  {
2805  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2806  UINT64* destination = threadInfo->destination;
2807  UINT64* limit = threadInfo->limit;
2808  if (destination < limit)
2809  {
2810  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2811  *destination++ = color;
2812 
2813  PIXCopyEventArgument(destination, limit, formatString);
2814  PIXCopyEventArgument(destination, limit, a1);
2815  PIXCopyEventArgument(destination, limit, a2);
2816  PIXCopyEventArgument(destination, limit, a3);
2817  PIXCopyEventArgument(destination, limit, a4);
2818  PIXCopyEventArgument(destination, limit, a5);
2819  PIXCopyEventArgument(destination, limit, a6);
2820  PIXCopyEventArgument(destination, limit, a7);
2821  PIXCopyEventArgument(destination, limit, a8);
2822 
2823  *destination = PIXEventsBlockEndMarker;
2824  threadInfo->destination = destination;
2825  }
2826  }
2827 }
2828 
2829 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
2830 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
2831 {
2832  UINT64 time = PIXEventsReplaceBlock(false);
2833  if (time)
2834  {
2835  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2836  UINT64* destination = threadInfo->destination;
2837  UINT64* limit = threadInfo->limit;
2838  if (destination < limit)
2839  {
2840  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2841  *destination++ = color;
2842 
2843  PIXCopyEventArgument(destination, limit, formatString);
2844  PIXCopyEventArgument(destination, limit, a1);
2845  PIXCopyEventArgument(destination, limit, a2);
2846  PIXCopyEventArgument(destination, limit, a3);
2847  PIXCopyEventArgument(destination, limit, a4);
2848  PIXCopyEventArgument(destination, limit, a5);
2849  PIXCopyEventArgument(destination, limit, a6);
2850  PIXCopyEventArgument(destination, limit, a7);
2851  PIXCopyEventArgument(destination, limit, a8);
2852  PIXCopyEventArgument(destination, limit, a9);
2853 
2854  *destination = PIXEventsBlockEndMarker;
2855  threadInfo->destination = destination;
2856  }
2857  }
2858 }
2859 
2860 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
2861 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
2862 {
2863  UINT64 time = PIXEventsReplaceBlock(false);
2864  if (time)
2865  {
2866  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2867  UINT64* destination = threadInfo->destination;
2868  UINT64* limit = threadInfo->limit;
2869  if (destination < limit)
2870  {
2871  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2872  *destination++ = color;
2873 
2874  PIXCopyEventArgument(destination, limit, formatString);
2875  PIXCopyEventArgument(destination, limit, a1);
2876  PIXCopyEventArgument(destination, limit, a2);
2877  PIXCopyEventArgument(destination, limit, a3);
2878  PIXCopyEventArgument(destination, limit, a4);
2879  PIXCopyEventArgument(destination, limit, a5);
2880  PIXCopyEventArgument(destination, limit, a6);
2881  PIXCopyEventArgument(destination, limit, a7);
2882  PIXCopyEventArgument(destination, limit, a8);
2883  PIXCopyEventArgument(destination, limit, a9);
2884  PIXCopyEventArgument(destination, limit, a10);
2885 
2886  *destination = PIXEventsBlockEndMarker;
2887  threadInfo->destination = destination;
2888  }
2889  }
2890 }
2891 
2892 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
2893 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
2894 {
2895  UINT64 time = PIXEventsReplaceBlock(false);
2896  if (time)
2897  {
2898  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2899  UINT64* destination = threadInfo->destination;
2900  UINT64* limit = threadInfo->limit;
2901  if (destination < limit)
2902  {
2903  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2904  *destination++ = color;
2905 
2906  PIXCopyEventArgument(destination, limit, formatString);
2907  PIXCopyEventArgument(destination, limit, a1);
2908  PIXCopyEventArgument(destination, limit, a2);
2909  PIXCopyEventArgument(destination, limit, a3);
2910  PIXCopyEventArgument(destination, limit, a4);
2911  PIXCopyEventArgument(destination, limit, a5);
2912  PIXCopyEventArgument(destination, limit, a6);
2913  PIXCopyEventArgument(destination, limit, a7);
2914  PIXCopyEventArgument(destination, limit, a8);
2915  PIXCopyEventArgument(destination, limit, a9);
2916  PIXCopyEventArgument(destination, limit, a10);
2917  PIXCopyEventArgument(destination, limit, a11);
2918 
2919  *destination = PIXEventsBlockEndMarker;
2920  threadInfo->destination = destination;
2921  }
2922  }
2923 }
2924 
2925 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
2926 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
2927 {
2928  UINT64 time = PIXEventsReplaceBlock(false);
2929  if (time)
2930  {
2931  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2932  UINT64* destination = threadInfo->destination;
2933  UINT64* limit = threadInfo->limit;
2934  if (destination < limit)
2935  {
2936  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2937  *destination++ = color;
2938 
2939  PIXCopyEventArgument(destination, limit, formatString);
2940  PIXCopyEventArgument(destination, limit, a1);
2941  PIXCopyEventArgument(destination, limit, a2);
2942  PIXCopyEventArgument(destination, limit, a3);
2943  PIXCopyEventArgument(destination, limit, a4);
2944  PIXCopyEventArgument(destination, limit, a5);
2945  PIXCopyEventArgument(destination, limit, a6);
2946  PIXCopyEventArgument(destination, limit, a7);
2947  PIXCopyEventArgument(destination, limit, a8);
2948  PIXCopyEventArgument(destination, limit, a9);
2949  PIXCopyEventArgument(destination, limit, a10);
2950  PIXCopyEventArgument(destination, limit, a11);
2951  PIXCopyEventArgument(destination, limit, a12);
2952 
2953  *destination = PIXEventsBlockEndMarker;
2954  threadInfo->destination = destination;
2955  }
2956  }
2957 }
2958 
2959 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
2960 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
2961 {
2962  UINT64 time = PIXEventsReplaceBlock(false);
2963  if (time)
2964  {
2965  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
2966  UINT64* destination = threadInfo->destination;
2967  UINT64* limit = threadInfo->limit;
2968  if (destination < limit)
2969  {
2970  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
2971  *destination++ = color;
2972 
2973  PIXCopyEventArgument(destination, limit, formatString);
2974  PIXCopyEventArgument(destination, limit, a1);
2975  PIXCopyEventArgument(destination, limit, a2);
2976  PIXCopyEventArgument(destination, limit, a3);
2977  PIXCopyEventArgument(destination, limit, a4);
2978  PIXCopyEventArgument(destination, limit, a5);
2979  PIXCopyEventArgument(destination, limit, a6);
2980  PIXCopyEventArgument(destination, limit, a7);
2981  PIXCopyEventArgument(destination, limit, a8);
2982  PIXCopyEventArgument(destination, limit, a9);
2983  PIXCopyEventArgument(destination, limit, a10);
2984  PIXCopyEventArgument(destination, limit, a11);
2985  PIXCopyEventArgument(destination, limit, a12);
2986  PIXCopyEventArgument(destination, limit, a13);
2987 
2988  *destination = PIXEventsBlockEndMarker;
2989  threadInfo->destination = destination;
2990  }
2991  }
2992 }
2993 
2994 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
2995 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
2996 {
2997  UINT64 time = PIXEventsReplaceBlock(false);
2998  if (time)
2999  {
3000  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3001  UINT64* destination = threadInfo->destination;
3002  UINT64* limit = threadInfo->limit;
3003  if (destination < limit)
3004  {
3005  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3006  *destination++ = color;
3007 
3008  PIXCopyEventArgument(destination, limit, formatString);
3009  PIXCopyEventArgument(destination, limit, a1);
3010  PIXCopyEventArgument(destination, limit, a2);
3011  PIXCopyEventArgument(destination, limit, a3);
3012  PIXCopyEventArgument(destination, limit, a4);
3013  PIXCopyEventArgument(destination, limit, a5);
3014  PIXCopyEventArgument(destination, limit, a6);
3015  PIXCopyEventArgument(destination, limit, a7);
3016  PIXCopyEventArgument(destination, limit, a8);
3017  PIXCopyEventArgument(destination, limit, a9);
3018  PIXCopyEventArgument(destination, limit, a10);
3019  PIXCopyEventArgument(destination, limit, a11);
3020  PIXCopyEventArgument(destination, limit, a12);
3021  PIXCopyEventArgument(destination, limit, a13);
3022  PIXCopyEventArgument(destination, limit, a14);
3023 
3024  *destination = PIXEventsBlockEndMarker;
3025  threadInfo->destination = destination;
3026  }
3027  }
3028 }
3029 
3030 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
3031 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
3032 {
3033  UINT64 time = PIXEventsReplaceBlock(false);
3034  if (time)
3035  {
3036  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3037  UINT64* destination = threadInfo->destination;
3038  UINT64* limit = threadInfo->limit;
3039  if (destination < limit)
3040  {
3041  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3042  *destination++ = color;
3043 
3044  PIXCopyEventArgument(destination, limit, formatString);
3045  PIXCopyEventArgument(destination, limit, a1);
3046  PIXCopyEventArgument(destination, limit, a2);
3047  PIXCopyEventArgument(destination, limit, a3);
3048  PIXCopyEventArgument(destination, limit, a4);
3049  PIXCopyEventArgument(destination, limit, a5);
3050  PIXCopyEventArgument(destination, limit, a6);
3051  PIXCopyEventArgument(destination, limit, a7);
3052  PIXCopyEventArgument(destination, limit, a8);
3053  PIXCopyEventArgument(destination, limit, a9);
3054  PIXCopyEventArgument(destination, limit, a10);
3055  PIXCopyEventArgument(destination, limit, a11);
3056  PIXCopyEventArgument(destination, limit, a12);
3057  PIXCopyEventArgument(destination, limit, a13);
3058  PIXCopyEventArgument(destination, limit, a14);
3059  PIXCopyEventArgument(destination, limit, a15);
3060 
3061  *destination = PIXEventsBlockEndMarker;
3062  threadInfo->destination = destination;
3063  }
3064  }
3065 }
3066 
3067 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
3068 __declspec(noinline) inline void PIXSetMarkerAllocate(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
3069 {
3070  UINT64 time = PIXEventsReplaceBlock(false);
3071  if (time)
3072  {
3073  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3074  UINT64* destination = threadInfo->destination;
3075  UINT64* limit = threadInfo->limit;
3076  if (destination < limit)
3077  {
3078  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3079  *destination++ = color;
3080 
3081  PIXCopyEventArgument(destination, limit, formatString);
3082  PIXCopyEventArgument(destination, limit, a1);
3083  PIXCopyEventArgument(destination, limit, a2);
3084  PIXCopyEventArgument(destination, limit, a3);
3085  PIXCopyEventArgument(destination, limit, a4);
3086  PIXCopyEventArgument(destination, limit, a5);
3087  PIXCopyEventArgument(destination, limit, a6);
3088  PIXCopyEventArgument(destination, limit, a7);
3089  PIXCopyEventArgument(destination, limit, a8);
3090  PIXCopyEventArgument(destination, limit, a9);
3091  PIXCopyEventArgument(destination, limit, a10);
3092  PIXCopyEventArgument(destination, limit, a11);
3093  PIXCopyEventArgument(destination, limit, a12);
3094  PIXCopyEventArgument(destination, limit, a13);
3095  PIXCopyEventArgument(destination, limit, a14);
3096  PIXCopyEventArgument(destination, limit, a15);
3097  PIXCopyEventArgument(destination, limit, a16);
3098 
3099  *destination = PIXEventsBlockEndMarker;
3100  threadInfo->destination = destination;
3101  }
3102  }
3103 }
3104 
3105 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString)
3106 {
3107  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3108  UINT64* destination = threadInfo->destination;
3109  UINT64* limit = threadInfo->biasedLimit;
3110  if (destination < limit)
3111  {
3112  limit += PIXEventsSafeFastCopySpaceQwords;
3113  UINT64 time = PIXGetTimestampCounter();
3114  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_NoArgs);
3115  *destination++ = color;
3116 
3117  PIXCopyEventArgument(destination, limit, formatString);
3118 
3119  *destination = PIXEventsBlockEndMarker;
3120  threadInfo->destination = destination;
3121  }
3122  else if (limit != nullptr)
3123  {
3124  PIXSetMarkerAllocate(color, formatString);
3125  }
3126 }
3127 
3128 template<class T1>
3129 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1)
3130 {
3131  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3132  UINT64* destination = threadInfo->destination;
3133  UINT64* limit = threadInfo->biasedLimit;
3134  if (destination < limit)
3135  {
3136  limit += PIXEventsSafeFastCopySpaceQwords;
3137  UINT64 time = PIXGetTimestampCounter();
3138  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3139  *destination++ = color;
3140 
3141  PIXCopyEventArgument(destination, limit, formatString);
3142  PIXCopyEventArgument(destination, limit, a1);
3143 
3144  *destination = PIXEventsBlockEndMarker;
3145  threadInfo->destination = destination;
3146  }
3147  else if (limit != nullptr)
3148  {
3149  PIXSetMarkerAllocate(color, formatString, a1);
3150  }
3151 }
3152 
3153 template<class T1, class T2>
3154 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
3155 {
3156  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3157  UINT64* destination = threadInfo->destination;
3158  UINT64* limit = threadInfo->biasedLimit;
3159  if (destination < limit)
3160  {
3161  limit += PIXEventsSafeFastCopySpaceQwords;
3162  UINT64 time = PIXGetTimestampCounter();
3163  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3164  *destination++ = color;
3165 
3166  PIXCopyEventArgument(destination, limit, formatString);
3167  PIXCopyEventArgument(destination, limit, a1);
3168  PIXCopyEventArgument(destination, limit, a2);
3169 
3170  *destination = PIXEventsBlockEndMarker;
3171  threadInfo->destination = destination;
3172  }
3173  else if (limit != nullptr)
3174  {
3175  PIXSetMarkerAllocate(color, formatString, a1, a2);
3176  }
3177 }
3178 
3179 template<class T1, class T2, class T3>
3180 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
3181 {
3182  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3183  UINT64* destination = threadInfo->destination;
3184  UINT64* limit = threadInfo->biasedLimit;
3185  if (destination < limit)
3186  {
3187  limit += PIXEventsSafeFastCopySpaceQwords;
3188  UINT64 time = PIXGetTimestampCounter();
3189  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3190  *destination++ = color;
3191 
3192  PIXCopyEventArgument(destination, limit, formatString);
3193  PIXCopyEventArgument(destination, limit, a1);
3194  PIXCopyEventArgument(destination, limit, a2);
3195  PIXCopyEventArgument(destination, limit, a3);
3196 
3197  *destination = PIXEventsBlockEndMarker;
3198  threadInfo->destination = destination;
3199  }
3200  else if (limit != nullptr)
3201  {
3202  PIXSetMarkerAllocate(color, formatString, a1, a2, a3);
3203  }
3204 }
3205 
3206 template<class T1, class T2, class T3, class T4>
3207 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
3208 {
3209  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3210  UINT64* destination = threadInfo->destination;
3211  UINT64* limit = threadInfo->biasedLimit;
3212  if (destination < limit)
3213  {
3214  limit += PIXEventsSafeFastCopySpaceQwords;
3215  UINT64 time = PIXGetTimestampCounter();
3216  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3217  *destination++ = color;
3218 
3219  PIXCopyEventArgument(destination, limit, formatString);
3220  PIXCopyEventArgument(destination, limit, a1);
3221  PIXCopyEventArgument(destination, limit, a2);
3222  PIXCopyEventArgument(destination, limit, a3);
3223  PIXCopyEventArgument(destination, limit, a4);
3224 
3225  *destination = PIXEventsBlockEndMarker;
3226  threadInfo->destination = destination;
3227  }
3228  else if (limit != nullptr)
3229  {
3230  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4);
3231  }
3232 }
3233 
3234 template<class T1, class T2, class T3, class T4, class T5>
3235 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
3236 {
3237  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3238  UINT64* destination = threadInfo->destination;
3239  UINT64* limit = threadInfo->biasedLimit;
3240  if (destination < limit)
3241  {
3242  limit += PIXEventsSafeFastCopySpaceQwords;
3243  UINT64 time = PIXGetTimestampCounter();
3244  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3245  *destination++ = color;
3246 
3247  PIXCopyEventArgument(destination, limit, formatString);
3248  PIXCopyEventArgument(destination, limit, a1);
3249  PIXCopyEventArgument(destination, limit, a2);
3250  PIXCopyEventArgument(destination, limit, a3);
3251  PIXCopyEventArgument(destination, limit, a4);
3252  PIXCopyEventArgument(destination, limit, a5);
3253 
3254  *destination = PIXEventsBlockEndMarker;
3255  threadInfo->destination = destination;
3256  }
3257  else if (limit != nullptr)
3258  {
3259  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5);
3260  }
3261 }
3262 
3263 template<class T1, class T2, class T3, class T4, class T5, class T6>
3264 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
3265 {
3266  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3267  UINT64* destination = threadInfo->destination;
3268  UINT64* limit = threadInfo->biasedLimit;
3269  if (destination < limit)
3270  {
3271  limit += PIXEventsSafeFastCopySpaceQwords;
3272  UINT64 time = PIXGetTimestampCounter();
3273  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3274  *destination++ = color;
3275 
3276  PIXCopyEventArgument(destination, limit, formatString);
3277  PIXCopyEventArgument(destination, limit, a1);
3278  PIXCopyEventArgument(destination, limit, a2);
3279  PIXCopyEventArgument(destination, limit, a3);
3280  PIXCopyEventArgument(destination, limit, a4);
3281  PIXCopyEventArgument(destination, limit, a5);
3282  PIXCopyEventArgument(destination, limit, a6);
3283 
3284  *destination = PIXEventsBlockEndMarker;
3285  threadInfo->destination = destination;
3286  }
3287  else if (limit != nullptr)
3288  {
3289  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6);
3290  }
3291 }
3292 
3293 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
3294 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
3295 {
3296  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3297  UINT64* destination = threadInfo->destination;
3298  UINT64* limit = threadInfo->biasedLimit;
3299  if (destination < limit)
3300  {
3301  limit += PIXEventsSafeFastCopySpaceQwords;
3302  UINT64 time = PIXGetTimestampCounter();
3303  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3304  *destination++ = color;
3305 
3306  PIXCopyEventArgument(destination, limit, formatString);
3307  PIXCopyEventArgument(destination, limit, a1);
3308  PIXCopyEventArgument(destination, limit, a2);
3309  PIXCopyEventArgument(destination, limit, a3);
3310  PIXCopyEventArgument(destination, limit, a4);
3311  PIXCopyEventArgument(destination, limit, a5);
3312  PIXCopyEventArgument(destination, limit, a6);
3313  PIXCopyEventArgument(destination, limit, a7);
3314 
3315  *destination = PIXEventsBlockEndMarker;
3316  threadInfo->destination = destination;
3317  }
3318  else if (limit != nullptr)
3319  {
3320  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7);
3321  }
3322 }
3323 
3324 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
3325 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
3326 {
3327  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3328  UINT64* destination = threadInfo->destination;
3329  UINT64* limit = threadInfo->biasedLimit;
3330  if (destination < limit)
3331  {
3332  limit += PIXEventsSafeFastCopySpaceQwords;
3333  UINT64 time = PIXGetTimestampCounter();
3334  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3335  *destination++ = color;
3336 
3337  PIXCopyEventArgument(destination, limit, formatString);
3338  PIXCopyEventArgument(destination, limit, a1);
3339  PIXCopyEventArgument(destination, limit, a2);
3340  PIXCopyEventArgument(destination, limit, a3);
3341  PIXCopyEventArgument(destination, limit, a4);
3342  PIXCopyEventArgument(destination, limit, a5);
3343  PIXCopyEventArgument(destination, limit, a6);
3344  PIXCopyEventArgument(destination, limit, a7);
3345  PIXCopyEventArgument(destination, limit, a8);
3346 
3347  *destination = PIXEventsBlockEndMarker;
3348  threadInfo->destination = destination;
3349  }
3350  else if (limit != nullptr)
3351  {
3352  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
3353  }
3354 }
3355 
3356 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
3357 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
3358 {
3359  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3360  UINT64* destination = threadInfo->destination;
3361  UINT64* limit = threadInfo->biasedLimit;
3362  if (destination < limit)
3363  {
3364  limit += PIXEventsSafeFastCopySpaceQwords;
3365  UINT64 time = PIXGetTimestampCounter();
3366  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3367  *destination++ = color;
3368 
3369  PIXCopyEventArgument(destination, limit, formatString);
3370  PIXCopyEventArgument(destination, limit, a1);
3371  PIXCopyEventArgument(destination, limit, a2);
3372  PIXCopyEventArgument(destination, limit, a3);
3373  PIXCopyEventArgument(destination, limit, a4);
3374  PIXCopyEventArgument(destination, limit, a5);
3375  PIXCopyEventArgument(destination, limit, a6);
3376  PIXCopyEventArgument(destination, limit, a7);
3377  PIXCopyEventArgument(destination, limit, a8);
3378  PIXCopyEventArgument(destination, limit, a9);
3379 
3380  *destination = PIXEventsBlockEndMarker;
3381  threadInfo->destination = destination;
3382  }
3383  else if (limit != nullptr)
3384  {
3385  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
3386  }
3387 }
3388 
3389 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
3390 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
3391 {
3392  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3393  UINT64* destination = threadInfo->destination;
3394  UINT64* limit = threadInfo->biasedLimit;
3395  if (destination < limit)
3396  {
3397  limit += PIXEventsSafeFastCopySpaceQwords;
3398  UINT64 time = PIXGetTimestampCounter();
3399  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3400  *destination++ = color;
3401 
3402  PIXCopyEventArgument(destination, limit, formatString);
3403  PIXCopyEventArgument(destination, limit, a1);
3404  PIXCopyEventArgument(destination, limit, a2);
3405  PIXCopyEventArgument(destination, limit, a3);
3406  PIXCopyEventArgument(destination, limit, a4);
3407  PIXCopyEventArgument(destination, limit, a5);
3408  PIXCopyEventArgument(destination, limit, a6);
3409  PIXCopyEventArgument(destination, limit, a7);
3410  PIXCopyEventArgument(destination, limit, a8);
3411  PIXCopyEventArgument(destination, limit, a9);
3412  PIXCopyEventArgument(destination, limit, a10);
3413 
3414  *destination = PIXEventsBlockEndMarker;
3415  threadInfo->destination = destination;
3416  }
3417  else if (limit != nullptr)
3418  {
3419  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
3420  }
3421 }
3422 
3423 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
3424 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
3425 {
3426  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3427  UINT64* destination = threadInfo->destination;
3428  UINT64* limit = threadInfo->biasedLimit;
3429  if (destination < limit)
3430  {
3431  limit += PIXEventsSafeFastCopySpaceQwords;
3432  UINT64 time = PIXGetTimestampCounter();
3433  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3434  *destination++ = color;
3435 
3436  PIXCopyEventArgument(destination, limit, formatString);
3437  PIXCopyEventArgument(destination, limit, a1);
3438  PIXCopyEventArgument(destination, limit, a2);
3439  PIXCopyEventArgument(destination, limit, a3);
3440  PIXCopyEventArgument(destination, limit, a4);
3441  PIXCopyEventArgument(destination, limit, a5);
3442  PIXCopyEventArgument(destination, limit, a6);
3443  PIXCopyEventArgument(destination, limit, a7);
3444  PIXCopyEventArgument(destination, limit, a8);
3445  PIXCopyEventArgument(destination, limit, a9);
3446  PIXCopyEventArgument(destination, limit, a10);
3447  PIXCopyEventArgument(destination, limit, a11);
3448 
3449  *destination = PIXEventsBlockEndMarker;
3450  threadInfo->destination = destination;
3451  }
3452  else if (limit != nullptr)
3453  {
3454  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
3455  }
3456 }
3457 
3458 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
3459 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
3460 {
3461  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3462  UINT64* destination = threadInfo->destination;
3463  UINT64* limit = threadInfo->biasedLimit;
3464  if (destination < limit)
3465  {
3466  limit += PIXEventsSafeFastCopySpaceQwords;
3467  UINT64 time = PIXGetTimestampCounter();
3468  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3469  *destination++ = color;
3470 
3471  PIXCopyEventArgument(destination, limit, formatString);
3472  PIXCopyEventArgument(destination, limit, a1);
3473  PIXCopyEventArgument(destination, limit, a2);
3474  PIXCopyEventArgument(destination, limit, a3);
3475  PIXCopyEventArgument(destination, limit, a4);
3476  PIXCopyEventArgument(destination, limit, a5);
3477  PIXCopyEventArgument(destination, limit, a6);
3478  PIXCopyEventArgument(destination, limit, a7);
3479  PIXCopyEventArgument(destination, limit, a8);
3480  PIXCopyEventArgument(destination, limit, a9);
3481  PIXCopyEventArgument(destination, limit, a10);
3482  PIXCopyEventArgument(destination, limit, a11);
3483  PIXCopyEventArgument(destination, limit, a12);
3484 
3485  *destination = PIXEventsBlockEndMarker;
3486  threadInfo->destination = destination;
3487  }
3488  else if (limit != nullptr)
3489  {
3490  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
3491  }
3492 }
3493 
3494 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
3495 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
3496 {
3497  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3498  UINT64* destination = threadInfo->destination;
3499  UINT64* limit = threadInfo->biasedLimit;
3500  if (destination < limit)
3501  {
3502  limit += PIXEventsSafeFastCopySpaceQwords;
3503  UINT64 time = PIXGetTimestampCounter();
3504  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3505  *destination++ = color;
3506 
3507  PIXCopyEventArgument(destination, limit, formatString);
3508  PIXCopyEventArgument(destination, limit, a1);
3509  PIXCopyEventArgument(destination, limit, a2);
3510  PIXCopyEventArgument(destination, limit, a3);
3511  PIXCopyEventArgument(destination, limit, a4);
3512  PIXCopyEventArgument(destination, limit, a5);
3513  PIXCopyEventArgument(destination, limit, a6);
3514  PIXCopyEventArgument(destination, limit, a7);
3515  PIXCopyEventArgument(destination, limit, a8);
3516  PIXCopyEventArgument(destination, limit, a9);
3517  PIXCopyEventArgument(destination, limit, a10);
3518  PIXCopyEventArgument(destination, limit, a11);
3519  PIXCopyEventArgument(destination, limit, a12);
3520  PIXCopyEventArgument(destination, limit, a13);
3521 
3522  *destination = PIXEventsBlockEndMarker;
3523  threadInfo->destination = destination;
3524  }
3525  else if (limit != nullptr)
3526  {
3527  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
3528  }
3529 }
3530 
3531 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
3532 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
3533 {
3534  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3535  UINT64* destination = threadInfo->destination;
3536  UINT64* limit = threadInfo->biasedLimit;
3537  if (destination < limit)
3538  {
3539  limit += PIXEventsSafeFastCopySpaceQwords;
3540  UINT64 time = PIXGetTimestampCounter();
3541  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3542  *destination++ = color;
3543 
3544  PIXCopyEventArgument(destination, limit, formatString);
3545  PIXCopyEventArgument(destination, limit, a1);
3546  PIXCopyEventArgument(destination, limit, a2);
3547  PIXCopyEventArgument(destination, limit, a3);
3548  PIXCopyEventArgument(destination, limit, a4);
3549  PIXCopyEventArgument(destination, limit, a5);
3550  PIXCopyEventArgument(destination, limit, a6);
3551  PIXCopyEventArgument(destination, limit, a7);
3552  PIXCopyEventArgument(destination, limit, a8);
3553  PIXCopyEventArgument(destination, limit, a9);
3554  PIXCopyEventArgument(destination, limit, a10);
3555  PIXCopyEventArgument(destination, limit, a11);
3556  PIXCopyEventArgument(destination, limit, a12);
3557  PIXCopyEventArgument(destination, limit, a13);
3558  PIXCopyEventArgument(destination, limit, a14);
3559 
3560  *destination = PIXEventsBlockEndMarker;
3561  threadInfo->destination = destination;
3562  }
3563  else if (limit != nullptr)
3564  {
3565  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
3566  }
3567 }
3568 
3569 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
3570 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
3571 {
3572  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3573  UINT64* destination = threadInfo->destination;
3574  UINT64* limit = threadInfo->biasedLimit;
3575  if (destination < limit)
3576  {
3577  limit += PIXEventsSafeFastCopySpaceQwords;
3578  UINT64 time = PIXGetTimestampCounter();
3579  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3580  *destination++ = color;
3581 
3582  PIXCopyEventArgument(destination, limit, formatString);
3583  PIXCopyEventArgument(destination, limit, a1);
3584  PIXCopyEventArgument(destination, limit, a2);
3585  PIXCopyEventArgument(destination, limit, a3);
3586  PIXCopyEventArgument(destination, limit, a4);
3587  PIXCopyEventArgument(destination, limit, a5);
3588  PIXCopyEventArgument(destination, limit, a6);
3589  PIXCopyEventArgument(destination, limit, a7);
3590  PIXCopyEventArgument(destination, limit, a8);
3591  PIXCopyEventArgument(destination, limit, a9);
3592  PIXCopyEventArgument(destination, limit, a10);
3593  PIXCopyEventArgument(destination, limit, a11);
3594  PIXCopyEventArgument(destination, limit, a12);
3595  PIXCopyEventArgument(destination, limit, a13);
3596  PIXCopyEventArgument(destination, limit, a14);
3597  PIXCopyEventArgument(destination, limit, a15);
3598 
3599  *destination = PIXEventsBlockEndMarker;
3600  threadInfo->destination = destination;
3601  }
3602  else if (limit != nullptr)
3603  {
3604  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
3605  }
3606 }
3607 
3608 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
3609 inline void PIXSetMarker(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
3610 {
3611  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3612  UINT64* destination = threadInfo->destination;
3613  UINT64* limit = threadInfo->biasedLimit;
3614  if (destination < limit)
3615  {
3616  limit += PIXEventsSafeFastCopySpaceQwords;
3617  UINT64 time = PIXGetTimestampCounter();
3618  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3619  *destination++ = color;
3620 
3621  PIXCopyEventArgument(destination, limit, formatString);
3622  PIXCopyEventArgument(destination, limit, a1);
3623  PIXCopyEventArgument(destination, limit, a2);
3624  PIXCopyEventArgument(destination, limit, a3);
3625  PIXCopyEventArgument(destination, limit, a4);
3626  PIXCopyEventArgument(destination, limit, a5);
3627  PIXCopyEventArgument(destination, limit, a6);
3628  PIXCopyEventArgument(destination, limit, a7);
3629  PIXCopyEventArgument(destination, limit, a8);
3630  PIXCopyEventArgument(destination, limit, a9);
3631  PIXCopyEventArgument(destination, limit, a10);
3632  PIXCopyEventArgument(destination, limit, a11);
3633  PIXCopyEventArgument(destination, limit, a12);
3634  PIXCopyEventArgument(destination, limit, a13);
3635  PIXCopyEventArgument(destination, limit, a14);
3636  PIXCopyEventArgument(destination, limit, a15);
3637  PIXCopyEventArgument(destination, limit, a16);
3638 
3639  *destination = PIXEventsBlockEndMarker;
3640  threadInfo->destination = destination;
3641  }
3642  else if (limit != nullptr)
3643  {
3644  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
3645  }
3646 }
3647 
3648 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString)
3649 {
3650  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3651  UINT64* destination = threadInfo->destination;
3652  UINT64* limit = threadInfo->biasedLimit;
3653  if (destination < limit)
3654  {
3655  limit += PIXEventsSafeFastCopySpaceQwords;
3656  UINT64 time = PIXGetTimestampCounter();
3657  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_NoArgs);
3658  *destination++ = color;
3659 
3660  PIXCopyEventArgument(destination, limit, formatString);
3661 
3662  *destination = PIXEventsBlockEndMarker;
3663  threadInfo->destination = destination;
3664  }
3665  else if (limit != nullptr)
3666  {
3667  PIXSetMarkerAllocate(color, formatString);
3668  }
3669 }
3670 
3671 template<class T1>
3672 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1)
3673 {
3674  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3675  UINT64* destination = threadInfo->destination;
3676  UINT64* limit = threadInfo->biasedLimit;
3677  if (destination < limit)
3678  {
3679  limit += PIXEventsSafeFastCopySpaceQwords;
3680  UINT64 time = PIXGetTimestampCounter();
3681  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3682  *destination++ = color;
3683 
3684  PIXCopyEventArgument(destination, limit, formatString);
3685  PIXCopyEventArgument(destination, limit, a1);
3686 
3687  *destination = PIXEventsBlockEndMarker;
3688  threadInfo->destination = destination;
3689  }
3690  else if (limit != nullptr)
3691  {
3692  PIXSetMarkerAllocate(color, formatString, a1);
3693  }
3694 }
3695 
3696 template<class T1, class T2>
3697 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
3698 {
3699  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3700  UINT64* destination = threadInfo->destination;
3701  UINT64* limit = threadInfo->biasedLimit;
3702  if (destination < limit)
3703  {
3704  limit += PIXEventsSafeFastCopySpaceQwords;
3705  UINT64 time = PIXGetTimestampCounter();
3706  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3707  *destination++ = color;
3708 
3709  PIXCopyEventArgument(destination, limit, formatString);
3710  PIXCopyEventArgument(destination, limit, a1);
3711  PIXCopyEventArgument(destination, limit, a2);
3712 
3713  *destination = PIXEventsBlockEndMarker;
3714  threadInfo->destination = destination;
3715  }
3716  else if (limit != nullptr)
3717  {
3718  PIXSetMarkerAllocate(color, formatString, a1, a2);
3719  }
3720 }
3721 
3722 template<class T1, class T2, class T3>
3723 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
3724 {
3725  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3726  UINT64* destination = threadInfo->destination;
3727  UINT64* limit = threadInfo->biasedLimit;
3728  if (destination < limit)
3729  {
3730  limit += PIXEventsSafeFastCopySpaceQwords;
3731  UINT64 time = PIXGetTimestampCounter();
3732  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3733  *destination++ = color;
3734 
3735  PIXCopyEventArgument(destination, limit, formatString);
3736  PIXCopyEventArgument(destination, limit, a1);
3737  PIXCopyEventArgument(destination, limit, a2);
3738  PIXCopyEventArgument(destination, limit, a3);
3739 
3740  *destination = PIXEventsBlockEndMarker;
3741  threadInfo->destination = destination;
3742  }
3743  else if (limit != nullptr)
3744  {
3745  PIXSetMarkerAllocate(color, formatString, a1, a2, a3);
3746  }
3747 }
3748 
3749 template<class T1, class T2, class T3, class T4>
3750 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
3751 {
3752  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3753  UINT64* destination = threadInfo->destination;
3754  UINT64* limit = threadInfo->biasedLimit;
3755  if (destination < limit)
3756  {
3757  limit += PIXEventsSafeFastCopySpaceQwords;
3758  UINT64 time = PIXGetTimestampCounter();
3759  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3760  *destination++ = color;
3761 
3762  PIXCopyEventArgument(destination, limit, formatString);
3763  PIXCopyEventArgument(destination, limit, a1);
3764  PIXCopyEventArgument(destination, limit, a2);
3765  PIXCopyEventArgument(destination, limit, a3);
3766  PIXCopyEventArgument(destination, limit, a4);
3767 
3768  *destination = PIXEventsBlockEndMarker;
3769  threadInfo->destination = destination;
3770  }
3771  else if (limit != nullptr)
3772  {
3773  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4);
3774  }
3775 }
3776 
3777 template<class T1, class T2, class T3, class T4, class T5>
3778 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
3779 {
3780  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3781  UINT64* destination = threadInfo->destination;
3782  UINT64* limit = threadInfo->biasedLimit;
3783  if (destination < limit)
3784  {
3785  limit += PIXEventsSafeFastCopySpaceQwords;
3786  UINT64 time = PIXGetTimestampCounter();
3787  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3788  *destination++ = color;
3789 
3790  PIXCopyEventArgument(destination, limit, formatString);
3791  PIXCopyEventArgument(destination, limit, a1);
3792  PIXCopyEventArgument(destination, limit, a2);
3793  PIXCopyEventArgument(destination, limit, a3);
3794  PIXCopyEventArgument(destination, limit, a4);
3795  PIXCopyEventArgument(destination, limit, a5);
3796 
3797  *destination = PIXEventsBlockEndMarker;
3798  threadInfo->destination = destination;
3799  }
3800  else if (limit != nullptr)
3801  {
3802  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5);
3803  }
3804 }
3805 
3806 template<class T1, class T2, class T3, class T4, class T5, class T6>
3807 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
3808 {
3809  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3810  UINT64* destination = threadInfo->destination;
3811  UINT64* limit = threadInfo->biasedLimit;
3812  if (destination < limit)
3813  {
3814  limit += PIXEventsSafeFastCopySpaceQwords;
3815  UINT64 time = PIXGetTimestampCounter();
3816  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3817  *destination++ = color;
3818 
3819  PIXCopyEventArgument(destination, limit, formatString);
3820  PIXCopyEventArgument(destination, limit, a1);
3821  PIXCopyEventArgument(destination, limit, a2);
3822  PIXCopyEventArgument(destination, limit, a3);
3823  PIXCopyEventArgument(destination, limit, a4);
3824  PIXCopyEventArgument(destination, limit, a5);
3825  PIXCopyEventArgument(destination, limit, a6);
3826 
3827  *destination = PIXEventsBlockEndMarker;
3828  threadInfo->destination = destination;
3829  }
3830  else if (limit != nullptr)
3831  {
3832  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6);
3833  }
3834 }
3835 
3836 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
3837 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
3838 {
3839  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3840  UINT64* destination = threadInfo->destination;
3841  UINT64* limit = threadInfo->biasedLimit;
3842  if (destination < limit)
3843  {
3844  limit += PIXEventsSafeFastCopySpaceQwords;
3845  UINT64 time = PIXGetTimestampCounter();
3846  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3847  *destination++ = color;
3848 
3849  PIXCopyEventArgument(destination, limit, formatString);
3850  PIXCopyEventArgument(destination, limit, a1);
3851  PIXCopyEventArgument(destination, limit, a2);
3852  PIXCopyEventArgument(destination, limit, a3);
3853  PIXCopyEventArgument(destination, limit, a4);
3854  PIXCopyEventArgument(destination, limit, a5);
3855  PIXCopyEventArgument(destination, limit, a6);
3856  PIXCopyEventArgument(destination, limit, a7);
3857 
3858  *destination = PIXEventsBlockEndMarker;
3859  threadInfo->destination = destination;
3860  }
3861  else if (limit != nullptr)
3862  {
3863  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7);
3864  }
3865 }
3866 
3867 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
3868 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
3869 {
3870  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3871  UINT64* destination = threadInfo->destination;
3872  UINT64* limit = threadInfo->biasedLimit;
3873  if (destination < limit)
3874  {
3875  limit += PIXEventsSafeFastCopySpaceQwords;
3876  UINT64 time = PIXGetTimestampCounter();
3877  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3878  *destination++ = color;
3879 
3880  PIXCopyEventArgument(destination, limit, formatString);
3881  PIXCopyEventArgument(destination, limit, a1);
3882  PIXCopyEventArgument(destination, limit, a2);
3883  PIXCopyEventArgument(destination, limit, a3);
3884  PIXCopyEventArgument(destination, limit, a4);
3885  PIXCopyEventArgument(destination, limit, a5);
3886  PIXCopyEventArgument(destination, limit, a6);
3887  PIXCopyEventArgument(destination, limit, a7);
3888  PIXCopyEventArgument(destination, limit, a8);
3889 
3890  *destination = PIXEventsBlockEndMarker;
3891  threadInfo->destination = destination;
3892  }
3893  else if (limit != nullptr)
3894  {
3895  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
3896  }
3897 }
3898 
3899 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
3900 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
3901 {
3902  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3903  UINT64* destination = threadInfo->destination;
3904  UINT64* limit = threadInfo->biasedLimit;
3905  if (destination < limit)
3906  {
3907  limit += PIXEventsSafeFastCopySpaceQwords;
3908  UINT64 time = PIXGetTimestampCounter();
3909  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3910  *destination++ = color;
3911 
3912  PIXCopyEventArgument(destination, limit, formatString);
3913  PIXCopyEventArgument(destination, limit, a1);
3914  PIXCopyEventArgument(destination, limit, a2);
3915  PIXCopyEventArgument(destination, limit, a3);
3916  PIXCopyEventArgument(destination, limit, a4);
3917  PIXCopyEventArgument(destination, limit, a5);
3918  PIXCopyEventArgument(destination, limit, a6);
3919  PIXCopyEventArgument(destination, limit, a7);
3920  PIXCopyEventArgument(destination, limit, a8);
3921  PIXCopyEventArgument(destination, limit, a9);
3922 
3923  *destination = PIXEventsBlockEndMarker;
3924  threadInfo->destination = destination;
3925  }
3926  else if (limit != nullptr)
3927  {
3928  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
3929  }
3930 }
3931 
3932 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
3933 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
3934 {
3935  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3936  UINT64* destination = threadInfo->destination;
3937  UINT64* limit = threadInfo->biasedLimit;
3938  if (destination < limit)
3939  {
3940  limit += PIXEventsSafeFastCopySpaceQwords;
3941  UINT64 time = PIXGetTimestampCounter();
3942  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3943  *destination++ = color;
3944 
3945  PIXCopyEventArgument(destination, limit, formatString);
3946  PIXCopyEventArgument(destination, limit, a1);
3947  PIXCopyEventArgument(destination, limit, a2);
3948  PIXCopyEventArgument(destination, limit, a3);
3949  PIXCopyEventArgument(destination, limit, a4);
3950  PIXCopyEventArgument(destination, limit, a5);
3951  PIXCopyEventArgument(destination, limit, a6);
3952  PIXCopyEventArgument(destination, limit, a7);
3953  PIXCopyEventArgument(destination, limit, a8);
3954  PIXCopyEventArgument(destination, limit, a9);
3955  PIXCopyEventArgument(destination, limit, a10);
3956 
3957  *destination = PIXEventsBlockEndMarker;
3958  threadInfo->destination = destination;
3959  }
3960  else if (limit != nullptr)
3961  {
3962  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
3963  }
3964 }
3965 
3966 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
3967 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
3968 {
3969  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
3970  UINT64* destination = threadInfo->destination;
3971  UINT64* limit = threadInfo->biasedLimit;
3972  if (destination < limit)
3973  {
3974  limit += PIXEventsSafeFastCopySpaceQwords;
3975  UINT64 time = PIXGetTimestampCounter();
3976  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
3977  *destination++ = color;
3978 
3979  PIXCopyEventArgument(destination, limit, formatString);
3980  PIXCopyEventArgument(destination, limit, a1);
3981  PIXCopyEventArgument(destination, limit, a2);
3982  PIXCopyEventArgument(destination, limit, a3);
3983  PIXCopyEventArgument(destination, limit, a4);
3984  PIXCopyEventArgument(destination, limit, a5);
3985  PIXCopyEventArgument(destination, limit, a6);
3986  PIXCopyEventArgument(destination, limit, a7);
3987  PIXCopyEventArgument(destination, limit, a8);
3988  PIXCopyEventArgument(destination, limit, a9);
3989  PIXCopyEventArgument(destination, limit, a10);
3990  PIXCopyEventArgument(destination, limit, a11);
3991 
3992  *destination = PIXEventsBlockEndMarker;
3993  threadInfo->destination = destination;
3994  }
3995  else if (limit != nullptr)
3996  {
3997  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
3998  }
3999 }
4000 
4001 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
4002 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
4003 {
4004  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
4005  UINT64* destination = threadInfo->destination;
4006  UINT64* limit = threadInfo->biasedLimit;
4007  if (destination < limit)
4008  {
4009  limit += PIXEventsSafeFastCopySpaceQwords;
4010  UINT64 time = PIXGetTimestampCounter();
4011  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
4012  *destination++ = color;
4013 
4014  PIXCopyEventArgument(destination, limit, formatString);
4015  PIXCopyEventArgument(destination, limit, a1);
4016  PIXCopyEventArgument(destination, limit, a2);
4017  PIXCopyEventArgument(destination, limit, a3);
4018  PIXCopyEventArgument(destination, limit, a4);
4019  PIXCopyEventArgument(destination, limit, a5);
4020  PIXCopyEventArgument(destination, limit, a6);
4021  PIXCopyEventArgument(destination, limit, a7);
4022  PIXCopyEventArgument(destination, limit, a8);
4023  PIXCopyEventArgument(destination, limit, a9);
4024  PIXCopyEventArgument(destination, limit, a10);
4025  PIXCopyEventArgument(destination, limit, a11);
4026  PIXCopyEventArgument(destination, limit, a12);
4027 
4028  *destination = PIXEventsBlockEndMarker;
4029  threadInfo->destination = destination;
4030  }
4031  else if (limit != nullptr)
4032  {
4033  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
4034  }
4035 }
4036 
4037 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
4038 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
4039 {
4040  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
4041  UINT64* destination = threadInfo->destination;
4042  UINT64* limit = threadInfo->biasedLimit;
4043  if (destination < limit)
4044  {
4045  limit += PIXEventsSafeFastCopySpaceQwords;
4046  UINT64 time = PIXGetTimestampCounter();
4047  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
4048  *destination++ = color;
4049 
4050  PIXCopyEventArgument(destination, limit, formatString);
4051  PIXCopyEventArgument(destination, limit, a1);
4052  PIXCopyEventArgument(destination, limit, a2);
4053  PIXCopyEventArgument(destination, limit, a3);
4054  PIXCopyEventArgument(destination, limit, a4);
4055  PIXCopyEventArgument(destination, limit, a5);
4056  PIXCopyEventArgument(destination, limit, a6);
4057  PIXCopyEventArgument(destination, limit, a7);
4058  PIXCopyEventArgument(destination, limit, a8);
4059  PIXCopyEventArgument(destination, limit, a9);
4060  PIXCopyEventArgument(destination, limit, a10);
4061  PIXCopyEventArgument(destination, limit, a11);
4062  PIXCopyEventArgument(destination, limit, a12);
4063  PIXCopyEventArgument(destination, limit, a13);
4064 
4065  *destination = PIXEventsBlockEndMarker;
4066  threadInfo->destination = destination;
4067  }
4068  else if (limit != nullptr)
4069  {
4070  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
4071  }
4072 }
4073 
4074 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
4075 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
4076 {
4077  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
4078  UINT64* destination = threadInfo->destination;
4079  UINT64* limit = threadInfo->biasedLimit;
4080  if (destination < limit)
4081  {
4082  limit += PIXEventsSafeFastCopySpaceQwords;
4083  UINT64 time = PIXGetTimestampCounter();
4084  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
4085  *destination++ = color;
4086 
4087  PIXCopyEventArgument(destination, limit, formatString);
4088  PIXCopyEventArgument(destination, limit, a1);
4089  PIXCopyEventArgument(destination, limit, a2);
4090  PIXCopyEventArgument(destination, limit, a3);
4091  PIXCopyEventArgument(destination, limit, a4);
4092  PIXCopyEventArgument(destination, limit, a5);
4093  PIXCopyEventArgument(destination, limit, a6);
4094  PIXCopyEventArgument(destination, limit, a7);
4095  PIXCopyEventArgument(destination, limit, a8);
4096  PIXCopyEventArgument(destination, limit, a9);
4097  PIXCopyEventArgument(destination, limit, a10);
4098  PIXCopyEventArgument(destination, limit, a11);
4099  PIXCopyEventArgument(destination, limit, a12);
4100  PIXCopyEventArgument(destination, limit, a13);
4101  PIXCopyEventArgument(destination, limit, a14);
4102 
4103  *destination = PIXEventsBlockEndMarker;
4104  threadInfo->destination = destination;
4105  }
4106  else if (limit != nullptr)
4107  {
4108  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
4109  }
4110 }
4111 
4112 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
4113 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
4114 {
4115  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
4116  UINT64* destination = threadInfo->destination;
4117  UINT64* limit = threadInfo->biasedLimit;
4118  if (destination < limit)
4119  {
4120  limit += PIXEventsSafeFastCopySpaceQwords;
4121  UINT64 time = PIXGetTimestampCounter();
4122  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
4123  *destination++ = color;
4124 
4125  PIXCopyEventArgument(destination, limit, formatString);
4126  PIXCopyEventArgument(destination, limit, a1);
4127  PIXCopyEventArgument(destination, limit, a2);
4128  PIXCopyEventArgument(destination, limit, a3);
4129  PIXCopyEventArgument(destination, limit, a4);
4130  PIXCopyEventArgument(destination, limit, a5);
4131  PIXCopyEventArgument(destination, limit, a6);
4132  PIXCopyEventArgument(destination, limit, a7);
4133  PIXCopyEventArgument(destination, limit, a8);
4134  PIXCopyEventArgument(destination, limit, a9);
4135  PIXCopyEventArgument(destination, limit, a10);
4136  PIXCopyEventArgument(destination, limit, a11);
4137  PIXCopyEventArgument(destination, limit, a12);
4138  PIXCopyEventArgument(destination, limit, a13);
4139  PIXCopyEventArgument(destination, limit, a14);
4140  PIXCopyEventArgument(destination, limit, a15);
4141 
4142  *destination = PIXEventsBlockEndMarker;
4143  threadInfo->destination = destination;
4144  }
4145  else if (limit != nullptr)
4146  {
4147  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
4148  }
4149 }
4150 
4151 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
4152 inline void PIXSetMarker(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
4153 {
4154  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
4155  UINT64* destination = threadInfo->destination;
4156  UINT64* limit = threadInfo->biasedLimit;
4157  if (destination < limit)
4158  {
4159  limit += PIXEventsSafeFastCopySpaceQwords;
4160  UINT64 time = PIXGetTimestampCounter();
4161  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_VarArgs);
4162  *destination++ = color;
4163 
4164  PIXCopyEventArgument(destination, limit, formatString);
4165  PIXCopyEventArgument(destination, limit, a1);
4166  PIXCopyEventArgument(destination, limit, a2);
4167  PIXCopyEventArgument(destination, limit, a3);
4168  PIXCopyEventArgument(destination, limit, a4);
4169  PIXCopyEventArgument(destination, limit, a5);
4170  PIXCopyEventArgument(destination, limit, a6);
4171  PIXCopyEventArgument(destination, limit, a7);
4172  PIXCopyEventArgument(destination, limit, a8);
4173  PIXCopyEventArgument(destination, limit, a9);
4174  PIXCopyEventArgument(destination, limit, a10);
4175  PIXCopyEventArgument(destination, limit, a11);
4176  PIXCopyEventArgument(destination, limit, a12);
4177  PIXCopyEventArgument(destination, limit, a13);
4178  PIXCopyEventArgument(destination, limit, a14);
4179  PIXCopyEventArgument(destination, limit, a15);
4180  PIXCopyEventArgument(destination, limit, a16);
4181 
4182  *destination = PIXEventsBlockEndMarker;
4183  threadInfo->destination = destination;
4184  }
4185  else if (limit != nullptr)
4186  {
4187  PIXSetMarkerAllocate(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
4188  }
4189 }
4190 
4191 template<class TContext>
4192 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString)
4193 {
4194  PIXBeginCPUEventOnContext(context, color, formatString);
4195 
4196  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4197  UINT64* destination = buffer;
4198  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4199 
4200  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_NoArgs);
4201  *destination++ = color;
4202 
4203  PIXCopyEventArgument(destination, limit, formatString);
4204  *destination = 0ull;
4205  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4206 }
4207 
4208 template<class TContext, class T1>
4209 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1)
4210 {
4211  PIXBeginCPUEventOnContext(context, color, formatString, a1);
4212 
4213  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4214  UINT64* destination = buffer;
4215  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4216 
4217  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4218  *destination++ = color;
4219 
4220  PIXCopyEventArgument(destination, limit, formatString);
4221  PIXCopyEventArgument(destination, limit, a1);
4222  *destination = 0ull;
4223  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4224 }
4225 
4226 template<class TContext, class T1, class T2>
4227 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
4228 {
4229  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2);
4230 
4231  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4232  UINT64* destination = buffer;
4233  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4234 
4235  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4236  *destination++ = color;
4237 
4238  PIXCopyEventArgument(destination, limit, formatString);
4239  PIXCopyEventArgument(destination, limit, a1);
4240  PIXCopyEventArgument(destination, limit, a2);
4241  *destination = 0ull;
4242  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4243 }
4244 
4245 template<class TContext, class T1, class T2, class T3>
4246 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
4247 {
4248  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3);
4249 
4250  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4251  UINT64* destination = buffer;
4252  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4253 
4254  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4255  *destination++ = color;
4256 
4257  PIXCopyEventArgument(destination, limit, formatString);
4258  PIXCopyEventArgument(destination, limit, a1);
4259  PIXCopyEventArgument(destination, limit, a2);
4260  PIXCopyEventArgument(destination, limit, a3);
4261  *destination = 0ull;
4262  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4263 }
4264 
4265 template<class TContext, class T1, class T2, class T3, class T4>
4266 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
4267 {
4268  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4);
4269 
4270  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4271  UINT64* destination = buffer;
4272  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4273 
4274  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4275  *destination++ = color;
4276 
4277  PIXCopyEventArgument(destination, limit, formatString);
4278  PIXCopyEventArgument(destination, limit, a1);
4279  PIXCopyEventArgument(destination, limit, a2);
4280  PIXCopyEventArgument(destination, limit, a3);
4281  PIXCopyEventArgument(destination, limit, a4);
4282  *destination = 0ull;
4283  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4284 }
4285 
4286 template<class TContext, class T1, class T2, class T3, class T4, class T5>
4287 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
4288 {
4289  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5);
4290 
4291  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4292  UINT64* destination = buffer;
4293  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4294 
4295  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4296  *destination++ = color;
4297 
4298  PIXCopyEventArgument(destination, limit, formatString);
4299  PIXCopyEventArgument(destination, limit, a1);
4300  PIXCopyEventArgument(destination, limit, a2);
4301  PIXCopyEventArgument(destination, limit, a3);
4302  PIXCopyEventArgument(destination, limit, a4);
4303  PIXCopyEventArgument(destination, limit, a5);
4304  *destination = 0ull;
4305  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4306 }
4307 
4308 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6>
4309 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
4310 {
4311  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6);
4312 
4313  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4314  UINT64* destination = buffer;
4315  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4316 
4317  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4318  *destination++ = color;
4319 
4320  PIXCopyEventArgument(destination, limit, formatString);
4321  PIXCopyEventArgument(destination, limit, a1);
4322  PIXCopyEventArgument(destination, limit, a2);
4323  PIXCopyEventArgument(destination, limit, a3);
4324  PIXCopyEventArgument(destination, limit, a4);
4325  PIXCopyEventArgument(destination, limit, a5);
4326  PIXCopyEventArgument(destination, limit, a6);
4327  *destination = 0ull;
4328  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4329 }
4330 
4331 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
4332 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
4333 {
4334  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
4335 
4336  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4337  UINT64* destination = buffer;
4338  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4339 
4340  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4341  *destination++ = color;
4342 
4343  PIXCopyEventArgument(destination, limit, formatString);
4344  PIXCopyEventArgument(destination, limit, a1);
4345  PIXCopyEventArgument(destination, limit, a2);
4346  PIXCopyEventArgument(destination, limit, a3);
4347  PIXCopyEventArgument(destination, limit, a4);
4348  PIXCopyEventArgument(destination, limit, a5);
4349  PIXCopyEventArgument(destination, limit, a6);
4350  PIXCopyEventArgument(destination, limit, a7);
4351  *destination = 0ull;
4352  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4353 }
4354 
4355 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
4356 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
4357 {
4358  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
4359 
4360  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4361  UINT64* destination = buffer;
4362  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4363 
4364  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4365  *destination++ = color;
4366 
4367  PIXCopyEventArgument(destination, limit, formatString);
4368  PIXCopyEventArgument(destination, limit, a1);
4369  PIXCopyEventArgument(destination, limit, a2);
4370  PIXCopyEventArgument(destination, limit, a3);
4371  PIXCopyEventArgument(destination, limit, a4);
4372  PIXCopyEventArgument(destination, limit, a5);
4373  PIXCopyEventArgument(destination, limit, a6);
4374  PIXCopyEventArgument(destination, limit, a7);
4375  PIXCopyEventArgument(destination, limit, a8);
4376  *destination = 0ull;
4377  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4378 }
4379 
4380 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
4381 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
4382 {
4383  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
4384 
4385  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4386  UINT64* destination = buffer;
4387  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4388 
4389  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4390  *destination++ = color;
4391 
4392  PIXCopyEventArgument(destination, limit, formatString);
4393  PIXCopyEventArgument(destination, limit, a1);
4394  PIXCopyEventArgument(destination, limit, a2);
4395  PIXCopyEventArgument(destination, limit, a3);
4396  PIXCopyEventArgument(destination, limit, a4);
4397  PIXCopyEventArgument(destination, limit, a5);
4398  PIXCopyEventArgument(destination, limit, a6);
4399  PIXCopyEventArgument(destination, limit, a7);
4400  PIXCopyEventArgument(destination, limit, a8);
4401  PIXCopyEventArgument(destination, limit, a9);
4402  *destination = 0ull;
4403  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4404 }
4405 
4406 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
4407 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
4408 {
4409  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
4410 
4411  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4412  UINT64* destination = buffer;
4413  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4414 
4415  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4416  *destination++ = color;
4417 
4418  PIXCopyEventArgument(destination, limit, formatString);
4419  PIXCopyEventArgument(destination, limit, a1);
4420  PIXCopyEventArgument(destination, limit, a2);
4421  PIXCopyEventArgument(destination, limit, a3);
4422  PIXCopyEventArgument(destination, limit, a4);
4423  PIXCopyEventArgument(destination, limit, a5);
4424  PIXCopyEventArgument(destination, limit, a6);
4425  PIXCopyEventArgument(destination, limit, a7);
4426  PIXCopyEventArgument(destination, limit, a8);
4427  PIXCopyEventArgument(destination, limit, a9);
4428  PIXCopyEventArgument(destination, limit, a10);
4429  *destination = 0ull;
4430  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4431 }
4432 
4433 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
4434 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
4435 {
4436  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
4437 
4438  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4439  UINT64* destination = buffer;
4440  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4441 
4442  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4443  *destination++ = color;
4444 
4445  PIXCopyEventArgument(destination, limit, formatString);
4446  PIXCopyEventArgument(destination, limit, a1);
4447  PIXCopyEventArgument(destination, limit, a2);
4448  PIXCopyEventArgument(destination, limit, a3);
4449  PIXCopyEventArgument(destination, limit, a4);
4450  PIXCopyEventArgument(destination, limit, a5);
4451  PIXCopyEventArgument(destination, limit, a6);
4452  PIXCopyEventArgument(destination, limit, a7);
4453  PIXCopyEventArgument(destination, limit, a8);
4454  PIXCopyEventArgument(destination, limit, a9);
4455  PIXCopyEventArgument(destination, limit, a10);
4456  PIXCopyEventArgument(destination, limit, a11);
4457  *destination = 0ull;
4458  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4459 }
4460 
4461 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
4462 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
4463 {
4464  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
4465 
4466  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4467  UINT64* destination = buffer;
4468  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4469 
4470  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4471  *destination++ = color;
4472 
4473  PIXCopyEventArgument(destination, limit, formatString);
4474  PIXCopyEventArgument(destination, limit, a1);
4475  PIXCopyEventArgument(destination, limit, a2);
4476  PIXCopyEventArgument(destination, limit, a3);
4477  PIXCopyEventArgument(destination, limit, a4);
4478  PIXCopyEventArgument(destination, limit, a5);
4479  PIXCopyEventArgument(destination, limit, a6);
4480  PIXCopyEventArgument(destination, limit, a7);
4481  PIXCopyEventArgument(destination, limit, a8);
4482  PIXCopyEventArgument(destination, limit, a9);
4483  PIXCopyEventArgument(destination, limit, a10);
4484  PIXCopyEventArgument(destination, limit, a11);
4485  PIXCopyEventArgument(destination, limit, a12);
4486  *destination = 0ull;
4487  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4488 }
4489 
4490 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
4491 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
4492 {
4493  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
4494 
4495  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4496  UINT64* destination = buffer;
4497  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4498 
4499  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4500  *destination++ = color;
4501 
4502  PIXCopyEventArgument(destination, limit, formatString);
4503  PIXCopyEventArgument(destination, limit, a1);
4504  PIXCopyEventArgument(destination, limit, a2);
4505  PIXCopyEventArgument(destination, limit, a3);
4506  PIXCopyEventArgument(destination, limit, a4);
4507  PIXCopyEventArgument(destination, limit, a5);
4508  PIXCopyEventArgument(destination, limit, a6);
4509  PIXCopyEventArgument(destination, limit, a7);
4510  PIXCopyEventArgument(destination, limit, a8);
4511  PIXCopyEventArgument(destination, limit, a9);
4512  PIXCopyEventArgument(destination, limit, a10);
4513  PIXCopyEventArgument(destination, limit, a11);
4514  PIXCopyEventArgument(destination, limit, a12);
4515  PIXCopyEventArgument(destination, limit, a13);
4516  *destination = 0ull;
4517  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4518 }
4519 
4520 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
4521 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
4522 {
4523  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
4524 
4525  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4526  UINT64* destination = buffer;
4527  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4528 
4529  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4530  *destination++ = color;
4531 
4532  PIXCopyEventArgument(destination, limit, formatString);
4533  PIXCopyEventArgument(destination, limit, a1);
4534  PIXCopyEventArgument(destination, limit, a2);
4535  PIXCopyEventArgument(destination, limit, a3);
4536  PIXCopyEventArgument(destination, limit, a4);
4537  PIXCopyEventArgument(destination, limit, a5);
4538  PIXCopyEventArgument(destination, limit, a6);
4539  PIXCopyEventArgument(destination, limit, a7);
4540  PIXCopyEventArgument(destination, limit, a8);
4541  PIXCopyEventArgument(destination, limit, a9);
4542  PIXCopyEventArgument(destination, limit, a10);
4543  PIXCopyEventArgument(destination, limit, a11);
4544  PIXCopyEventArgument(destination, limit, a12);
4545  PIXCopyEventArgument(destination, limit, a13);
4546  PIXCopyEventArgument(destination, limit, a14);
4547  *destination = 0ull;
4548  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4549 }
4550 
4551 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
4552 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
4553 {
4554  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
4555 
4556  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4557  UINT64* destination = buffer;
4558  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4559 
4560  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4561  *destination++ = color;
4562 
4563  PIXCopyEventArgument(destination, limit, formatString);
4564  PIXCopyEventArgument(destination, limit, a1);
4565  PIXCopyEventArgument(destination, limit, a2);
4566  PIXCopyEventArgument(destination, limit, a3);
4567  PIXCopyEventArgument(destination, limit, a4);
4568  PIXCopyEventArgument(destination, limit, a5);
4569  PIXCopyEventArgument(destination, limit, a6);
4570  PIXCopyEventArgument(destination, limit, a7);
4571  PIXCopyEventArgument(destination, limit, a8);
4572  PIXCopyEventArgument(destination, limit, a9);
4573  PIXCopyEventArgument(destination, limit, a10);
4574  PIXCopyEventArgument(destination, limit, a11);
4575  PIXCopyEventArgument(destination, limit, a12);
4576  PIXCopyEventArgument(destination, limit, a13);
4577  PIXCopyEventArgument(destination, limit, a14);
4578  PIXCopyEventArgument(destination, limit, a15);
4579  *destination = 0ull;
4580  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4581 }
4582 
4583 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
4584 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
4585 {
4586  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
4587 
4588  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4589  UINT64* destination = buffer;
4590  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4591 
4592  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4593  *destination++ = color;
4594 
4595  PIXCopyEventArgument(destination, limit, formatString);
4596  PIXCopyEventArgument(destination, limit, a1);
4597  PIXCopyEventArgument(destination, limit, a2);
4598  PIXCopyEventArgument(destination, limit, a3);
4599  PIXCopyEventArgument(destination, limit, a4);
4600  PIXCopyEventArgument(destination, limit, a5);
4601  PIXCopyEventArgument(destination, limit, a6);
4602  PIXCopyEventArgument(destination, limit, a7);
4603  PIXCopyEventArgument(destination, limit, a8);
4604  PIXCopyEventArgument(destination, limit, a9);
4605  PIXCopyEventArgument(destination, limit, a10);
4606  PIXCopyEventArgument(destination, limit, a11);
4607  PIXCopyEventArgument(destination, limit, a12);
4608  PIXCopyEventArgument(destination, limit, a13);
4609  PIXCopyEventArgument(destination, limit, a14);
4610  PIXCopyEventArgument(destination, limit, a15);
4611  PIXCopyEventArgument(destination, limit, a16);
4612  *destination = 0ull;
4613  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4614 }
4615 
4616 template<class TContext>
4617 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString)
4618 {
4619  PIXBeginCPUEventOnContext(context, color, formatString);
4620 
4621  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4622  UINT64* destination = buffer;
4623  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4624 
4625  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_NoArgs);
4626  *destination++ = color;
4627 
4628  PIXCopyEventArgument(destination, limit, formatString);
4629  *destination = 0ull;
4630  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4631 }
4632 
4633 template<class TContext, class T1>
4634 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1)
4635 {
4636  PIXBeginCPUEventOnContext(context, color, formatString, a1);
4637 
4638  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4639  UINT64* destination = buffer;
4640  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4641 
4642  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4643  *destination++ = color;
4644 
4645  PIXCopyEventArgument(destination, limit, formatString);
4646  PIXCopyEventArgument(destination, limit, a1);
4647  *destination = 0ull;
4648  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4649 }
4650 
4651 template<class TContext, class T1, class T2>
4652 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
4653 {
4654  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2);
4655 
4656  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4657  UINT64* destination = buffer;
4658  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4659 
4660  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4661  *destination++ = color;
4662 
4663  PIXCopyEventArgument(destination, limit, formatString);
4664  PIXCopyEventArgument(destination, limit, a1);
4665  PIXCopyEventArgument(destination, limit, a2);
4666  *destination = 0ull;
4667  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4668 }
4669 
4670 template<class TContext, class T1, class T2, class T3>
4671 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
4672 {
4673  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3);
4674 
4675  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4676  UINT64* destination = buffer;
4677  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4678 
4679  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4680  *destination++ = color;
4681 
4682  PIXCopyEventArgument(destination, limit, formatString);
4683  PIXCopyEventArgument(destination, limit, a1);
4684  PIXCopyEventArgument(destination, limit, a2);
4685  PIXCopyEventArgument(destination, limit, a3);
4686  *destination = 0ull;
4687  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4688 }
4689 
4690 template<class TContext, class T1, class T2, class T3, class T4>
4691 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
4692 {
4693  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4);
4694 
4695  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4696  UINT64* destination = buffer;
4697  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4698 
4699  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4700  *destination++ = color;
4701 
4702  PIXCopyEventArgument(destination, limit, formatString);
4703  PIXCopyEventArgument(destination, limit, a1);
4704  PIXCopyEventArgument(destination, limit, a2);
4705  PIXCopyEventArgument(destination, limit, a3);
4706  PIXCopyEventArgument(destination, limit, a4);
4707  *destination = 0ull;
4708  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4709 }
4710 
4711 template<class TContext, class T1, class T2, class T3, class T4, class T5>
4712 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
4713 {
4714  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5);
4715 
4716  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4717  UINT64* destination = buffer;
4718  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4719 
4720  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4721  *destination++ = color;
4722 
4723  PIXCopyEventArgument(destination, limit, formatString);
4724  PIXCopyEventArgument(destination, limit, a1);
4725  PIXCopyEventArgument(destination, limit, a2);
4726  PIXCopyEventArgument(destination, limit, a3);
4727  PIXCopyEventArgument(destination, limit, a4);
4728  PIXCopyEventArgument(destination, limit, a5);
4729  *destination = 0ull;
4730  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4731 }
4732 
4733 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6>
4734 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
4735 {
4736  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6);
4737 
4738  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4739  UINT64* destination = buffer;
4740  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4741 
4742  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4743  *destination++ = color;
4744 
4745  PIXCopyEventArgument(destination, limit, formatString);
4746  PIXCopyEventArgument(destination, limit, a1);
4747  PIXCopyEventArgument(destination, limit, a2);
4748  PIXCopyEventArgument(destination, limit, a3);
4749  PIXCopyEventArgument(destination, limit, a4);
4750  PIXCopyEventArgument(destination, limit, a5);
4751  PIXCopyEventArgument(destination, limit, a6);
4752  *destination = 0ull;
4753  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4754 }
4755 
4756 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
4757 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
4758 {
4759  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
4760 
4761  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4762  UINT64* destination = buffer;
4763  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4764 
4765  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4766  *destination++ = color;
4767 
4768  PIXCopyEventArgument(destination, limit, formatString);
4769  PIXCopyEventArgument(destination, limit, a1);
4770  PIXCopyEventArgument(destination, limit, a2);
4771  PIXCopyEventArgument(destination, limit, a3);
4772  PIXCopyEventArgument(destination, limit, a4);
4773  PIXCopyEventArgument(destination, limit, a5);
4774  PIXCopyEventArgument(destination, limit, a6);
4775  PIXCopyEventArgument(destination, limit, a7);
4776  *destination = 0ull;
4777  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4778 }
4779 
4780 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
4781 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
4782 {
4783  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
4784 
4785  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4786  UINT64* destination = buffer;
4787  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4788 
4789  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4790  *destination++ = color;
4791 
4792  PIXCopyEventArgument(destination, limit, formatString);
4793  PIXCopyEventArgument(destination, limit, a1);
4794  PIXCopyEventArgument(destination, limit, a2);
4795  PIXCopyEventArgument(destination, limit, a3);
4796  PIXCopyEventArgument(destination, limit, a4);
4797  PIXCopyEventArgument(destination, limit, a5);
4798  PIXCopyEventArgument(destination, limit, a6);
4799  PIXCopyEventArgument(destination, limit, a7);
4800  PIXCopyEventArgument(destination, limit, a8);
4801  *destination = 0ull;
4802  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4803 }
4804 
4805 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
4806 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
4807 {
4808  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
4809 
4810  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4811  UINT64* destination = buffer;
4812  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4813 
4814  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4815  *destination++ = color;
4816 
4817  PIXCopyEventArgument(destination, limit, formatString);
4818  PIXCopyEventArgument(destination, limit, a1);
4819  PIXCopyEventArgument(destination, limit, a2);
4820  PIXCopyEventArgument(destination, limit, a3);
4821  PIXCopyEventArgument(destination, limit, a4);
4822  PIXCopyEventArgument(destination, limit, a5);
4823  PIXCopyEventArgument(destination, limit, a6);
4824  PIXCopyEventArgument(destination, limit, a7);
4825  PIXCopyEventArgument(destination, limit, a8);
4826  PIXCopyEventArgument(destination, limit, a9);
4827  *destination = 0ull;
4828  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4829 }
4830 
4831 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
4832 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
4833 {
4834  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
4835 
4836  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4837  UINT64* destination = buffer;
4838  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4839 
4840  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4841  *destination++ = color;
4842 
4843  PIXCopyEventArgument(destination, limit, formatString);
4844  PIXCopyEventArgument(destination, limit, a1);
4845  PIXCopyEventArgument(destination, limit, a2);
4846  PIXCopyEventArgument(destination, limit, a3);
4847  PIXCopyEventArgument(destination, limit, a4);
4848  PIXCopyEventArgument(destination, limit, a5);
4849  PIXCopyEventArgument(destination, limit, a6);
4850  PIXCopyEventArgument(destination, limit, a7);
4851  PIXCopyEventArgument(destination, limit, a8);
4852  PIXCopyEventArgument(destination, limit, a9);
4853  PIXCopyEventArgument(destination, limit, a10);
4854  *destination = 0ull;
4855  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4856 }
4857 
4858 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
4859 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
4860 {
4861  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
4862 
4863  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4864  UINT64* destination = buffer;
4865  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4866 
4867  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4868  *destination++ = color;
4869 
4870  PIXCopyEventArgument(destination, limit, formatString);
4871  PIXCopyEventArgument(destination, limit, a1);
4872  PIXCopyEventArgument(destination, limit, a2);
4873  PIXCopyEventArgument(destination, limit, a3);
4874  PIXCopyEventArgument(destination, limit, a4);
4875  PIXCopyEventArgument(destination, limit, a5);
4876  PIXCopyEventArgument(destination, limit, a6);
4877  PIXCopyEventArgument(destination, limit, a7);
4878  PIXCopyEventArgument(destination, limit, a8);
4879  PIXCopyEventArgument(destination, limit, a9);
4880  PIXCopyEventArgument(destination, limit, a10);
4881  PIXCopyEventArgument(destination, limit, a11);
4882  *destination = 0ull;
4883  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4884 }
4885 
4886 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
4887 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
4888 {
4889  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
4890 
4891  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4892  UINT64* destination = buffer;
4893  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4894 
4895  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4896  *destination++ = color;
4897 
4898  PIXCopyEventArgument(destination, limit, formatString);
4899  PIXCopyEventArgument(destination, limit, a1);
4900  PIXCopyEventArgument(destination, limit, a2);
4901  PIXCopyEventArgument(destination, limit, a3);
4902  PIXCopyEventArgument(destination, limit, a4);
4903  PIXCopyEventArgument(destination, limit, a5);
4904  PIXCopyEventArgument(destination, limit, a6);
4905  PIXCopyEventArgument(destination, limit, a7);
4906  PIXCopyEventArgument(destination, limit, a8);
4907  PIXCopyEventArgument(destination, limit, a9);
4908  PIXCopyEventArgument(destination, limit, a10);
4909  PIXCopyEventArgument(destination, limit, a11);
4910  PIXCopyEventArgument(destination, limit, a12);
4911  *destination = 0ull;
4912  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4913 }
4914 
4915 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
4916 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
4917 {
4918  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
4919 
4920  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4921  UINT64* destination = buffer;
4922  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4923 
4924  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4925  *destination++ = color;
4926 
4927  PIXCopyEventArgument(destination, limit, formatString);
4928  PIXCopyEventArgument(destination, limit, a1);
4929  PIXCopyEventArgument(destination, limit, a2);
4930  PIXCopyEventArgument(destination, limit, a3);
4931  PIXCopyEventArgument(destination, limit, a4);
4932  PIXCopyEventArgument(destination, limit, a5);
4933  PIXCopyEventArgument(destination, limit, a6);
4934  PIXCopyEventArgument(destination, limit, a7);
4935  PIXCopyEventArgument(destination, limit, a8);
4936  PIXCopyEventArgument(destination, limit, a9);
4937  PIXCopyEventArgument(destination, limit, a10);
4938  PIXCopyEventArgument(destination, limit, a11);
4939  PIXCopyEventArgument(destination, limit, a12);
4940  PIXCopyEventArgument(destination, limit, a13);
4941  *destination = 0ull;
4942  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4943 }
4944 
4945 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
4946 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
4947 {
4948  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
4949 
4950  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4951  UINT64* destination = buffer;
4952  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4953 
4954  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4955  *destination++ = color;
4956 
4957  PIXCopyEventArgument(destination, limit, formatString);
4958  PIXCopyEventArgument(destination, limit, a1);
4959  PIXCopyEventArgument(destination, limit, a2);
4960  PIXCopyEventArgument(destination, limit, a3);
4961  PIXCopyEventArgument(destination, limit, a4);
4962  PIXCopyEventArgument(destination, limit, a5);
4963  PIXCopyEventArgument(destination, limit, a6);
4964  PIXCopyEventArgument(destination, limit, a7);
4965  PIXCopyEventArgument(destination, limit, a8);
4966  PIXCopyEventArgument(destination, limit, a9);
4967  PIXCopyEventArgument(destination, limit, a10);
4968  PIXCopyEventArgument(destination, limit, a11);
4969  PIXCopyEventArgument(destination, limit, a12);
4970  PIXCopyEventArgument(destination, limit, a13);
4971  PIXCopyEventArgument(destination, limit, a14);
4972  *destination = 0ull;
4973  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
4974 }
4975 
4976 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
4977 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
4978 {
4979  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
4980 
4981  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
4982  UINT64* destination = buffer;
4983  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
4984 
4985  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
4986  *destination++ = color;
4987 
4988  PIXCopyEventArgument(destination, limit, formatString);
4989  PIXCopyEventArgument(destination, limit, a1);
4990  PIXCopyEventArgument(destination, limit, a2);
4991  PIXCopyEventArgument(destination, limit, a3);
4992  PIXCopyEventArgument(destination, limit, a4);
4993  PIXCopyEventArgument(destination, limit, a5);
4994  PIXCopyEventArgument(destination, limit, a6);
4995  PIXCopyEventArgument(destination, limit, a7);
4996  PIXCopyEventArgument(destination, limit, a8);
4997  PIXCopyEventArgument(destination, limit, a9);
4998  PIXCopyEventArgument(destination, limit, a10);
4999  PIXCopyEventArgument(destination, limit, a11);
5000  PIXCopyEventArgument(destination, limit, a12);
5001  PIXCopyEventArgument(destination, limit, a13);
5002  PIXCopyEventArgument(destination, limit, a14);
5003  PIXCopyEventArgument(destination, limit, a15);
5004  *destination = 0ull;
5005  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5006 }
5007 
5008 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
5009 inline void PIXBeginEvent(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
5010 {
5011  PIXBeginCPUEventOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
5012 
5013  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5014  UINT64* destination = buffer;
5015  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5016 
5017  *destination++ = PIXEncodeEventInfo(0, PIXEvent_BeginEvent_VarArgs);
5018  *destination++ = color;
5019 
5020  PIXCopyEventArgument(destination, limit, formatString);
5021  PIXCopyEventArgument(destination, limit, a1);
5022  PIXCopyEventArgument(destination, limit, a2);
5023  PIXCopyEventArgument(destination, limit, a3);
5024  PIXCopyEventArgument(destination, limit, a4);
5025  PIXCopyEventArgument(destination, limit, a5);
5026  PIXCopyEventArgument(destination, limit, a6);
5027  PIXCopyEventArgument(destination, limit, a7);
5028  PIXCopyEventArgument(destination, limit, a8);
5029  PIXCopyEventArgument(destination, limit, a9);
5030  PIXCopyEventArgument(destination, limit, a10);
5031  PIXCopyEventArgument(destination, limit, a11);
5032  PIXCopyEventArgument(destination, limit, a12);
5033  PIXCopyEventArgument(destination, limit, a13);
5034  PIXCopyEventArgument(destination, limit, a14);
5035  PIXCopyEventArgument(destination, limit, a15);
5036  PIXCopyEventArgument(destination, limit, a16);
5037  *destination = 0ull;
5038  PIXBeginEventOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5039 }
5040 
5041 template<class TContext>
5042 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString)
5043 {
5044  PIXSetCPUMarkerOnContext(context, color, formatString);
5045 
5046  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5047  UINT64* destination = buffer;
5048  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5049 
5050  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_NoArgs);
5051  *destination++ = color;
5052 
5053  PIXCopyEventArgument(destination, limit, formatString);
5054  *destination = 0ull;
5055  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5056 }
5057 
5058 template<class TContext, class T1>
5059 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1)
5060 {
5061  PIXSetCPUMarkerOnContext(context, color, formatString, a1);
5062 
5063  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5064  UINT64* destination = buffer;
5065  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5066 
5067  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5068  *destination++ = color;
5069 
5070  PIXCopyEventArgument(destination, limit, formatString);
5071  PIXCopyEventArgument(destination, limit, a1);
5072  *destination = 0ull;
5073  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5074 }
5075 
5076 template<class TContext, class T1, class T2>
5077 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
5078 {
5079  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2);
5080 
5081  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5082  UINT64* destination = buffer;
5083  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5084 
5085  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5086  *destination++ = color;
5087 
5088  PIXCopyEventArgument(destination, limit, formatString);
5089  PIXCopyEventArgument(destination, limit, a1);
5090  PIXCopyEventArgument(destination, limit, a2);
5091  *destination = 0ull;
5092  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5093 }
5094 
5095 template<class TContext, class T1, class T2, class T3>
5096 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
5097 {
5098  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3);
5099 
5100  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5101  UINT64* destination = buffer;
5102  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5103 
5104  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5105  *destination++ = color;
5106 
5107  PIXCopyEventArgument(destination, limit, formatString);
5108  PIXCopyEventArgument(destination, limit, a1);
5109  PIXCopyEventArgument(destination, limit, a2);
5110  PIXCopyEventArgument(destination, limit, a3);
5111  *destination = 0ull;
5112  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5113 }
5114 
5115 template<class TContext, class T1, class T2, class T3, class T4>
5116 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
5117 {
5118  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4);
5119 
5120  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5121  UINT64* destination = buffer;
5122  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5123 
5124  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5125  *destination++ = color;
5126 
5127  PIXCopyEventArgument(destination, limit, formatString);
5128  PIXCopyEventArgument(destination, limit, a1);
5129  PIXCopyEventArgument(destination, limit, a2);
5130  PIXCopyEventArgument(destination, limit, a3);
5131  PIXCopyEventArgument(destination, limit, a4);
5132  *destination = 0ull;
5133  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5134 }
5135 
5136 template<class TContext, class T1, class T2, class T3, class T4, class T5>
5137 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
5138 {
5139  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5);
5140 
5141  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5142  UINT64* destination = buffer;
5143  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5144 
5145  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5146  *destination++ = color;
5147 
5148  PIXCopyEventArgument(destination, limit, formatString);
5149  PIXCopyEventArgument(destination, limit, a1);
5150  PIXCopyEventArgument(destination, limit, a2);
5151  PIXCopyEventArgument(destination, limit, a3);
5152  PIXCopyEventArgument(destination, limit, a4);
5153  PIXCopyEventArgument(destination, limit, a5);
5154  *destination = 0ull;
5155  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5156 }
5157 
5158 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6>
5159 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
5160 {
5161  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6);
5162 
5163  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5164  UINT64* destination = buffer;
5165  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5166 
5167  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5168  *destination++ = color;
5169 
5170  PIXCopyEventArgument(destination, limit, formatString);
5171  PIXCopyEventArgument(destination, limit, a1);
5172  PIXCopyEventArgument(destination, limit, a2);
5173  PIXCopyEventArgument(destination, limit, a3);
5174  PIXCopyEventArgument(destination, limit, a4);
5175  PIXCopyEventArgument(destination, limit, a5);
5176  PIXCopyEventArgument(destination, limit, a6);
5177  *destination = 0ull;
5178  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5179 }
5180 
5181 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
5182 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
5183 {
5184  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
5185 
5186  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5187  UINT64* destination = buffer;
5188  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5189 
5190  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5191  *destination++ = color;
5192 
5193  PIXCopyEventArgument(destination, limit, formatString);
5194  PIXCopyEventArgument(destination, limit, a1);
5195  PIXCopyEventArgument(destination, limit, a2);
5196  PIXCopyEventArgument(destination, limit, a3);
5197  PIXCopyEventArgument(destination, limit, a4);
5198  PIXCopyEventArgument(destination, limit, a5);
5199  PIXCopyEventArgument(destination, limit, a6);
5200  PIXCopyEventArgument(destination, limit, a7);
5201  *destination = 0ull;
5202  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5203 }
5204 
5205 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
5206 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
5207 {
5208  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
5209 
5210  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5211  UINT64* destination = buffer;
5212  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5213 
5214  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5215  *destination++ = color;
5216 
5217  PIXCopyEventArgument(destination, limit, formatString);
5218  PIXCopyEventArgument(destination, limit, a1);
5219  PIXCopyEventArgument(destination, limit, a2);
5220  PIXCopyEventArgument(destination, limit, a3);
5221  PIXCopyEventArgument(destination, limit, a4);
5222  PIXCopyEventArgument(destination, limit, a5);
5223  PIXCopyEventArgument(destination, limit, a6);
5224  PIXCopyEventArgument(destination, limit, a7);
5225  PIXCopyEventArgument(destination, limit, a8);
5226  *destination = 0ull;
5227  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5228 }
5229 
5230 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
5231 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
5232 {
5233  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
5234 
5235  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5236  UINT64* destination = buffer;
5237  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5238 
5239  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5240  *destination++ = color;
5241 
5242  PIXCopyEventArgument(destination, limit, formatString);
5243  PIXCopyEventArgument(destination, limit, a1);
5244  PIXCopyEventArgument(destination, limit, a2);
5245  PIXCopyEventArgument(destination, limit, a3);
5246  PIXCopyEventArgument(destination, limit, a4);
5247  PIXCopyEventArgument(destination, limit, a5);
5248  PIXCopyEventArgument(destination, limit, a6);
5249  PIXCopyEventArgument(destination, limit, a7);
5250  PIXCopyEventArgument(destination, limit, a8);
5251  PIXCopyEventArgument(destination, limit, a9);
5252  *destination = 0ull;
5253  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5254 }
5255 
5256 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
5257 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
5258 {
5259  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
5260 
5261  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5262  UINT64* destination = buffer;
5263  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5264 
5265  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5266  *destination++ = color;
5267 
5268  PIXCopyEventArgument(destination, limit, formatString);
5269  PIXCopyEventArgument(destination, limit, a1);
5270  PIXCopyEventArgument(destination, limit, a2);
5271  PIXCopyEventArgument(destination, limit, a3);
5272  PIXCopyEventArgument(destination, limit, a4);
5273  PIXCopyEventArgument(destination, limit, a5);
5274  PIXCopyEventArgument(destination, limit, a6);
5275  PIXCopyEventArgument(destination, limit, a7);
5276  PIXCopyEventArgument(destination, limit, a8);
5277  PIXCopyEventArgument(destination, limit, a9);
5278  PIXCopyEventArgument(destination, limit, a10);
5279  *destination = 0ull;
5280  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5281 }
5282 
5283 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
5284 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
5285 {
5286  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
5287 
5288  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5289  UINT64* destination = buffer;
5290  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5291 
5292  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5293  *destination++ = color;
5294 
5295  PIXCopyEventArgument(destination, limit, formatString);
5296  PIXCopyEventArgument(destination, limit, a1);
5297  PIXCopyEventArgument(destination, limit, a2);
5298  PIXCopyEventArgument(destination, limit, a3);
5299  PIXCopyEventArgument(destination, limit, a4);
5300  PIXCopyEventArgument(destination, limit, a5);
5301  PIXCopyEventArgument(destination, limit, a6);
5302  PIXCopyEventArgument(destination, limit, a7);
5303  PIXCopyEventArgument(destination, limit, a8);
5304  PIXCopyEventArgument(destination, limit, a9);
5305  PIXCopyEventArgument(destination, limit, a10);
5306  PIXCopyEventArgument(destination, limit, a11);
5307  *destination = 0ull;
5308  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5309 }
5310 
5311 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
5312 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
5313 {
5314  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
5315 
5316  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5317  UINT64* destination = buffer;
5318  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5319 
5320  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5321  *destination++ = color;
5322 
5323  PIXCopyEventArgument(destination, limit, formatString);
5324  PIXCopyEventArgument(destination, limit, a1);
5325  PIXCopyEventArgument(destination, limit, a2);
5326  PIXCopyEventArgument(destination, limit, a3);
5327  PIXCopyEventArgument(destination, limit, a4);
5328  PIXCopyEventArgument(destination, limit, a5);
5329  PIXCopyEventArgument(destination, limit, a6);
5330  PIXCopyEventArgument(destination, limit, a7);
5331  PIXCopyEventArgument(destination, limit, a8);
5332  PIXCopyEventArgument(destination, limit, a9);
5333  PIXCopyEventArgument(destination, limit, a10);
5334  PIXCopyEventArgument(destination, limit, a11);
5335  PIXCopyEventArgument(destination, limit, a12);
5336  *destination = 0ull;
5337  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5338 }
5339 
5340 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
5341 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
5342 {
5343  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
5344 
5345  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5346  UINT64* destination = buffer;
5347  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5348 
5349  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5350  *destination++ = color;
5351 
5352  PIXCopyEventArgument(destination, limit, formatString);
5353  PIXCopyEventArgument(destination, limit, a1);
5354  PIXCopyEventArgument(destination, limit, a2);
5355  PIXCopyEventArgument(destination, limit, a3);
5356  PIXCopyEventArgument(destination, limit, a4);
5357  PIXCopyEventArgument(destination, limit, a5);
5358  PIXCopyEventArgument(destination, limit, a6);
5359  PIXCopyEventArgument(destination, limit, a7);
5360  PIXCopyEventArgument(destination, limit, a8);
5361  PIXCopyEventArgument(destination, limit, a9);
5362  PIXCopyEventArgument(destination, limit, a10);
5363  PIXCopyEventArgument(destination, limit, a11);
5364  PIXCopyEventArgument(destination, limit, a12);
5365  PIXCopyEventArgument(destination, limit, a13);
5366  *destination = 0ull;
5367  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5368 }
5369 
5370 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
5371 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
5372 {
5373  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
5374 
5375  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5376  UINT64* destination = buffer;
5377  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5378 
5379  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5380  *destination++ = color;
5381 
5382  PIXCopyEventArgument(destination, limit, formatString);
5383  PIXCopyEventArgument(destination, limit, a1);
5384  PIXCopyEventArgument(destination, limit, a2);
5385  PIXCopyEventArgument(destination, limit, a3);
5386  PIXCopyEventArgument(destination, limit, a4);
5387  PIXCopyEventArgument(destination, limit, a5);
5388  PIXCopyEventArgument(destination, limit, a6);
5389  PIXCopyEventArgument(destination, limit, a7);
5390  PIXCopyEventArgument(destination, limit, a8);
5391  PIXCopyEventArgument(destination, limit, a9);
5392  PIXCopyEventArgument(destination, limit, a10);
5393  PIXCopyEventArgument(destination, limit, a11);
5394  PIXCopyEventArgument(destination, limit, a12);
5395  PIXCopyEventArgument(destination, limit, a13);
5396  PIXCopyEventArgument(destination, limit, a14);
5397  *destination = 0ull;
5398  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5399 }
5400 
5401 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
5402 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
5403 {
5404  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
5405 
5406  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5407  UINT64* destination = buffer;
5408  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5409 
5410  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5411  *destination++ = color;
5412 
5413  PIXCopyEventArgument(destination, limit, formatString);
5414  PIXCopyEventArgument(destination, limit, a1);
5415  PIXCopyEventArgument(destination, limit, a2);
5416  PIXCopyEventArgument(destination, limit, a3);
5417  PIXCopyEventArgument(destination, limit, a4);
5418  PIXCopyEventArgument(destination, limit, a5);
5419  PIXCopyEventArgument(destination, limit, a6);
5420  PIXCopyEventArgument(destination, limit, a7);
5421  PIXCopyEventArgument(destination, limit, a8);
5422  PIXCopyEventArgument(destination, limit, a9);
5423  PIXCopyEventArgument(destination, limit, a10);
5424  PIXCopyEventArgument(destination, limit, a11);
5425  PIXCopyEventArgument(destination, limit, a12);
5426  PIXCopyEventArgument(destination, limit, a13);
5427  PIXCopyEventArgument(destination, limit, a14);
5428  PIXCopyEventArgument(destination, limit, a15);
5429  *destination = 0ull;
5430  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5431 }
5432 
5433 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
5434 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
5435 {
5436  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
5437 
5438  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5439  UINT64* destination = buffer;
5440  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5441 
5442  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5443  *destination++ = color;
5444 
5445  PIXCopyEventArgument(destination, limit, formatString);
5446  PIXCopyEventArgument(destination, limit, a1);
5447  PIXCopyEventArgument(destination, limit, a2);
5448  PIXCopyEventArgument(destination, limit, a3);
5449  PIXCopyEventArgument(destination, limit, a4);
5450  PIXCopyEventArgument(destination, limit, a5);
5451  PIXCopyEventArgument(destination, limit, a6);
5452  PIXCopyEventArgument(destination, limit, a7);
5453  PIXCopyEventArgument(destination, limit, a8);
5454  PIXCopyEventArgument(destination, limit, a9);
5455  PIXCopyEventArgument(destination, limit, a10);
5456  PIXCopyEventArgument(destination, limit, a11);
5457  PIXCopyEventArgument(destination, limit, a12);
5458  PIXCopyEventArgument(destination, limit, a13);
5459  PIXCopyEventArgument(destination, limit, a14);
5460  PIXCopyEventArgument(destination, limit, a15);
5461  PIXCopyEventArgument(destination, limit, a16);
5462  *destination = 0ull;
5463  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5464 }
5465 
5466 template<class TContext>
5467 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString)
5468 {
5469  PIXSetCPUMarkerOnContext(context, color, formatString);
5470 
5471  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5472  UINT64* destination = buffer;
5473  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5474 
5475  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_NoArgs);
5476  *destination++ = color;
5477 
5478  PIXCopyEventArgument(destination, limit, formatString);
5479  *destination = 0ull;
5480  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5481 }
5482 
5483 template<class TContext, class T1>
5484 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1)
5485 {
5486  PIXSetCPUMarkerOnContext(context, color, formatString, a1);
5487 
5488  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5489  UINT64* destination = buffer;
5490  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5491 
5492  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5493  *destination++ = color;
5494 
5495  PIXCopyEventArgument(destination, limit, formatString);
5496  PIXCopyEventArgument(destination, limit, a1);
5497  *destination = 0ull;
5498  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5499 }
5500 
5501 template<class TContext, class T1, class T2>
5502 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
5503 {
5504  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2);
5505 
5506  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5507  UINT64* destination = buffer;
5508  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5509 
5510  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5511  *destination++ = color;
5512 
5513  PIXCopyEventArgument(destination, limit, formatString);
5514  PIXCopyEventArgument(destination, limit, a1);
5515  PIXCopyEventArgument(destination, limit, a2);
5516  *destination = 0ull;
5517  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5518 }
5519 
5520 template<class TContext, class T1, class T2, class T3>
5521 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
5522 {
5523  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3);
5524 
5525  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5526  UINT64* destination = buffer;
5527  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5528 
5529  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5530  *destination++ = color;
5531 
5532  PIXCopyEventArgument(destination, limit, formatString);
5533  PIXCopyEventArgument(destination, limit, a1);
5534  PIXCopyEventArgument(destination, limit, a2);
5535  PIXCopyEventArgument(destination, limit, a3);
5536  *destination = 0ull;
5537  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5538 }
5539 
5540 template<class TContext, class T1, class T2, class T3, class T4>
5541 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
5542 {
5543  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4);
5544 
5545  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5546  UINT64* destination = buffer;
5547  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5548 
5549  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5550  *destination++ = color;
5551 
5552  PIXCopyEventArgument(destination, limit, formatString);
5553  PIXCopyEventArgument(destination, limit, a1);
5554  PIXCopyEventArgument(destination, limit, a2);
5555  PIXCopyEventArgument(destination, limit, a3);
5556  PIXCopyEventArgument(destination, limit, a4);
5557  *destination = 0ull;
5558  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5559 }
5560 
5561 template<class TContext, class T1, class T2, class T3, class T4, class T5>
5562 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
5563 {
5564  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5);
5565 
5566  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5567  UINT64* destination = buffer;
5568  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5569 
5570  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5571  *destination++ = color;
5572 
5573  PIXCopyEventArgument(destination, limit, formatString);
5574  PIXCopyEventArgument(destination, limit, a1);
5575  PIXCopyEventArgument(destination, limit, a2);
5576  PIXCopyEventArgument(destination, limit, a3);
5577  PIXCopyEventArgument(destination, limit, a4);
5578  PIXCopyEventArgument(destination, limit, a5);
5579  *destination = 0ull;
5580  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5581 }
5582 
5583 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6>
5584 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
5585 {
5586  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6);
5587 
5588  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5589  UINT64* destination = buffer;
5590  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5591 
5592  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5593  *destination++ = color;
5594 
5595  PIXCopyEventArgument(destination, limit, formatString);
5596  PIXCopyEventArgument(destination, limit, a1);
5597  PIXCopyEventArgument(destination, limit, a2);
5598  PIXCopyEventArgument(destination, limit, a3);
5599  PIXCopyEventArgument(destination, limit, a4);
5600  PIXCopyEventArgument(destination, limit, a5);
5601  PIXCopyEventArgument(destination, limit, a6);
5602  *destination = 0ull;
5603  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5604 }
5605 
5606 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7>
5607 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
5608 {
5609  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
5610 
5611  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5612  UINT64* destination = buffer;
5613  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5614 
5615  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5616  *destination++ = color;
5617 
5618  PIXCopyEventArgument(destination, limit, formatString);
5619  PIXCopyEventArgument(destination, limit, a1);
5620  PIXCopyEventArgument(destination, limit, a2);
5621  PIXCopyEventArgument(destination, limit, a3);
5622  PIXCopyEventArgument(destination, limit, a4);
5623  PIXCopyEventArgument(destination, limit, a5);
5624  PIXCopyEventArgument(destination, limit, a6);
5625  PIXCopyEventArgument(destination, limit, a7);
5626  *destination = 0ull;
5627  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5628 }
5629 
5630 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
5631 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
5632 {
5633  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
5634 
5635  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5636  UINT64* destination = buffer;
5637  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5638 
5639  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5640  *destination++ = color;
5641 
5642  PIXCopyEventArgument(destination, limit, formatString);
5643  PIXCopyEventArgument(destination, limit, a1);
5644  PIXCopyEventArgument(destination, limit, a2);
5645  PIXCopyEventArgument(destination, limit, a3);
5646  PIXCopyEventArgument(destination, limit, a4);
5647  PIXCopyEventArgument(destination, limit, a5);
5648  PIXCopyEventArgument(destination, limit, a6);
5649  PIXCopyEventArgument(destination, limit, a7);
5650  PIXCopyEventArgument(destination, limit, a8);
5651  *destination = 0ull;
5652  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5653 }
5654 
5655 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
5656 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
5657 {
5658  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
5659 
5660  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5661  UINT64* destination = buffer;
5662  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5663 
5664  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5665  *destination++ = color;
5666 
5667  PIXCopyEventArgument(destination, limit, formatString);
5668  PIXCopyEventArgument(destination, limit, a1);
5669  PIXCopyEventArgument(destination, limit, a2);
5670  PIXCopyEventArgument(destination, limit, a3);
5671  PIXCopyEventArgument(destination, limit, a4);
5672  PIXCopyEventArgument(destination, limit, a5);
5673  PIXCopyEventArgument(destination, limit, a6);
5674  PIXCopyEventArgument(destination, limit, a7);
5675  PIXCopyEventArgument(destination, limit, a8);
5676  PIXCopyEventArgument(destination, limit, a9);
5677  *destination = 0ull;
5678  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5679 }
5680 
5681 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
5682 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
5683 {
5684  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
5685 
5686  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5687  UINT64* destination = buffer;
5688  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5689 
5690  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5691  *destination++ = color;
5692 
5693  PIXCopyEventArgument(destination, limit, formatString);
5694  PIXCopyEventArgument(destination, limit, a1);
5695  PIXCopyEventArgument(destination, limit, a2);
5696  PIXCopyEventArgument(destination, limit, a3);
5697  PIXCopyEventArgument(destination, limit, a4);
5698  PIXCopyEventArgument(destination, limit, a5);
5699  PIXCopyEventArgument(destination, limit, a6);
5700  PIXCopyEventArgument(destination, limit, a7);
5701  PIXCopyEventArgument(destination, limit, a8);
5702  PIXCopyEventArgument(destination, limit, a9);
5703  PIXCopyEventArgument(destination, limit, a10);
5704  *destination = 0ull;
5705  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5706 }
5707 
5708 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
5709 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
5710 {
5711  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
5712 
5713  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5714  UINT64* destination = buffer;
5715  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5716 
5717  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5718  *destination++ = color;
5719 
5720  PIXCopyEventArgument(destination, limit, formatString);
5721  PIXCopyEventArgument(destination, limit, a1);
5722  PIXCopyEventArgument(destination, limit, a2);
5723  PIXCopyEventArgument(destination, limit, a3);
5724  PIXCopyEventArgument(destination, limit, a4);
5725  PIXCopyEventArgument(destination, limit, a5);
5726  PIXCopyEventArgument(destination, limit, a6);
5727  PIXCopyEventArgument(destination, limit, a7);
5728  PIXCopyEventArgument(destination, limit, a8);
5729  PIXCopyEventArgument(destination, limit, a9);
5730  PIXCopyEventArgument(destination, limit, a10);
5731  PIXCopyEventArgument(destination, limit, a11);
5732  *destination = 0ull;
5733  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5734 }
5735 
5736 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
5737 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
5738 {
5739  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
5740 
5741  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5742  UINT64* destination = buffer;
5743  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5744 
5745  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5746  *destination++ = color;
5747 
5748  PIXCopyEventArgument(destination, limit, formatString);
5749  PIXCopyEventArgument(destination, limit, a1);
5750  PIXCopyEventArgument(destination, limit, a2);
5751  PIXCopyEventArgument(destination, limit, a3);
5752  PIXCopyEventArgument(destination, limit, a4);
5753  PIXCopyEventArgument(destination, limit, a5);
5754  PIXCopyEventArgument(destination, limit, a6);
5755  PIXCopyEventArgument(destination, limit, a7);
5756  PIXCopyEventArgument(destination, limit, a8);
5757  PIXCopyEventArgument(destination, limit, a9);
5758  PIXCopyEventArgument(destination, limit, a10);
5759  PIXCopyEventArgument(destination, limit, a11);
5760  PIXCopyEventArgument(destination, limit, a12);
5761  *destination = 0ull;
5762  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5763 }
5764 
5765 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
5766 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
5767 {
5768  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
5769 
5770  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5771  UINT64* destination = buffer;
5772  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5773 
5774  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5775  *destination++ = color;
5776 
5777  PIXCopyEventArgument(destination, limit, formatString);
5778  PIXCopyEventArgument(destination, limit, a1);
5779  PIXCopyEventArgument(destination, limit, a2);
5780  PIXCopyEventArgument(destination, limit, a3);
5781  PIXCopyEventArgument(destination, limit, a4);
5782  PIXCopyEventArgument(destination, limit, a5);
5783  PIXCopyEventArgument(destination, limit, a6);
5784  PIXCopyEventArgument(destination, limit, a7);
5785  PIXCopyEventArgument(destination, limit, a8);
5786  PIXCopyEventArgument(destination, limit, a9);
5787  PIXCopyEventArgument(destination, limit, a10);
5788  PIXCopyEventArgument(destination, limit, a11);
5789  PIXCopyEventArgument(destination, limit, a12);
5790  PIXCopyEventArgument(destination, limit, a13);
5791  *destination = 0ull;
5792  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5793 }
5794 
5795 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
5796 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
5797 {
5798  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
5799 
5800  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5801  UINT64* destination = buffer;
5802  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5803 
5804  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5805  *destination++ = color;
5806 
5807  PIXCopyEventArgument(destination, limit, formatString);
5808  PIXCopyEventArgument(destination, limit, a1);
5809  PIXCopyEventArgument(destination, limit, a2);
5810  PIXCopyEventArgument(destination, limit, a3);
5811  PIXCopyEventArgument(destination, limit, a4);
5812  PIXCopyEventArgument(destination, limit, a5);
5813  PIXCopyEventArgument(destination, limit, a6);
5814  PIXCopyEventArgument(destination, limit, a7);
5815  PIXCopyEventArgument(destination, limit, a8);
5816  PIXCopyEventArgument(destination, limit, a9);
5817  PIXCopyEventArgument(destination, limit, a10);
5818  PIXCopyEventArgument(destination, limit, a11);
5819  PIXCopyEventArgument(destination, limit, a12);
5820  PIXCopyEventArgument(destination, limit, a13);
5821  PIXCopyEventArgument(destination, limit, a14);
5822  *destination = 0ull;
5823  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5824 }
5825 
5826 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
5827 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
5828 {
5829  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
5830 
5831  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5832  UINT64* destination = buffer;
5833  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5834 
5835  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5836  *destination++ = color;
5837 
5838  PIXCopyEventArgument(destination, limit, formatString);
5839  PIXCopyEventArgument(destination, limit, a1);
5840  PIXCopyEventArgument(destination, limit, a2);
5841  PIXCopyEventArgument(destination, limit, a3);
5842  PIXCopyEventArgument(destination, limit, a4);
5843  PIXCopyEventArgument(destination, limit, a5);
5844  PIXCopyEventArgument(destination, limit, a6);
5845  PIXCopyEventArgument(destination, limit, a7);
5846  PIXCopyEventArgument(destination, limit, a8);
5847  PIXCopyEventArgument(destination, limit, a9);
5848  PIXCopyEventArgument(destination, limit, a10);
5849  PIXCopyEventArgument(destination, limit, a11);
5850  PIXCopyEventArgument(destination, limit, a12);
5851  PIXCopyEventArgument(destination, limit, a13);
5852  PIXCopyEventArgument(destination, limit, a14);
5853  PIXCopyEventArgument(destination, limit, a15);
5854  *destination = 0ull;
5855  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5856 }
5857 
5858 template<class TContext, class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
5859 inline void PIXSetMarker(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
5860 {
5861  PIXSetCPUMarkerOnContext(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
5862 
5863  UINT64 buffer[PIXEventsGraphicsRecordSpaceQwords];
5864  UINT64* destination = buffer;
5865  UINT64* limit = buffer + PIXEventsGraphicsRecordSpaceQwords - PIXEventsReservedTailSpaceQwords;
5866 
5867  *destination++ = PIXEncodeEventInfo(0, PIXEvent_SetMarker_VarArgs);
5868  *destination++ = color;
5869 
5870  PIXCopyEventArgument(destination, limit, formatString);
5871  PIXCopyEventArgument(destination, limit, a1);
5872  PIXCopyEventArgument(destination, limit, a2);
5873  PIXCopyEventArgument(destination, limit, a3);
5874  PIXCopyEventArgument(destination, limit, a4);
5875  PIXCopyEventArgument(destination, limit, a5);
5876  PIXCopyEventArgument(destination, limit, a6);
5877  PIXCopyEventArgument(destination, limit, a7);
5878  PIXCopyEventArgument(destination, limit, a8);
5879  PIXCopyEventArgument(destination, limit, a9);
5880  PIXCopyEventArgument(destination, limit, a10);
5881  PIXCopyEventArgument(destination, limit, a11);
5882  PIXCopyEventArgument(destination, limit, a12);
5883  PIXCopyEventArgument(destination, limit, a13);
5884  PIXCopyEventArgument(destination, limit, a14);
5885  PIXCopyEventArgument(destination, limit, a15);
5886  PIXCopyEventArgument(destination, limit, a16);
5887  *destination = 0ull;
5888  PIXSetMarkerOnContext(context, static_cast<void*>(buffer), static_cast<UINT>(reinterpret_cast<BYTE*>(destination) - reinterpret_cast<BYTE*>(buffer)));
5889 }
5890 
5891 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString)
5892 {
5893  UINT64 time = PIXEventsReplaceBlock(false);
5894  if (time)
5895  {
5896  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
5897  UINT64* destination = threadInfo->destination;
5898  UINT64* limit = threadInfo->limit;
5899  if (destination < limit)
5900  {
5901  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_NoArgs);
5902  *destination++ = color;
5903 
5904  PIXCopyEventArgument(destination, limit, context);
5905  PIXCopyEventArgument(destination, limit, formatString);
5906 
5907  *destination = PIXEventsBlockEndMarker;
5908  threadInfo->destination = destination;
5909  }
5910  }
5911 }
5912 
5913 template<class T1>
5914 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1)
5915 {
5916  UINT64 time = PIXEventsReplaceBlock(false);
5917  if (time)
5918  {
5919  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
5920  UINT64* destination = threadInfo->destination;
5921  UINT64* limit = threadInfo->limit;
5922  if (destination < limit)
5923  {
5924  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
5925  *destination++ = color;
5926 
5927  PIXCopyEventArgument(destination, limit, context);
5928  PIXCopyEventArgument(destination, limit, formatString);
5929  PIXCopyEventArgument(destination, limit, a1);
5930 
5931  *destination = PIXEventsBlockEndMarker;
5932  threadInfo->destination = destination;
5933  }
5934  }
5935 }
5936 
5937 template<class T1, class T2>
5938 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2)
5939 {
5940  UINT64 time = PIXEventsReplaceBlock(false);
5941  if (time)
5942  {
5943  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
5944  UINT64* destination = threadInfo->destination;
5945  UINT64* limit = threadInfo->limit;
5946  if (destination < limit)
5947  {
5948  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
5949  *destination++ = color;
5950 
5951  PIXCopyEventArgument(destination, limit, context);
5952  PIXCopyEventArgument(destination, limit, formatString);
5953  PIXCopyEventArgument(destination, limit, a1);
5954  PIXCopyEventArgument(destination, limit, a2);
5955 
5956  *destination = PIXEventsBlockEndMarker;
5957  threadInfo->destination = destination;
5958  }
5959  }
5960 }
5961 
5962 template<class T1, class T2, class T3>
5963 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
5964 {
5965  UINT64 time = PIXEventsReplaceBlock(false);
5966  if (time)
5967  {
5968  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
5969  UINT64* destination = threadInfo->destination;
5970  UINT64* limit = threadInfo->limit;
5971  if (destination < limit)
5972  {
5973  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
5974  *destination++ = color;
5975 
5976  PIXCopyEventArgument(destination, limit, context);
5977  PIXCopyEventArgument(destination, limit, formatString);
5978  PIXCopyEventArgument(destination, limit, a1);
5979  PIXCopyEventArgument(destination, limit, a2);
5980  PIXCopyEventArgument(destination, limit, a3);
5981 
5982  *destination = PIXEventsBlockEndMarker;
5983  threadInfo->destination = destination;
5984  }
5985  }
5986 }
5987 
5988 template<class T1, class T2, class T3, class T4>
5989 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
5990 {
5991  UINT64 time = PIXEventsReplaceBlock(false);
5992  if (time)
5993  {
5994  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
5995  UINT64* destination = threadInfo->destination;
5996  UINT64* limit = threadInfo->limit;
5997  if (destination < limit)
5998  {
5999  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6000  *destination++ = color;
6001 
6002  PIXCopyEventArgument(destination, limit, context);
6003  PIXCopyEventArgument(destination, limit, formatString);
6004  PIXCopyEventArgument(destination, limit, a1);
6005  PIXCopyEventArgument(destination, limit, a2);
6006  PIXCopyEventArgument(destination, limit, a3);
6007  PIXCopyEventArgument(destination, limit, a4);
6008 
6009  *destination = PIXEventsBlockEndMarker;
6010  threadInfo->destination = destination;
6011  }
6012  }
6013 }
6014 
6015 template<class T1, class T2, class T3, class T4, class T5>
6016 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
6017 {
6018  UINT64 time = PIXEventsReplaceBlock(false);
6019  if (time)
6020  {
6021  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6022  UINT64* destination = threadInfo->destination;
6023  UINT64* limit = threadInfo->limit;
6024  if (destination < limit)
6025  {
6026  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6027  *destination++ = color;
6028 
6029  PIXCopyEventArgument(destination, limit, context);
6030  PIXCopyEventArgument(destination, limit, formatString);
6031  PIXCopyEventArgument(destination, limit, a1);
6032  PIXCopyEventArgument(destination, limit, a2);
6033  PIXCopyEventArgument(destination, limit, a3);
6034  PIXCopyEventArgument(destination, limit, a4);
6035  PIXCopyEventArgument(destination, limit, a5);
6036 
6037  *destination = PIXEventsBlockEndMarker;
6038  threadInfo->destination = destination;
6039  }
6040  }
6041 }
6042 
6043 template<class T1, class T2, class T3, class T4, class T5, class T6>
6044 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
6045 {
6046  UINT64 time = PIXEventsReplaceBlock(false);
6047  if (time)
6048  {
6049  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6050  UINT64* destination = threadInfo->destination;
6051  UINT64* limit = threadInfo->limit;
6052  if (destination < limit)
6053  {
6054  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6055  *destination++ = color;
6056 
6057  PIXCopyEventArgument(destination, limit, context);
6058  PIXCopyEventArgument(destination, limit, formatString);
6059  PIXCopyEventArgument(destination, limit, a1);
6060  PIXCopyEventArgument(destination, limit, a2);
6061  PIXCopyEventArgument(destination, limit, a3);
6062  PIXCopyEventArgument(destination, limit, a4);
6063  PIXCopyEventArgument(destination, limit, a5);
6064  PIXCopyEventArgument(destination, limit, a6);
6065 
6066  *destination = PIXEventsBlockEndMarker;
6067  threadInfo->destination = destination;
6068  }
6069  }
6070 }
6071 
6072 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
6073 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
6074 {
6075  UINT64 time = PIXEventsReplaceBlock(false);
6076  if (time)
6077  {
6078  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6079  UINT64* destination = threadInfo->destination;
6080  UINT64* limit = threadInfo->limit;
6081  if (destination < limit)
6082  {
6083  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6084  *destination++ = color;
6085 
6086  PIXCopyEventArgument(destination, limit, context);
6087  PIXCopyEventArgument(destination, limit, formatString);
6088  PIXCopyEventArgument(destination, limit, a1);
6089  PIXCopyEventArgument(destination, limit, a2);
6090  PIXCopyEventArgument(destination, limit, a3);
6091  PIXCopyEventArgument(destination, limit, a4);
6092  PIXCopyEventArgument(destination, limit, a5);
6093  PIXCopyEventArgument(destination, limit, a6);
6094  PIXCopyEventArgument(destination, limit, a7);
6095 
6096  *destination = PIXEventsBlockEndMarker;
6097  threadInfo->destination = destination;
6098  }
6099  }
6100 }
6101 
6102 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
6103 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
6104 {
6105  UINT64 time = PIXEventsReplaceBlock(false);
6106  if (time)
6107  {
6108  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6109  UINT64* destination = threadInfo->destination;
6110  UINT64* limit = threadInfo->limit;
6111  if (destination < limit)
6112  {
6113  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6114  *destination++ = color;
6115 
6116  PIXCopyEventArgument(destination, limit, context);
6117  PIXCopyEventArgument(destination, limit, formatString);
6118  PIXCopyEventArgument(destination, limit, a1);
6119  PIXCopyEventArgument(destination, limit, a2);
6120  PIXCopyEventArgument(destination, limit, a3);
6121  PIXCopyEventArgument(destination, limit, a4);
6122  PIXCopyEventArgument(destination, limit, a5);
6123  PIXCopyEventArgument(destination, limit, a6);
6124  PIXCopyEventArgument(destination, limit, a7);
6125  PIXCopyEventArgument(destination, limit, a8);
6126 
6127  *destination = PIXEventsBlockEndMarker;
6128  threadInfo->destination = destination;
6129  }
6130  }
6131 }
6132 
6133 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
6134 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
6135 {
6136  UINT64 time = PIXEventsReplaceBlock(false);
6137  if (time)
6138  {
6139  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6140  UINT64* destination = threadInfo->destination;
6141  UINT64* limit = threadInfo->limit;
6142  if (destination < limit)
6143  {
6144  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6145  *destination++ = color;
6146 
6147  PIXCopyEventArgument(destination, limit, context);
6148  PIXCopyEventArgument(destination, limit, formatString);
6149  PIXCopyEventArgument(destination, limit, a1);
6150  PIXCopyEventArgument(destination, limit, a2);
6151  PIXCopyEventArgument(destination, limit, a3);
6152  PIXCopyEventArgument(destination, limit, a4);
6153  PIXCopyEventArgument(destination, limit, a5);
6154  PIXCopyEventArgument(destination, limit, a6);
6155  PIXCopyEventArgument(destination, limit, a7);
6156  PIXCopyEventArgument(destination, limit, a8);
6157  PIXCopyEventArgument(destination, limit, a9);
6158 
6159  *destination = PIXEventsBlockEndMarker;
6160  threadInfo->destination = destination;
6161  }
6162  }
6163 }
6164 
6165 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
6166 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
6167 {
6168  UINT64 time = PIXEventsReplaceBlock(false);
6169  if (time)
6170  {
6171  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6172  UINT64* destination = threadInfo->destination;
6173  UINT64* limit = threadInfo->limit;
6174  if (destination < limit)
6175  {
6176  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6177  *destination++ = color;
6178 
6179  PIXCopyEventArgument(destination, limit, context);
6180  PIXCopyEventArgument(destination, limit, formatString);
6181  PIXCopyEventArgument(destination, limit, a1);
6182  PIXCopyEventArgument(destination, limit, a2);
6183  PIXCopyEventArgument(destination, limit, a3);
6184  PIXCopyEventArgument(destination, limit, a4);
6185  PIXCopyEventArgument(destination, limit, a5);
6186  PIXCopyEventArgument(destination, limit, a6);
6187  PIXCopyEventArgument(destination, limit, a7);
6188  PIXCopyEventArgument(destination, limit, a8);
6189  PIXCopyEventArgument(destination, limit, a9);
6190  PIXCopyEventArgument(destination, limit, a10);
6191 
6192  *destination = PIXEventsBlockEndMarker;
6193  threadInfo->destination = destination;
6194  }
6195  }
6196 }
6197 
6198 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
6199 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
6200 {
6201  UINT64 time = PIXEventsReplaceBlock(false);
6202  if (time)
6203  {
6204  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6205  UINT64* destination = threadInfo->destination;
6206  UINT64* limit = threadInfo->limit;
6207  if (destination < limit)
6208  {
6209  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6210  *destination++ = color;
6211 
6212  PIXCopyEventArgument(destination, limit, context);
6213  PIXCopyEventArgument(destination, limit, formatString);
6214  PIXCopyEventArgument(destination, limit, a1);
6215  PIXCopyEventArgument(destination, limit, a2);
6216  PIXCopyEventArgument(destination, limit, a3);
6217  PIXCopyEventArgument(destination, limit, a4);
6218  PIXCopyEventArgument(destination, limit, a5);
6219  PIXCopyEventArgument(destination, limit, a6);
6220  PIXCopyEventArgument(destination, limit, a7);
6221  PIXCopyEventArgument(destination, limit, a8);
6222  PIXCopyEventArgument(destination, limit, a9);
6223  PIXCopyEventArgument(destination, limit, a10);
6224  PIXCopyEventArgument(destination, limit, a11);
6225 
6226  *destination = PIXEventsBlockEndMarker;
6227  threadInfo->destination = destination;
6228  }
6229  }
6230 }
6231 
6232 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
6233 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
6234 {
6235  UINT64 time = PIXEventsReplaceBlock(false);
6236  if (time)
6237  {
6238  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6239  UINT64* destination = threadInfo->destination;
6240  UINT64* limit = threadInfo->limit;
6241  if (destination < limit)
6242  {
6243  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6244  *destination++ = color;
6245 
6246  PIXCopyEventArgument(destination, limit, context);
6247  PIXCopyEventArgument(destination, limit, formatString);
6248  PIXCopyEventArgument(destination, limit, a1);
6249  PIXCopyEventArgument(destination, limit, a2);
6250  PIXCopyEventArgument(destination, limit, a3);
6251  PIXCopyEventArgument(destination, limit, a4);
6252  PIXCopyEventArgument(destination, limit, a5);
6253  PIXCopyEventArgument(destination, limit, a6);
6254  PIXCopyEventArgument(destination, limit, a7);
6255  PIXCopyEventArgument(destination, limit, a8);
6256  PIXCopyEventArgument(destination, limit, a9);
6257  PIXCopyEventArgument(destination, limit, a10);
6258  PIXCopyEventArgument(destination, limit, a11);
6259  PIXCopyEventArgument(destination, limit, a12);
6260 
6261  *destination = PIXEventsBlockEndMarker;
6262  threadInfo->destination = destination;
6263  }
6264  }
6265 }
6266 
6267 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
6268 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
6269 {
6270  UINT64 time = PIXEventsReplaceBlock(false);
6271  if (time)
6272  {
6273  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6274  UINT64* destination = threadInfo->destination;
6275  UINT64* limit = threadInfo->limit;
6276  if (destination < limit)
6277  {
6278  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6279  *destination++ = color;
6280 
6281  PIXCopyEventArgument(destination, limit, context);
6282  PIXCopyEventArgument(destination, limit, formatString);
6283  PIXCopyEventArgument(destination, limit, a1);
6284  PIXCopyEventArgument(destination, limit, a2);
6285  PIXCopyEventArgument(destination, limit, a3);
6286  PIXCopyEventArgument(destination, limit, a4);
6287  PIXCopyEventArgument(destination, limit, a5);
6288  PIXCopyEventArgument(destination, limit, a6);
6289  PIXCopyEventArgument(destination, limit, a7);
6290  PIXCopyEventArgument(destination, limit, a8);
6291  PIXCopyEventArgument(destination, limit, a9);
6292  PIXCopyEventArgument(destination, limit, a10);
6293  PIXCopyEventArgument(destination, limit, a11);
6294  PIXCopyEventArgument(destination, limit, a12);
6295  PIXCopyEventArgument(destination, limit, a13);
6296 
6297  *destination = PIXEventsBlockEndMarker;
6298  threadInfo->destination = destination;
6299  }
6300  }
6301 }
6302 
6303 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
6304 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
6305 {
6306  UINT64 time = PIXEventsReplaceBlock(false);
6307  if (time)
6308  {
6309  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6310  UINT64* destination = threadInfo->destination;
6311  UINT64* limit = threadInfo->limit;
6312  if (destination < limit)
6313  {
6314  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6315  *destination++ = color;
6316 
6317  PIXCopyEventArgument(destination, limit, context);
6318  PIXCopyEventArgument(destination, limit, formatString);
6319  PIXCopyEventArgument(destination, limit, a1);
6320  PIXCopyEventArgument(destination, limit, a2);
6321  PIXCopyEventArgument(destination, limit, a3);
6322  PIXCopyEventArgument(destination, limit, a4);
6323  PIXCopyEventArgument(destination, limit, a5);
6324  PIXCopyEventArgument(destination, limit, a6);
6325  PIXCopyEventArgument(destination, limit, a7);
6326  PIXCopyEventArgument(destination, limit, a8);
6327  PIXCopyEventArgument(destination, limit, a9);
6328  PIXCopyEventArgument(destination, limit, a10);
6329  PIXCopyEventArgument(destination, limit, a11);
6330  PIXCopyEventArgument(destination, limit, a12);
6331  PIXCopyEventArgument(destination, limit, a13);
6332  PIXCopyEventArgument(destination, limit, a14);
6333 
6334  *destination = PIXEventsBlockEndMarker;
6335  threadInfo->destination = destination;
6336  }
6337  }
6338 }
6339 
6340 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
6341 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
6342 {
6343  UINT64 time = PIXEventsReplaceBlock(false);
6344  if (time)
6345  {
6346  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6347  UINT64* destination = threadInfo->destination;
6348  UINT64* limit = threadInfo->limit;
6349  if (destination < limit)
6350  {
6351  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6352  *destination++ = color;
6353 
6354  PIXCopyEventArgument(destination, limit, context);
6355  PIXCopyEventArgument(destination, limit, formatString);
6356  PIXCopyEventArgument(destination, limit, a1);
6357  PIXCopyEventArgument(destination, limit, a2);
6358  PIXCopyEventArgument(destination, limit, a3);
6359  PIXCopyEventArgument(destination, limit, a4);
6360  PIXCopyEventArgument(destination, limit, a5);
6361  PIXCopyEventArgument(destination, limit, a6);
6362  PIXCopyEventArgument(destination, limit, a7);
6363  PIXCopyEventArgument(destination, limit, a8);
6364  PIXCopyEventArgument(destination, limit, a9);
6365  PIXCopyEventArgument(destination, limit, a10);
6366  PIXCopyEventArgument(destination, limit, a11);
6367  PIXCopyEventArgument(destination, limit, a12);
6368  PIXCopyEventArgument(destination, limit, a13);
6369  PIXCopyEventArgument(destination, limit, a14);
6370  PIXCopyEventArgument(destination, limit, a15);
6371 
6372  *destination = PIXEventsBlockEndMarker;
6373  threadInfo->destination = destination;
6374  }
6375  }
6376 }
6377 
6378 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
6379 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
6380 {
6381  UINT64 time = PIXEventsReplaceBlock(false);
6382  if (time)
6383  {
6384  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6385  UINT64* destination = threadInfo->destination;
6386  UINT64* limit = threadInfo->limit;
6387  if (destination < limit)
6388  {
6389  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6390  *destination++ = color;
6391 
6392  PIXCopyEventArgument(destination, limit, context);
6393  PIXCopyEventArgument(destination, limit, formatString);
6394  PIXCopyEventArgument(destination, limit, a1);
6395  PIXCopyEventArgument(destination, limit, a2);
6396  PIXCopyEventArgument(destination, limit, a3);
6397  PIXCopyEventArgument(destination, limit, a4);
6398  PIXCopyEventArgument(destination, limit, a5);
6399  PIXCopyEventArgument(destination, limit, a6);
6400  PIXCopyEventArgument(destination, limit, a7);
6401  PIXCopyEventArgument(destination, limit, a8);
6402  PIXCopyEventArgument(destination, limit, a9);
6403  PIXCopyEventArgument(destination, limit, a10);
6404  PIXCopyEventArgument(destination, limit, a11);
6405  PIXCopyEventArgument(destination, limit, a12);
6406  PIXCopyEventArgument(destination, limit, a13);
6407  PIXCopyEventArgument(destination, limit, a14);
6408  PIXCopyEventArgument(destination, limit, a15);
6409  PIXCopyEventArgument(destination, limit, a16);
6410 
6411  *destination = PIXEventsBlockEndMarker;
6412  threadInfo->destination = destination;
6413  }
6414  }
6415 }
6416 
6417 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString)
6418 {
6419  UINT64 time = PIXEventsReplaceBlock(false);
6420  if (time)
6421  {
6422  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6423  UINT64* destination = threadInfo->destination;
6424  UINT64* limit = threadInfo->limit;
6425  if (destination < limit)
6426  {
6427  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_NoArgs);
6428  *destination++ = color;
6429 
6430  PIXCopyEventArgument(destination, limit, context);
6431  PIXCopyEventArgument(destination, limit, formatString);
6432 
6433  *destination = PIXEventsBlockEndMarker;
6434  threadInfo->destination = destination;
6435  }
6436  }
6437 }
6438 
6439 template<class T1>
6440 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1)
6441 {
6442  UINT64 time = PIXEventsReplaceBlock(false);
6443  if (time)
6444  {
6445  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6446  UINT64* destination = threadInfo->destination;
6447  UINT64* limit = threadInfo->limit;
6448  if (destination < limit)
6449  {
6450  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6451  *destination++ = color;
6452 
6453  PIXCopyEventArgument(destination, limit, context);
6454  PIXCopyEventArgument(destination, limit, formatString);
6455  PIXCopyEventArgument(destination, limit, a1);
6456 
6457  *destination = PIXEventsBlockEndMarker;
6458  threadInfo->destination = destination;
6459  }
6460  }
6461 }
6462 
6463 template<class T1, class T2>
6464 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2)
6465 {
6466  UINT64 time = PIXEventsReplaceBlock(false);
6467  if (time)
6468  {
6469  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6470  UINT64* destination = threadInfo->destination;
6471  UINT64* limit = threadInfo->limit;
6472  if (destination < limit)
6473  {
6474  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6475  *destination++ = color;
6476 
6477  PIXCopyEventArgument(destination, limit, context);
6478  PIXCopyEventArgument(destination, limit, formatString);
6479  PIXCopyEventArgument(destination, limit, a1);
6480  PIXCopyEventArgument(destination, limit, a2);
6481 
6482  *destination = PIXEventsBlockEndMarker;
6483  threadInfo->destination = destination;
6484  }
6485  }
6486 }
6487 
6488 template<class T1, class T2, class T3>
6489 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
6490 {
6491  UINT64 time = PIXEventsReplaceBlock(false);
6492  if (time)
6493  {
6494  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6495  UINT64* destination = threadInfo->destination;
6496  UINT64* limit = threadInfo->limit;
6497  if (destination < limit)
6498  {
6499  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6500  *destination++ = color;
6501 
6502  PIXCopyEventArgument(destination, limit, context);
6503  PIXCopyEventArgument(destination, limit, formatString);
6504  PIXCopyEventArgument(destination, limit, a1);
6505  PIXCopyEventArgument(destination, limit, a2);
6506  PIXCopyEventArgument(destination, limit, a3);
6507 
6508  *destination = PIXEventsBlockEndMarker;
6509  threadInfo->destination = destination;
6510  }
6511  }
6512 }
6513 
6514 template<class T1, class T2, class T3, class T4>
6515 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
6516 {
6517  UINT64 time = PIXEventsReplaceBlock(false);
6518  if (time)
6519  {
6520  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6521  UINT64* destination = threadInfo->destination;
6522  UINT64* limit = threadInfo->limit;
6523  if (destination < limit)
6524  {
6525  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6526  *destination++ = color;
6527 
6528  PIXCopyEventArgument(destination, limit, context);
6529  PIXCopyEventArgument(destination, limit, formatString);
6530  PIXCopyEventArgument(destination, limit, a1);
6531  PIXCopyEventArgument(destination, limit, a2);
6532  PIXCopyEventArgument(destination, limit, a3);
6533  PIXCopyEventArgument(destination, limit, a4);
6534 
6535  *destination = PIXEventsBlockEndMarker;
6536  threadInfo->destination = destination;
6537  }
6538  }
6539 }
6540 
6541 template<class T1, class T2, class T3, class T4, class T5>
6542 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
6543 {
6544  UINT64 time = PIXEventsReplaceBlock(false);
6545  if (time)
6546  {
6547  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6548  UINT64* destination = threadInfo->destination;
6549  UINT64* limit = threadInfo->limit;
6550  if (destination < limit)
6551  {
6552  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6553  *destination++ = color;
6554 
6555  PIXCopyEventArgument(destination, limit, context);
6556  PIXCopyEventArgument(destination, limit, formatString);
6557  PIXCopyEventArgument(destination, limit, a1);
6558  PIXCopyEventArgument(destination, limit, a2);
6559  PIXCopyEventArgument(destination, limit, a3);
6560  PIXCopyEventArgument(destination, limit, a4);
6561  PIXCopyEventArgument(destination, limit, a5);
6562 
6563  *destination = PIXEventsBlockEndMarker;
6564  threadInfo->destination = destination;
6565  }
6566  }
6567 }
6568 
6569 template<class T1, class T2, class T3, class T4, class T5, class T6>
6570 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
6571 {
6572  UINT64 time = PIXEventsReplaceBlock(false);
6573  if (time)
6574  {
6575  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6576  UINT64* destination = threadInfo->destination;
6577  UINT64* limit = threadInfo->limit;
6578  if (destination < limit)
6579  {
6580  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6581  *destination++ = color;
6582 
6583  PIXCopyEventArgument(destination, limit, context);
6584  PIXCopyEventArgument(destination, limit, formatString);
6585  PIXCopyEventArgument(destination, limit, a1);
6586  PIXCopyEventArgument(destination, limit, a2);
6587  PIXCopyEventArgument(destination, limit, a3);
6588  PIXCopyEventArgument(destination, limit, a4);
6589  PIXCopyEventArgument(destination, limit, a5);
6590  PIXCopyEventArgument(destination, limit, a6);
6591 
6592  *destination = PIXEventsBlockEndMarker;
6593  threadInfo->destination = destination;
6594  }
6595  }
6596 }
6597 
6598 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
6599 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
6600 {
6601  UINT64 time = PIXEventsReplaceBlock(false);
6602  if (time)
6603  {
6604  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6605  UINT64* destination = threadInfo->destination;
6606  UINT64* limit = threadInfo->limit;
6607  if (destination < limit)
6608  {
6609  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6610  *destination++ = color;
6611 
6612  PIXCopyEventArgument(destination, limit, context);
6613  PIXCopyEventArgument(destination, limit, formatString);
6614  PIXCopyEventArgument(destination, limit, a1);
6615  PIXCopyEventArgument(destination, limit, a2);
6616  PIXCopyEventArgument(destination, limit, a3);
6617  PIXCopyEventArgument(destination, limit, a4);
6618  PIXCopyEventArgument(destination, limit, a5);
6619  PIXCopyEventArgument(destination, limit, a6);
6620  PIXCopyEventArgument(destination, limit, a7);
6621 
6622  *destination = PIXEventsBlockEndMarker;
6623  threadInfo->destination = destination;
6624  }
6625  }
6626 }
6627 
6628 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
6629 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
6630 {
6631  UINT64 time = PIXEventsReplaceBlock(false);
6632  if (time)
6633  {
6634  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6635  UINT64* destination = threadInfo->destination;
6636  UINT64* limit = threadInfo->limit;
6637  if (destination < limit)
6638  {
6639  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6640  *destination++ = color;
6641 
6642  PIXCopyEventArgument(destination, limit, context);
6643  PIXCopyEventArgument(destination, limit, formatString);
6644  PIXCopyEventArgument(destination, limit, a1);
6645  PIXCopyEventArgument(destination, limit, a2);
6646  PIXCopyEventArgument(destination, limit, a3);
6647  PIXCopyEventArgument(destination, limit, a4);
6648  PIXCopyEventArgument(destination, limit, a5);
6649  PIXCopyEventArgument(destination, limit, a6);
6650  PIXCopyEventArgument(destination, limit, a7);
6651  PIXCopyEventArgument(destination, limit, a8);
6652 
6653  *destination = PIXEventsBlockEndMarker;
6654  threadInfo->destination = destination;
6655  }
6656  }
6657 }
6658 
6659 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
6660 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
6661 {
6662  UINT64 time = PIXEventsReplaceBlock(false);
6663  if (time)
6664  {
6665  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6666  UINT64* destination = threadInfo->destination;
6667  UINT64* limit = threadInfo->limit;
6668  if (destination < limit)
6669  {
6670  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6671  *destination++ = color;
6672 
6673  PIXCopyEventArgument(destination, limit, context);
6674  PIXCopyEventArgument(destination, limit, formatString);
6675  PIXCopyEventArgument(destination, limit, a1);
6676  PIXCopyEventArgument(destination, limit, a2);
6677  PIXCopyEventArgument(destination, limit, a3);
6678  PIXCopyEventArgument(destination, limit, a4);
6679  PIXCopyEventArgument(destination, limit, a5);
6680  PIXCopyEventArgument(destination, limit, a6);
6681  PIXCopyEventArgument(destination, limit, a7);
6682  PIXCopyEventArgument(destination, limit, a8);
6683  PIXCopyEventArgument(destination, limit, a9);
6684 
6685  *destination = PIXEventsBlockEndMarker;
6686  threadInfo->destination = destination;
6687  }
6688  }
6689 }
6690 
6691 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
6692 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
6693 {
6694  UINT64 time = PIXEventsReplaceBlock(false);
6695  if (time)
6696  {
6697  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6698  UINT64* destination = threadInfo->destination;
6699  UINT64* limit = threadInfo->limit;
6700  if (destination < limit)
6701  {
6702  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6703  *destination++ = color;
6704 
6705  PIXCopyEventArgument(destination, limit, context);
6706  PIXCopyEventArgument(destination, limit, formatString);
6707  PIXCopyEventArgument(destination, limit, a1);
6708  PIXCopyEventArgument(destination, limit, a2);
6709  PIXCopyEventArgument(destination, limit, a3);
6710  PIXCopyEventArgument(destination, limit, a4);
6711  PIXCopyEventArgument(destination, limit, a5);
6712  PIXCopyEventArgument(destination, limit, a6);
6713  PIXCopyEventArgument(destination, limit, a7);
6714  PIXCopyEventArgument(destination, limit, a8);
6715  PIXCopyEventArgument(destination, limit, a9);
6716  PIXCopyEventArgument(destination, limit, a10);
6717 
6718  *destination = PIXEventsBlockEndMarker;
6719  threadInfo->destination = destination;
6720  }
6721  }
6722 }
6723 
6724 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
6725 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
6726 {
6727  UINT64 time = PIXEventsReplaceBlock(false);
6728  if (time)
6729  {
6730  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6731  UINT64* destination = threadInfo->destination;
6732  UINT64* limit = threadInfo->limit;
6733  if (destination < limit)
6734  {
6735  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6736  *destination++ = color;
6737 
6738  PIXCopyEventArgument(destination, limit, context);
6739  PIXCopyEventArgument(destination, limit, formatString);
6740  PIXCopyEventArgument(destination, limit, a1);
6741  PIXCopyEventArgument(destination, limit, a2);
6742  PIXCopyEventArgument(destination, limit, a3);
6743  PIXCopyEventArgument(destination, limit, a4);
6744  PIXCopyEventArgument(destination, limit, a5);
6745  PIXCopyEventArgument(destination, limit, a6);
6746  PIXCopyEventArgument(destination, limit, a7);
6747  PIXCopyEventArgument(destination, limit, a8);
6748  PIXCopyEventArgument(destination, limit, a9);
6749  PIXCopyEventArgument(destination, limit, a10);
6750  PIXCopyEventArgument(destination, limit, a11);
6751 
6752  *destination = PIXEventsBlockEndMarker;
6753  threadInfo->destination = destination;
6754  }
6755  }
6756 }
6757 
6758 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
6759 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
6760 {
6761  UINT64 time = PIXEventsReplaceBlock(false);
6762  if (time)
6763  {
6764  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6765  UINT64* destination = threadInfo->destination;
6766  UINT64* limit = threadInfo->limit;
6767  if (destination < limit)
6768  {
6769  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6770  *destination++ = color;
6771 
6772  PIXCopyEventArgument(destination, limit, context);
6773  PIXCopyEventArgument(destination, limit, formatString);
6774  PIXCopyEventArgument(destination, limit, a1);
6775  PIXCopyEventArgument(destination, limit, a2);
6776  PIXCopyEventArgument(destination, limit, a3);
6777  PIXCopyEventArgument(destination, limit, a4);
6778  PIXCopyEventArgument(destination, limit, a5);
6779  PIXCopyEventArgument(destination, limit, a6);
6780  PIXCopyEventArgument(destination, limit, a7);
6781  PIXCopyEventArgument(destination, limit, a8);
6782  PIXCopyEventArgument(destination, limit, a9);
6783  PIXCopyEventArgument(destination, limit, a10);
6784  PIXCopyEventArgument(destination, limit, a11);
6785  PIXCopyEventArgument(destination, limit, a12);
6786 
6787  *destination = PIXEventsBlockEndMarker;
6788  threadInfo->destination = destination;
6789  }
6790  }
6791 }
6792 
6793 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
6794 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
6795 {
6796  UINT64 time = PIXEventsReplaceBlock(false);
6797  if (time)
6798  {
6799  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6800  UINT64* destination = threadInfo->destination;
6801  UINT64* limit = threadInfo->limit;
6802  if (destination < limit)
6803  {
6804  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6805  *destination++ = color;
6806 
6807  PIXCopyEventArgument(destination, limit, context);
6808  PIXCopyEventArgument(destination, limit, formatString);
6809  PIXCopyEventArgument(destination, limit, a1);
6810  PIXCopyEventArgument(destination, limit, a2);
6811  PIXCopyEventArgument(destination, limit, a3);
6812  PIXCopyEventArgument(destination, limit, a4);
6813  PIXCopyEventArgument(destination, limit, a5);
6814  PIXCopyEventArgument(destination, limit, a6);
6815  PIXCopyEventArgument(destination, limit, a7);
6816  PIXCopyEventArgument(destination, limit, a8);
6817  PIXCopyEventArgument(destination, limit, a9);
6818  PIXCopyEventArgument(destination, limit, a10);
6819  PIXCopyEventArgument(destination, limit, a11);
6820  PIXCopyEventArgument(destination, limit, a12);
6821  PIXCopyEventArgument(destination, limit, a13);
6822 
6823  *destination = PIXEventsBlockEndMarker;
6824  threadInfo->destination = destination;
6825  }
6826  }
6827 }
6828 
6829 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
6830 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
6831 {
6832  UINT64 time = PIXEventsReplaceBlock(false);
6833  if (time)
6834  {
6835  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6836  UINT64* destination = threadInfo->destination;
6837  UINT64* limit = threadInfo->limit;
6838  if (destination < limit)
6839  {
6840  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6841  *destination++ = color;
6842 
6843  PIXCopyEventArgument(destination, limit, context);
6844  PIXCopyEventArgument(destination, limit, formatString);
6845  PIXCopyEventArgument(destination, limit, a1);
6846  PIXCopyEventArgument(destination, limit, a2);
6847  PIXCopyEventArgument(destination, limit, a3);
6848  PIXCopyEventArgument(destination, limit, a4);
6849  PIXCopyEventArgument(destination, limit, a5);
6850  PIXCopyEventArgument(destination, limit, a6);
6851  PIXCopyEventArgument(destination, limit, a7);
6852  PIXCopyEventArgument(destination, limit, a8);
6853  PIXCopyEventArgument(destination, limit, a9);
6854  PIXCopyEventArgument(destination, limit, a10);
6855  PIXCopyEventArgument(destination, limit, a11);
6856  PIXCopyEventArgument(destination, limit, a12);
6857  PIXCopyEventArgument(destination, limit, a13);
6858  PIXCopyEventArgument(destination, limit, a14);
6859 
6860  *destination = PIXEventsBlockEndMarker;
6861  threadInfo->destination = destination;
6862  }
6863  }
6864 }
6865 
6866 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
6867 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
6868 {
6869  UINT64 time = PIXEventsReplaceBlock(false);
6870  if (time)
6871  {
6872  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6873  UINT64* destination = threadInfo->destination;
6874  UINT64* limit = threadInfo->limit;
6875  if (destination < limit)
6876  {
6877  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6878  *destination++ = color;
6879 
6880  PIXCopyEventArgument(destination, limit, context);
6881  PIXCopyEventArgument(destination, limit, formatString);
6882  PIXCopyEventArgument(destination, limit, a1);
6883  PIXCopyEventArgument(destination, limit, a2);
6884  PIXCopyEventArgument(destination, limit, a3);
6885  PIXCopyEventArgument(destination, limit, a4);
6886  PIXCopyEventArgument(destination, limit, a5);
6887  PIXCopyEventArgument(destination, limit, a6);
6888  PIXCopyEventArgument(destination, limit, a7);
6889  PIXCopyEventArgument(destination, limit, a8);
6890  PIXCopyEventArgument(destination, limit, a9);
6891  PIXCopyEventArgument(destination, limit, a10);
6892  PIXCopyEventArgument(destination, limit, a11);
6893  PIXCopyEventArgument(destination, limit, a12);
6894  PIXCopyEventArgument(destination, limit, a13);
6895  PIXCopyEventArgument(destination, limit, a14);
6896  PIXCopyEventArgument(destination, limit, a15);
6897 
6898  *destination = PIXEventsBlockEndMarker;
6899  threadInfo->destination = destination;
6900  }
6901  }
6902 }
6903 
6904 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
6905 __declspec(noinline) inline void MakeCPUSetMarkerForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
6906 {
6907  UINT64 time = PIXEventsReplaceBlock(false);
6908  if (time)
6909  {
6910  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6911  UINT64* destination = threadInfo->destination;
6912  UINT64* limit = threadInfo->limit;
6913  if (destination < limit)
6914  {
6915  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6916  *destination++ = color;
6917 
6918  PIXCopyEventArgument(destination, limit, context);
6919  PIXCopyEventArgument(destination, limit, formatString);
6920  PIXCopyEventArgument(destination, limit, a1);
6921  PIXCopyEventArgument(destination, limit, a2);
6922  PIXCopyEventArgument(destination, limit, a3);
6923  PIXCopyEventArgument(destination, limit, a4);
6924  PIXCopyEventArgument(destination, limit, a5);
6925  PIXCopyEventArgument(destination, limit, a6);
6926  PIXCopyEventArgument(destination, limit, a7);
6927  PIXCopyEventArgument(destination, limit, a8);
6928  PIXCopyEventArgument(destination, limit, a9);
6929  PIXCopyEventArgument(destination, limit, a10);
6930  PIXCopyEventArgument(destination, limit, a11);
6931  PIXCopyEventArgument(destination, limit, a12);
6932  PIXCopyEventArgument(destination, limit, a13);
6933  PIXCopyEventArgument(destination, limit, a14);
6934  PIXCopyEventArgument(destination, limit, a15);
6935  PIXCopyEventArgument(destination, limit, a16);
6936 
6937  *destination = PIXEventsBlockEndMarker;
6938  threadInfo->destination = destination;
6939  }
6940  }
6941 }
6942 
6943 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString)
6944 {
6945  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6946  UINT64* destination = threadInfo->destination;
6947  UINT64* limit = threadInfo->biasedLimit;
6948  if (destination < limit)
6949  {
6950  limit += PIXEventsSafeFastCopySpaceQwords;
6951  UINT64 time = PIXGetTimestampCounter();
6952  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_NoArgs);
6953  *destination++ = color;
6954 
6955  PIXCopyEventArgument(destination, limit, context);
6956  PIXCopyEventArgument(destination, limit, formatString);
6957 
6958  *destination = PIXEventsBlockEndMarker;
6959  threadInfo->destination = destination;
6960  }
6961  else if (limit != nullptr)
6962  {
6963  MakeCPUSetMarkerForContextAllocate(color, context, formatString);
6964  }
6965 }
6966 
6967 template<class T1>
6968 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1)
6969 {
6970  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6971  UINT64* destination = threadInfo->destination;
6972  UINT64* limit = threadInfo->biasedLimit;
6973  if (destination < limit)
6974  {
6975  limit += PIXEventsSafeFastCopySpaceQwords;
6976  UINT64 time = PIXGetTimestampCounter();
6977  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
6978  *destination++ = color;
6979 
6980  PIXCopyEventArgument(destination, limit, context);
6981  PIXCopyEventArgument(destination, limit, formatString);
6982  PIXCopyEventArgument(destination, limit, a1);
6983 
6984  *destination = PIXEventsBlockEndMarker;
6985  threadInfo->destination = destination;
6986  }
6987  else if (limit != nullptr)
6988  {
6989  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1);
6990  }
6991 }
6992 
6993 template<class T1, class T2>
6994 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2)
6995 {
6996  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
6997  UINT64* destination = threadInfo->destination;
6998  UINT64* limit = threadInfo->biasedLimit;
6999  if (destination < limit)
7000  {
7001  limit += PIXEventsSafeFastCopySpaceQwords;
7002  UINT64 time = PIXGetTimestampCounter();
7003  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7004  *destination++ = color;
7005 
7006  PIXCopyEventArgument(destination, limit, context);
7007  PIXCopyEventArgument(destination, limit, formatString);
7008  PIXCopyEventArgument(destination, limit, a1);
7009  PIXCopyEventArgument(destination, limit, a2);
7010 
7011  *destination = PIXEventsBlockEndMarker;
7012  threadInfo->destination = destination;
7013  }
7014  else if (limit != nullptr)
7015  {
7016  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2);
7017  }
7018 }
7019 
7020 template<class T1, class T2, class T3>
7021 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
7022 {
7023  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7024  UINT64* destination = threadInfo->destination;
7025  UINT64* limit = threadInfo->biasedLimit;
7026  if (destination < limit)
7027  {
7028  limit += PIXEventsSafeFastCopySpaceQwords;
7029  UINT64 time = PIXGetTimestampCounter();
7030  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7031  *destination++ = color;
7032 
7033  PIXCopyEventArgument(destination, limit, context);
7034  PIXCopyEventArgument(destination, limit, formatString);
7035  PIXCopyEventArgument(destination, limit, a1);
7036  PIXCopyEventArgument(destination, limit, a2);
7037  PIXCopyEventArgument(destination, limit, a3);
7038 
7039  *destination = PIXEventsBlockEndMarker;
7040  threadInfo->destination = destination;
7041  }
7042  else if (limit != nullptr)
7043  {
7044  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3);
7045  }
7046 }
7047 
7048 template<class T1, class T2, class T3, class T4>
7049 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
7050 {
7051  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7052  UINT64* destination = threadInfo->destination;
7053  UINT64* limit = threadInfo->biasedLimit;
7054  if (destination < limit)
7055  {
7056  limit += PIXEventsSafeFastCopySpaceQwords;
7057  UINT64 time = PIXGetTimestampCounter();
7058  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7059  *destination++ = color;
7060 
7061  PIXCopyEventArgument(destination, limit, context);
7062  PIXCopyEventArgument(destination, limit, formatString);
7063  PIXCopyEventArgument(destination, limit, a1);
7064  PIXCopyEventArgument(destination, limit, a2);
7065  PIXCopyEventArgument(destination, limit, a3);
7066  PIXCopyEventArgument(destination, limit, a4);
7067 
7068  *destination = PIXEventsBlockEndMarker;
7069  threadInfo->destination = destination;
7070  }
7071  else if (limit != nullptr)
7072  {
7073  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4);
7074  }
7075 }
7076 
7077 template<class T1, class T2, class T3, class T4, class T5>
7078 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
7079 {
7080  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7081  UINT64* destination = threadInfo->destination;
7082  UINT64* limit = threadInfo->biasedLimit;
7083  if (destination < limit)
7084  {
7085  limit += PIXEventsSafeFastCopySpaceQwords;
7086  UINT64 time = PIXGetTimestampCounter();
7087  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7088  *destination++ = color;
7089 
7090  PIXCopyEventArgument(destination, limit, context);
7091  PIXCopyEventArgument(destination, limit, formatString);
7092  PIXCopyEventArgument(destination, limit, a1);
7093  PIXCopyEventArgument(destination, limit, a2);
7094  PIXCopyEventArgument(destination, limit, a3);
7095  PIXCopyEventArgument(destination, limit, a4);
7096  PIXCopyEventArgument(destination, limit, a5);
7097 
7098  *destination = PIXEventsBlockEndMarker;
7099  threadInfo->destination = destination;
7100  }
7101  else if (limit != nullptr)
7102  {
7103  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5);
7104  }
7105 }
7106 
7107 template<class T1, class T2, class T3, class T4, class T5, class T6>
7108 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
7109 {
7110  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7111  UINT64* destination = threadInfo->destination;
7112  UINT64* limit = threadInfo->biasedLimit;
7113  if (destination < limit)
7114  {
7115  limit += PIXEventsSafeFastCopySpaceQwords;
7116  UINT64 time = PIXGetTimestampCounter();
7117  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7118  *destination++ = color;
7119 
7120  PIXCopyEventArgument(destination, limit, context);
7121  PIXCopyEventArgument(destination, limit, formatString);
7122  PIXCopyEventArgument(destination, limit, a1);
7123  PIXCopyEventArgument(destination, limit, a2);
7124  PIXCopyEventArgument(destination, limit, a3);
7125  PIXCopyEventArgument(destination, limit, a4);
7126  PIXCopyEventArgument(destination, limit, a5);
7127  PIXCopyEventArgument(destination, limit, a6);
7128 
7129  *destination = PIXEventsBlockEndMarker;
7130  threadInfo->destination = destination;
7131  }
7132  else if (limit != nullptr)
7133  {
7134  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6);
7135  }
7136 }
7137 
7138 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
7139 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
7140 {
7141  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7142  UINT64* destination = threadInfo->destination;
7143  UINT64* limit = threadInfo->biasedLimit;
7144  if (destination < limit)
7145  {
7146  limit += PIXEventsSafeFastCopySpaceQwords;
7147  UINT64 time = PIXGetTimestampCounter();
7148  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7149  *destination++ = color;
7150 
7151  PIXCopyEventArgument(destination, limit, context);
7152  PIXCopyEventArgument(destination, limit, formatString);
7153  PIXCopyEventArgument(destination, limit, a1);
7154  PIXCopyEventArgument(destination, limit, a2);
7155  PIXCopyEventArgument(destination, limit, a3);
7156  PIXCopyEventArgument(destination, limit, a4);
7157  PIXCopyEventArgument(destination, limit, a5);
7158  PIXCopyEventArgument(destination, limit, a6);
7159  PIXCopyEventArgument(destination, limit, a7);
7160 
7161  *destination = PIXEventsBlockEndMarker;
7162  threadInfo->destination = destination;
7163  }
7164  else if (limit != nullptr)
7165  {
7166  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7);
7167  }
7168 }
7169 
7170 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
7171 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
7172 {
7173  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7174  UINT64* destination = threadInfo->destination;
7175  UINT64* limit = threadInfo->biasedLimit;
7176  if (destination < limit)
7177  {
7178  limit += PIXEventsSafeFastCopySpaceQwords;
7179  UINT64 time = PIXGetTimestampCounter();
7180  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7181  *destination++ = color;
7182 
7183  PIXCopyEventArgument(destination, limit, context);
7184  PIXCopyEventArgument(destination, limit, formatString);
7185  PIXCopyEventArgument(destination, limit, a1);
7186  PIXCopyEventArgument(destination, limit, a2);
7187  PIXCopyEventArgument(destination, limit, a3);
7188  PIXCopyEventArgument(destination, limit, a4);
7189  PIXCopyEventArgument(destination, limit, a5);
7190  PIXCopyEventArgument(destination, limit, a6);
7191  PIXCopyEventArgument(destination, limit, a7);
7192  PIXCopyEventArgument(destination, limit, a8);
7193 
7194  *destination = PIXEventsBlockEndMarker;
7195  threadInfo->destination = destination;
7196  }
7197  else if (limit != nullptr)
7198  {
7199  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
7200  }
7201 }
7202 
7203 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
7204 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
7205 {
7206  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7207  UINT64* destination = threadInfo->destination;
7208  UINT64* limit = threadInfo->biasedLimit;
7209  if (destination < limit)
7210  {
7211  limit += PIXEventsSafeFastCopySpaceQwords;
7212  UINT64 time = PIXGetTimestampCounter();
7213  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7214  *destination++ = color;
7215 
7216  PIXCopyEventArgument(destination, limit, context);
7217  PIXCopyEventArgument(destination, limit, formatString);
7218  PIXCopyEventArgument(destination, limit, a1);
7219  PIXCopyEventArgument(destination, limit, a2);
7220  PIXCopyEventArgument(destination, limit, a3);
7221  PIXCopyEventArgument(destination, limit, a4);
7222  PIXCopyEventArgument(destination, limit, a5);
7223  PIXCopyEventArgument(destination, limit, a6);
7224  PIXCopyEventArgument(destination, limit, a7);
7225  PIXCopyEventArgument(destination, limit, a8);
7226  PIXCopyEventArgument(destination, limit, a9);
7227 
7228  *destination = PIXEventsBlockEndMarker;
7229  threadInfo->destination = destination;
7230  }
7231  else if (limit != nullptr)
7232  {
7233  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
7234  }
7235 }
7236 
7237 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
7238 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
7239 {
7240  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7241  UINT64* destination = threadInfo->destination;
7242  UINT64* limit = threadInfo->biasedLimit;
7243  if (destination < limit)
7244  {
7245  limit += PIXEventsSafeFastCopySpaceQwords;
7246  UINT64 time = PIXGetTimestampCounter();
7247  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7248  *destination++ = color;
7249 
7250  PIXCopyEventArgument(destination, limit, context);
7251  PIXCopyEventArgument(destination, limit, formatString);
7252  PIXCopyEventArgument(destination, limit, a1);
7253  PIXCopyEventArgument(destination, limit, a2);
7254  PIXCopyEventArgument(destination, limit, a3);
7255  PIXCopyEventArgument(destination, limit, a4);
7256  PIXCopyEventArgument(destination, limit, a5);
7257  PIXCopyEventArgument(destination, limit, a6);
7258  PIXCopyEventArgument(destination, limit, a7);
7259  PIXCopyEventArgument(destination, limit, a8);
7260  PIXCopyEventArgument(destination, limit, a9);
7261  PIXCopyEventArgument(destination, limit, a10);
7262 
7263  *destination = PIXEventsBlockEndMarker;
7264  threadInfo->destination = destination;
7265  }
7266  else if (limit != nullptr)
7267  {
7268  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
7269  }
7270 }
7271 
7272 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
7273 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
7274 {
7275  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7276  UINT64* destination = threadInfo->destination;
7277  UINT64* limit = threadInfo->biasedLimit;
7278  if (destination < limit)
7279  {
7280  limit += PIXEventsSafeFastCopySpaceQwords;
7281  UINT64 time = PIXGetTimestampCounter();
7282  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7283  *destination++ = color;
7284 
7285  PIXCopyEventArgument(destination, limit, context);
7286  PIXCopyEventArgument(destination, limit, formatString);
7287  PIXCopyEventArgument(destination, limit, a1);
7288  PIXCopyEventArgument(destination, limit, a2);
7289  PIXCopyEventArgument(destination, limit, a3);
7290  PIXCopyEventArgument(destination, limit, a4);
7291  PIXCopyEventArgument(destination, limit, a5);
7292  PIXCopyEventArgument(destination, limit, a6);
7293  PIXCopyEventArgument(destination, limit, a7);
7294  PIXCopyEventArgument(destination, limit, a8);
7295  PIXCopyEventArgument(destination, limit, a9);
7296  PIXCopyEventArgument(destination, limit, a10);
7297  PIXCopyEventArgument(destination, limit, a11);
7298 
7299  *destination = PIXEventsBlockEndMarker;
7300  threadInfo->destination = destination;
7301  }
7302  else if (limit != nullptr)
7303  {
7304  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
7305  }
7306 }
7307 
7308 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
7309 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
7310 {
7311  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7312  UINT64* destination = threadInfo->destination;
7313  UINT64* limit = threadInfo->biasedLimit;
7314  if (destination < limit)
7315  {
7316  limit += PIXEventsSafeFastCopySpaceQwords;
7317  UINT64 time = PIXGetTimestampCounter();
7318  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7319  *destination++ = color;
7320 
7321  PIXCopyEventArgument(destination, limit, context);
7322  PIXCopyEventArgument(destination, limit, formatString);
7323  PIXCopyEventArgument(destination, limit, a1);
7324  PIXCopyEventArgument(destination, limit, a2);
7325  PIXCopyEventArgument(destination, limit, a3);
7326  PIXCopyEventArgument(destination, limit, a4);
7327  PIXCopyEventArgument(destination, limit, a5);
7328  PIXCopyEventArgument(destination, limit, a6);
7329  PIXCopyEventArgument(destination, limit, a7);
7330  PIXCopyEventArgument(destination, limit, a8);
7331  PIXCopyEventArgument(destination, limit, a9);
7332  PIXCopyEventArgument(destination, limit, a10);
7333  PIXCopyEventArgument(destination, limit, a11);
7334  PIXCopyEventArgument(destination, limit, a12);
7335 
7336  *destination = PIXEventsBlockEndMarker;
7337  threadInfo->destination = destination;
7338  }
7339  else if (limit != nullptr)
7340  {
7341  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
7342  }
7343 }
7344 
7345 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
7346 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
7347 {
7348  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7349  UINT64* destination = threadInfo->destination;
7350  UINT64* limit = threadInfo->biasedLimit;
7351  if (destination < limit)
7352  {
7353  limit += PIXEventsSafeFastCopySpaceQwords;
7354  UINT64 time = PIXGetTimestampCounter();
7355  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7356  *destination++ = color;
7357 
7358  PIXCopyEventArgument(destination, limit, context);
7359  PIXCopyEventArgument(destination, limit, formatString);
7360  PIXCopyEventArgument(destination, limit, a1);
7361  PIXCopyEventArgument(destination, limit, a2);
7362  PIXCopyEventArgument(destination, limit, a3);
7363  PIXCopyEventArgument(destination, limit, a4);
7364  PIXCopyEventArgument(destination, limit, a5);
7365  PIXCopyEventArgument(destination, limit, a6);
7366  PIXCopyEventArgument(destination, limit, a7);
7367  PIXCopyEventArgument(destination, limit, a8);
7368  PIXCopyEventArgument(destination, limit, a9);
7369  PIXCopyEventArgument(destination, limit, a10);
7370  PIXCopyEventArgument(destination, limit, a11);
7371  PIXCopyEventArgument(destination, limit, a12);
7372  PIXCopyEventArgument(destination, limit, a13);
7373 
7374  *destination = PIXEventsBlockEndMarker;
7375  threadInfo->destination = destination;
7376  }
7377  else if (limit != nullptr)
7378  {
7379  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
7380  }
7381 }
7382 
7383 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
7384 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
7385 {
7386  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7387  UINT64* destination = threadInfo->destination;
7388  UINT64* limit = threadInfo->biasedLimit;
7389  if (destination < limit)
7390  {
7391  limit += PIXEventsSafeFastCopySpaceQwords;
7392  UINT64 time = PIXGetTimestampCounter();
7393  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7394  *destination++ = color;
7395 
7396  PIXCopyEventArgument(destination, limit, context);
7397  PIXCopyEventArgument(destination, limit, formatString);
7398  PIXCopyEventArgument(destination, limit, a1);
7399  PIXCopyEventArgument(destination, limit, a2);
7400  PIXCopyEventArgument(destination, limit, a3);
7401  PIXCopyEventArgument(destination, limit, a4);
7402  PIXCopyEventArgument(destination, limit, a5);
7403  PIXCopyEventArgument(destination, limit, a6);
7404  PIXCopyEventArgument(destination, limit, a7);
7405  PIXCopyEventArgument(destination, limit, a8);
7406  PIXCopyEventArgument(destination, limit, a9);
7407  PIXCopyEventArgument(destination, limit, a10);
7408  PIXCopyEventArgument(destination, limit, a11);
7409  PIXCopyEventArgument(destination, limit, a12);
7410  PIXCopyEventArgument(destination, limit, a13);
7411  PIXCopyEventArgument(destination, limit, a14);
7412 
7413  *destination = PIXEventsBlockEndMarker;
7414  threadInfo->destination = destination;
7415  }
7416  else if (limit != nullptr)
7417  {
7418  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
7419  }
7420 }
7421 
7422 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
7423 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
7424 {
7425  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7426  UINT64* destination = threadInfo->destination;
7427  UINT64* limit = threadInfo->biasedLimit;
7428  if (destination < limit)
7429  {
7430  limit += PIXEventsSafeFastCopySpaceQwords;
7431  UINT64 time = PIXGetTimestampCounter();
7432  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7433  *destination++ = color;
7434 
7435  PIXCopyEventArgument(destination, limit, context);
7436  PIXCopyEventArgument(destination, limit, formatString);
7437  PIXCopyEventArgument(destination, limit, a1);
7438  PIXCopyEventArgument(destination, limit, a2);
7439  PIXCopyEventArgument(destination, limit, a3);
7440  PIXCopyEventArgument(destination, limit, a4);
7441  PIXCopyEventArgument(destination, limit, a5);
7442  PIXCopyEventArgument(destination, limit, a6);
7443  PIXCopyEventArgument(destination, limit, a7);
7444  PIXCopyEventArgument(destination, limit, a8);
7445  PIXCopyEventArgument(destination, limit, a9);
7446  PIXCopyEventArgument(destination, limit, a10);
7447  PIXCopyEventArgument(destination, limit, a11);
7448  PIXCopyEventArgument(destination, limit, a12);
7449  PIXCopyEventArgument(destination, limit, a13);
7450  PIXCopyEventArgument(destination, limit, a14);
7451  PIXCopyEventArgument(destination, limit, a15);
7452 
7453  *destination = PIXEventsBlockEndMarker;
7454  threadInfo->destination = destination;
7455  }
7456  else if (limit != nullptr)
7457  {
7458  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
7459  }
7460 }
7461 
7462 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
7463 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
7464 {
7465  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7466  UINT64* destination = threadInfo->destination;
7467  UINT64* limit = threadInfo->biasedLimit;
7468  if (destination < limit)
7469  {
7470  limit += PIXEventsSafeFastCopySpaceQwords;
7471  UINT64 time = PIXGetTimestampCounter();
7472  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7473  *destination++ = color;
7474 
7475  PIXCopyEventArgument(destination, limit, context);
7476  PIXCopyEventArgument(destination, limit, formatString);
7477  PIXCopyEventArgument(destination, limit, a1);
7478  PIXCopyEventArgument(destination, limit, a2);
7479  PIXCopyEventArgument(destination, limit, a3);
7480  PIXCopyEventArgument(destination, limit, a4);
7481  PIXCopyEventArgument(destination, limit, a5);
7482  PIXCopyEventArgument(destination, limit, a6);
7483  PIXCopyEventArgument(destination, limit, a7);
7484  PIXCopyEventArgument(destination, limit, a8);
7485  PIXCopyEventArgument(destination, limit, a9);
7486  PIXCopyEventArgument(destination, limit, a10);
7487  PIXCopyEventArgument(destination, limit, a11);
7488  PIXCopyEventArgument(destination, limit, a12);
7489  PIXCopyEventArgument(destination, limit, a13);
7490  PIXCopyEventArgument(destination, limit, a14);
7491  PIXCopyEventArgument(destination, limit, a15);
7492  PIXCopyEventArgument(destination, limit, a16);
7493 
7494  *destination = PIXEventsBlockEndMarker;
7495  threadInfo->destination = destination;
7496  }
7497  else if (limit != nullptr)
7498  {
7499  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
7500  }
7501 }
7502 
7503 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString)
7504 {
7505  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7506  UINT64* destination = threadInfo->destination;
7507  UINT64* limit = threadInfo->biasedLimit;
7508  if (destination < limit)
7509  {
7510  limit += PIXEventsSafeFastCopySpaceQwords;
7511  UINT64 time = PIXGetTimestampCounter();
7512  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_NoArgs);
7513  *destination++ = color;
7514 
7515  PIXCopyEventArgument(destination, limit, context);
7516  PIXCopyEventArgument(destination, limit, formatString);
7517 
7518  *destination = PIXEventsBlockEndMarker;
7519  threadInfo->destination = destination;
7520  }
7521  else if (limit != nullptr)
7522  {
7523  MakeCPUSetMarkerForContextAllocate(color, context, formatString);
7524  }
7525 }
7526 
7527 template<class T1>
7528 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1)
7529 {
7530  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7531  UINT64* destination = threadInfo->destination;
7532  UINT64* limit = threadInfo->biasedLimit;
7533  if (destination < limit)
7534  {
7535  limit += PIXEventsSafeFastCopySpaceQwords;
7536  UINT64 time = PIXGetTimestampCounter();
7537  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7538  *destination++ = color;
7539 
7540  PIXCopyEventArgument(destination, limit, context);
7541  PIXCopyEventArgument(destination, limit, formatString);
7542  PIXCopyEventArgument(destination, limit, a1);
7543 
7544  *destination = PIXEventsBlockEndMarker;
7545  threadInfo->destination = destination;
7546  }
7547  else if (limit != nullptr)
7548  {
7549  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1);
7550  }
7551 }
7552 
7553 template<class T1, class T2>
7554 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2)
7555 {
7556  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7557  UINT64* destination = threadInfo->destination;
7558  UINT64* limit = threadInfo->biasedLimit;
7559  if (destination < limit)
7560  {
7561  limit += PIXEventsSafeFastCopySpaceQwords;
7562  UINT64 time = PIXGetTimestampCounter();
7563  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7564  *destination++ = color;
7565 
7566  PIXCopyEventArgument(destination, limit, context);
7567  PIXCopyEventArgument(destination, limit, formatString);
7568  PIXCopyEventArgument(destination, limit, a1);
7569  PIXCopyEventArgument(destination, limit, a2);
7570 
7571  *destination = PIXEventsBlockEndMarker;
7572  threadInfo->destination = destination;
7573  }
7574  else if (limit != nullptr)
7575  {
7576  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2);
7577  }
7578 }
7579 
7580 template<class T1, class T2, class T3>
7581 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
7582 {
7583  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7584  UINT64* destination = threadInfo->destination;
7585  UINT64* limit = threadInfo->biasedLimit;
7586  if (destination < limit)
7587  {
7588  limit += PIXEventsSafeFastCopySpaceQwords;
7589  UINT64 time = PIXGetTimestampCounter();
7590  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7591  *destination++ = color;
7592 
7593  PIXCopyEventArgument(destination, limit, context);
7594  PIXCopyEventArgument(destination, limit, formatString);
7595  PIXCopyEventArgument(destination, limit, a1);
7596  PIXCopyEventArgument(destination, limit, a2);
7597  PIXCopyEventArgument(destination, limit, a3);
7598 
7599  *destination = PIXEventsBlockEndMarker;
7600  threadInfo->destination = destination;
7601  }
7602  else if (limit != nullptr)
7603  {
7604  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3);
7605  }
7606 }
7607 
7608 template<class T1, class T2, class T3, class T4>
7609 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
7610 {
7611  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7612  UINT64* destination = threadInfo->destination;
7613  UINT64* limit = threadInfo->biasedLimit;
7614  if (destination < limit)
7615  {
7616  limit += PIXEventsSafeFastCopySpaceQwords;
7617  UINT64 time = PIXGetTimestampCounter();
7618  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7619  *destination++ = color;
7620 
7621  PIXCopyEventArgument(destination, limit, context);
7622  PIXCopyEventArgument(destination, limit, formatString);
7623  PIXCopyEventArgument(destination, limit, a1);
7624  PIXCopyEventArgument(destination, limit, a2);
7625  PIXCopyEventArgument(destination, limit, a3);
7626  PIXCopyEventArgument(destination, limit, a4);
7627 
7628  *destination = PIXEventsBlockEndMarker;
7629  threadInfo->destination = destination;
7630  }
7631  else if (limit != nullptr)
7632  {
7633  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4);
7634  }
7635 }
7636 
7637 template<class T1, class T2, class T3, class T4, class T5>
7638 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
7639 {
7640  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7641  UINT64* destination = threadInfo->destination;
7642  UINT64* limit = threadInfo->biasedLimit;
7643  if (destination < limit)
7644  {
7645  limit += PIXEventsSafeFastCopySpaceQwords;
7646  UINT64 time = PIXGetTimestampCounter();
7647  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7648  *destination++ = color;
7649 
7650  PIXCopyEventArgument(destination, limit, context);
7651  PIXCopyEventArgument(destination, limit, formatString);
7652  PIXCopyEventArgument(destination, limit, a1);
7653  PIXCopyEventArgument(destination, limit, a2);
7654  PIXCopyEventArgument(destination, limit, a3);
7655  PIXCopyEventArgument(destination, limit, a4);
7656  PIXCopyEventArgument(destination, limit, a5);
7657 
7658  *destination = PIXEventsBlockEndMarker;
7659  threadInfo->destination = destination;
7660  }
7661  else if (limit != nullptr)
7662  {
7663  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5);
7664  }
7665 }
7666 
7667 template<class T1, class T2, class T3, class T4, class T5, class T6>
7668 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
7669 {
7670  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7671  UINT64* destination = threadInfo->destination;
7672  UINT64* limit = threadInfo->biasedLimit;
7673  if (destination < limit)
7674  {
7675  limit += PIXEventsSafeFastCopySpaceQwords;
7676  UINT64 time = PIXGetTimestampCounter();
7677  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7678  *destination++ = color;
7679 
7680  PIXCopyEventArgument(destination, limit, context);
7681  PIXCopyEventArgument(destination, limit, formatString);
7682  PIXCopyEventArgument(destination, limit, a1);
7683  PIXCopyEventArgument(destination, limit, a2);
7684  PIXCopyEventArgument(destination, limit, a3);
7685  PIXCopyEventArgument(destination, limit, a4);
7686  PIXCopyEventArgument(destination, limit, a5);
7687  PIXCopyEventArgument(destination, limit, a6);
7688 
7689  *destination = PIXEventsBlockEndMarker;
7690  threadInfo->destination = destination;
7691  }
7692  else if (limit != nullptr)
7693  {
7694  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6);
7695  }
7696 }
7697 
7698 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
7699 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
7700 {
7701  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7702  UINT64* destination = threadInfo->destination;
7703  UINT64* limit = threadInfo->biasedLimit;
7704  if (destination < limit)
7705  {
7706  limit += PIXEventsSafeFastCopySpaceQwords;
7707  UINT64 time = PIXGetTimestampCounter();
7708  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7709  *destination++ = color;
7710 
7711  PIXCopyEventArgument(destination, limit, context);
7712  PIXCopyEventArgument(destination, limit, formatString);
7713  PIXCopyEventArgument(destination, limit, a1);
7714  PIXCopyEventArgument(destination, limit, a2);
7715  PIXCopyEventArgument(destination, limit, a3);
7716  PIXCopyEventArgument(destination, limit, a4);
7717  PIXCopyEventArgument(destination, limit, a5);
7718  PIXCopyEventArgument(destination, limit, a6);
7719  PIXCopyEventArgument(destination, limit, a7);
7720 
7721  *destination = PIXEventsBlockEndMarker;
7722  threadInfo->destination = destination;
7723  }
7724  else if (limit != nullptr)
7725  {
7726  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7);
7727  }
7728 }
7729 
7730 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
7731 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
7732 {
7733  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7734  UINT64* destination = threadInfo->destination;
7735  UINT64* limit = threadInfo->biasedLimit;
7736  if (destination < limit)
7737  {
7738  limit += PIXEventsSafeFastCopySpaceQwords;
7739  UINT64 time = PIXGetTimestampCounter();
7740  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7741  *destination++ = color;
7742 
7743  PIXCopyEventArgument(destination, limit, context);
7744  PIXCopyEventArgument(destination, limit, formatString);
7745  PIXCopyEventArgument(destination, limit, a1);
7746  PIXCopyEventArgument(destination, limit, a2);
7747  PIXCopyEventArgument(destination, limit, a3);
7748  PIXCopyEventArgument(destination, limit, a4);
7749  PIXCopyEventArgument(destination, limit, a5);
7750  PIXCopyEventArgument(destination, limit, a6);
7751  PIXCopyEventArgument(destination, limit, a7);
7752  PIXCopyEventArgument(destination, limit, a8);
7753 
7754  *destination = PIXEventsBlockEndMarker;
7755  threadInfo->destination = destination;
7756  }
7757  else if (limit != nullptr)
7758  {
7759  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
7760  }
7761 }
7762 
7763 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
7764 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
7765 {
7766  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7767  UINT64* destination = threadInfo->destination;
7768  UINT64* limit = threadInfo->biasedLimit;
7769  if (destination < limit)
7770  {
7771  limit += PIXEventsSafeFastCopySpaceQwords;
7772  UINT64 time = PIXGetTimestampCounter();
7773  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7774  *destination++ = color;
7775 
7776  PIXCopyEventArgument(destination, limit, context);
7777  PIXCopyEventArgument(destination, limit, formatString);
7778  PIXCopyEventArgument(destination, limit, a1);
7779  PIXCopyEventArgument(destination, limit, a2);
7780  PIXCopyEventArgument(destination, limit, a3);
7781  PIXCopyEventArgument(destination, limit, a4);
7782  PIXCopyEventArgument(destination, limit, a5);
7783  PIXCopyEventArgument(destination, limit, a6);
7784  PIXCopyEventArgument(destination, limit, a7);
7785  PIXCopyEventArgument(destination, limit, a8);
7786  PIXCopyEventArgument(destination, limit, a9);
7787 
7788  *destination = PIXEventsBlockEndMarker;
7789  threadInfo->destination = destination;
7790  }
7791  else if (limit != nullptr)
7792  {
7793  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
7794  }
7795 }
7796 
7797 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
7798 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
7799 {
7800  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7801  UINT64* destination = threadInfo->destination;
7802  UINT64* limit = threadInfo->biasedLimit;
7803  if (destination < limit)
7804  {
7805  limit += PIXEventsSafeFastCopySpaceQwords;
7806  UINT64 time = PIXGetTimestampCounter();
7807  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7808  *destination++ = color;
7809 
7810  PIXCopyEventArgument(destination, limit, context);
7811  PIXCopyEventArgument(destination, limit, formatString);
7812  PIXCopyEventArgument(destination, limit, a1);
7813  PIXCopyEventArgument(destination, limit, a2);
7814  PIXCopyEventArgument(destination, limit, a3);
7815  PIXCopyEventArgument(destination, limit, a4);
7816  PIXCopyEventArgument(destination, limit, a5);
7817  PIXCopyEventArgument(destination, limit, a6);
7818  PIXCopyEventArgument(destination, limit, a7);
7819  PIXCopyEventArgument(destination, limit, a8);
7820  PIXCopyEventArgument(destination, limit, a9);
7821  PIXCopyEventArgument(destination, limit, a10);
7822 
7823  *destination = PIXEventsBlockEndMarker;
7824  threadInfo->destination = destination;
7825  }
7826  else if (limit != nullptr)
7827  {
7828  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
7829  }
7830 }
7831 
7832 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
7833 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
7834 {
7835  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7836  UINT64* destination = threadInfo->destination;
7837  UINT64* limit = threadInfo->biasedLimit;
7838  if (destination < limit)
7839  {
7840  limit += PIXEventsSafeFastCopySpaceQwords;
7841  UINT64 time = PIXGetTimestampCounter();
7842  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7843  *destination++ = color;
7844 
7845  PIXCopyEventArgument(destination, limit, context);
7846  PIXCopyEventArgument(destination, limit, formatString);
7847  PIXCopyEventArgument(destination, limit, a1);
7848  PIXCopyEventArgument(destination, limit, a2);
7849  PIXCopyEventArgument(destination, limit, a3);
7850  PIXCopyEventArgument(destination, limit, a4);
7851  PIXCopyEventArgument(destination, limit, a5);
7852  PIXCopyEventArgument(destination, limit, a6);
7853  PIXCopyEventArgument(destination, limit, a7);
7854  PIXCopyEventArgument(destination, limit, a8);
7855  PIXCopyEventArgument(destination, limit, a9);
7856  PIXCopyEventArgument(destination, limit, a10);
7857  PIXCopyEventArgument(destination, limit, a11);
7858 
7859  *destination = PIXEventsBlockEndMarker;
7860  threadInfo->destination = destination;
7861  }
7862  else if (limit != nullptr)
7863  {
7864  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
7865  }
7866 }
7867 
7868 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
7869 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
7870 {
7871  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7872  UINT64* destination = threadInfo->destination;
7873  UINT64* limit = threadInfo->biasedLimit;
7874  if (destination < limit)
7875  {
7876  limit += PIXEventsSafeFastCopySpaceQwords;
7877  UINT64 time = PIXGetTimestampCounter();
7878  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7879  *destination++ = color;
7880 
7881  PIXCopyEventArgument(destination, limit, context);
7882  PIXCopyEventArgument(destination, limit, formatString);
7883  PIXCopyEventArgument(destination, limit, a1);
7884  PIXCopyEventArgument(destination, limit, a2);
7885  PIXCopyEventArgument(destination, limit, a3);
7886  PIXCopyEventArgument(destination, limit, a4);
7887  PIXCopyEventArgument(destination, limit, a5);
7888  PIXCopyEventArgument(destination, limit, a6);
7889  PIXCopyEventArgument(destination, limit, a7);
7890  PIXCopyEventArgument(destination, limit, a8);
7891  PIXCopyEventArgument(destination, limit, a9);
7892  PIXCopyEventArgument(destination, limit, a10);
7893  PIXCopyEventArgument(destination, limit, a11);
7894  PIXCopyEventArgument(destination, limit, a12);
7895 
7896  *destination = PIXEventsBlockEndMarker;
7897  threadInfo->destination = destination;
7898  }
7899  else if (limit != nullptr)
7900  {
7901  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
7902  }
7903 }
7904 
7905 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
7906 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
7907 {
7908  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7909  UINT64* destination = threadInfo->destination;
7910  UINT64* limit = threadInfo->biasedLimit;
7911  if (destination < limit)
7912  {
7913  limit += PIXEventsSafeFastCopySpaceQwords;
7914  UINT64 time = PIXGetTimestampCounter();
7915  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7916  *destination++ = color;
7917 
7918  PIXCopyEventArgument(destination, limit, context);
7919  PIXCopyEventArgument(destination, limit, formatString);
7920  PIXCopyEventArgument(destination, limit, a1);
7921  PIXCopyEventArgument(destination, limit, a2);
7922  PIXCopyEventArgument(destination, limit, a3);
7923  PIXCopyEventArgument(destination, limit, a4);
7924  PIXCopyEventArgument(destination, limit, a5);
7925  PIXCopyEventArgument(destination, limit, a6);
7926  PIXCopyEventArgument(destination, limit, a7);
7927  PIXCopyEventArgument(destination, limit, a8);
7928  PIXCopyEventArgument(destination, limit, a9);
7929  PIXCopyEventArgument(destination, limit, a10);
7930  PIXCopyEventArgument(destination, limit, a11);
7931  PIXCopyEventArgument(destination, limit, a12);
7932  PIXCopyEventArgument(destination, limit, a13);
7933 
7934  *destination = PIXEventsBlockEndMarker;
7935  threadInfo->destination = destination;
7936  }
7937  else if (limit != nullptr)
7938  {
7939  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
7940  }
7941 }
7942 
7943 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
7944 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
7945 {
7946  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7947  UINT64* destination = threadInfo->destination;
7948  UINT64* limit = threadInfo->biasedLimit;
7949  if (destination < limit)
7950  {
7951  limit += PIXEventsSafeFastCopySpaceQwords;
7952  UINT64 time = PIXGetTimestampCounter();
7953  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7954  *destination++ = color;
7955 
7956  PIXCopyEventArgument(destination, limit, context);
7957  PIXCopyEventArgument(destination, limit, formatString);
7958  PIXCopyEventArgument(destination, limit, a1);
7959  PIXCopyEventArgument(destination, limit, a2);
7960  PIXCopyEventArgument(destination, limit, a3);
7961  PIXCopyEventArgument(destination, limit, a4);
7962  PIXCopyEventArgument(destination, limit, a5);
7963  PIXCopyEventArgument(destination, limit, a6);
7964  PIXCopyEventArgument(destination, limit, a7);
7965  PIXCopyEventArgument(destination, limit, a8);
7966  PIXCopyEventArgument(destination, limit, a9);
7967  PIXCopyEventArgument(destination, limit, a10);
7968  PIXCopyEventArgument(destination, limit, a11);
7969  PIXCopyEventArgument(destination, limit, a12);
7970  PIXCopyEventArgument(destination, limit, a13);
7971  PIXCopyEventArgument(destination, limit, a14);
7972 
7973  *destination = PIXEventsBlockEndMarker;
7974  threadInfo->destination = destination;
7975  }
7976  else if (limit != nullptr)
7977  {
7978  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
7979  }
7980 }
7981 
7982 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
7983 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
7984 {
7985  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
7986  UINT64* destination = threadInfo->destination;
7987  UINT64* limit = threadInfo->biasedLimit;
7988  if (destination < limit)
7989  {
7990  limit += PIXEventsSafeFastCopySpaceQwords;
7991  UINT64 time = PIXGetTimestampCounter();
7992  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
7993  *destination++ = color;
7994 
7995  PIXCopyEventArgument(destination, limit, context);
7996  PIXCopyEventArgument(destination, limit, formatString);
7997  PIXCopyEventArgument(destination, limit, a1);
7998  PIXCopyEventArgument(destination, limit, a2);
7999  PIXCopyEventArgument(destination, limit, a3);
8000  PIXCopyEventArgument(destination, limit, a4);
8001  PIXCopyEventArgument(destination, limit, a5);
8002  PIXCopyEventArgument(destination, limit, a6);
8003  PIXCopyEventArgument(destination, limit, a7);
8004  PIXCopyEventArgument(destination, limit, a8);
8005  PIXCopyEventArgument(destination, limit, a9);
8006  PIXCopyEventArgument(destination, limit, a10);
8007  PIXCopyEventArgument(destination, limit, a11);
8008  PIXCopyEventArgument(destination, limit, a12);
8009  PIXCopyEventArgument(destination, limit, a13);
8010  PIXCopyEventArgument(destination, limit, a14);
8011  PIXCopyEventArgument(destination, limit, a15);
8012 
8013  *destination = PIXEventsBlockEndMarker;
8014  threadInfo->destination = destination;
8015  }
8016  else if (limit != nullptr)
8017  {
8018  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
8019  }
8020 }
8021 
8022 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
8023 inline void MakeCPUSetMarkerForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
8024 {
8025  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8026  UINT64* destination = threadInfo->destination;
8027  UINT64* limit = threadInfo->biasedLimit;
8028  if (destination < limit)
8029  {
8030  limit += PIXEventsSafeFastCopySpaceQwords;
8031  UINT64 time = PIXGetTimestampCounter();
8032  *destination++ = PIXEncodeEventInfo(time, PIXEvent_SetMarker_OnContext_VarArgs);
8033  *destination++ = color;
8034 
8035  PIXCopyEventArgument(destination, limit, context);
8036  PIXCopyEventArgument(destination, limit, formatString);
8037  PIXCopyEventArgument(destination, limit, a1);
8038  PIXCopyEventArgument(destination, limit, a2);
8039  PIXCopyEventArgument(destination, limit, a3);
8040  PIXCopyEventArgument(destination, limit, a4);
8041  PIXCopyEventArgument(destination, limit, a5);
8042  PIXCopyEventArgument(destination, limit, a6);
8043  PIXCopyEventArgument(destination, limit, a7);
8044  PIXCopyEventArgument(destination, limit, a8);
8045  PIXCopyEventArgument(destination, limit, a9);
8046  PIXCopyEventArgument(destination, limit, a10);
8047  PIXCopyEventArgument(destination, limit, a11);
8048  PIXCopyEventArgument(destination, limit, a12);
8049  PIXCopyEventArgument(destination, limit, a13);
8050  PIXCopyEventArgument(destination, limit, a14);
8051  PIXCopyEventArgument(destination, limit, a15);
8052  PIXCopyEventArgument(destination, limit, a16);
8053 
8054  *destination = PIXEventsBlockEndMarker;
8055  threadInfo->destination = destination;
8056  }
8057  else if (limit != nullptr)
8058  {
8059  MakeCPUSetMarkerForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
8060  }
8061 }
8062 
8063 
8064 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString)
8065 {
8066  UINT64 time = PIXEventsReplaceBlock(false);
8067  if (time)
8068  {
8069  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8070  UINT64* destination = threadInfo->destination;
8071  UINT64* limit = threadInfo->limit;
8072  if (destination < limit)
8073  {
8074  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_NoArgs);
8075  *destination++ = color;
8076 
8077  PIXCopyEventArgument(destination, limit, context);
8078  PIXCopyEventArgument(destination, limit, formatString);
8079  *destination = PIXEventsBlockEndMarker;
8080  threadInfo->destination = destination;
8081  }
8082  }
8083 }
8084 
8085 template<class T1>
8086 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1)
8087 {
8088  UINT64 time = PIXEventsReplaceBlock(false);
8089  if (time)
8090  {
8091  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8092  UINT64* destination = threadInfo->destination;
8093  UINT64* limit = threadInfo->limit;
8094  if (destination < limit)
8095  {
8096  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8097  *destination++ = color;
8098 
8099  PIXCopyEventArgument(destination, limit, context);
8100  PIXCopyEventArgument(destination, limit, formatString);
8101  PIXCopyEventArgument(destination, limit, a1);
8102  *destination = PIXEventsBlockEndMarker;
8103  threadInfo->destination = destination;
8104  }
8105  }
8106 }
8107 
8108 template<class T1, class T2>
8109 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2)
8110 {
8111  UINT64 time = PIXEventsReplaceBlock(false);
8112  if (time)
8113  {
8114  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8115  UINT64* destination = threadInfo->destination;
8116  UINT64* limit = threadInfo->limit;
8117  if (destination < limit)
8118  {
8119  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8120  *destination++ = color;
8121 
8122  PIXCopyEventArgument(destination, limit, context);
8123  PIXCopyEventArgument(destination, limit, formatString);
8124  PIXCopyEventArgument(destination, limit, a1);
8125  PIXCopyEventArgument(destination, limit, a2);
8126  *destination = PIXEventsBlockEndMarker;
8127  threadInfo->destination = destination;
8128  }
8129  }
8130 }
8131 
8132 template<class T1, class T2, class T3>
8133 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
8134 {
8135  UINT64 time = PIXEventsReplaceBlock(false);
8136  if (time)
8137  {
8138  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8139  UINT64* destination = threadInfo->destination;
8140  UINT64* limit = threadInfo->limit;
8141  if (destination < limit)
8142  {
8143  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8144  *destination++ = color;
8145 
8146  PIXCopyEventArgument(destination, limit, context);
8147  PIXCopyEventArgument(destination, limit, formatString);
8148  PIXCopyEventArgument(destination, limit, a1);
8149  PIXCopyEventArgument(destination, limit, a2);
8150  PIXCopyEventArgument(destination, limit, a3);
8151  *destination = PIXEventsBlockEndMarker;
8152  threadInfo->destination = destination;
8153  }
8154  }
8155 }
8156 
8157 template<class T1, class T2, class T3, class T4>
8158 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
8159 {
8160  UINT64 time = PIXEventsReplaceBlock(false);
8161  if (time)
8162  {
8163  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8164  UINT64* destination = threadInfo->destination;
8165  UINT64* limit = threadInfo->limit;
8166  if (destination < limit)
8167  {
8168  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8169  *destination++ = color;
8170 
8171  PIXCopyEventArgument(destination, limit, context);
8172  PIXCopyEventArgument(destination, limit, formatString);
8173  PIXCopyEventArgument(destination, limit, a1);
8174  PIXCopyEventArgument(destination, limit, a2);
8175  PIXCopyEventArgument(destination, limit, a3);
8176  PIXCopyEventArgument(destination, limit, a4);
8177  *destination = PIXEventsBlockEndMarker;
8178  threadInfo->destination = destination;
8179  }
8180  }
8181 }
8182 
8183 template<class T1, class T2, class T3, class T4, class T5>
8184 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
8185 {
8186  UINT64 time = PIXEventsReplaceBlock(false);
8187  if (time)
8188  {
8189  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8190  UINT64* destination = threadInfo->destination;
8191  UINT64* limit = threadInfo->limit;
8192  if (destination < limit)
8193  {
8194  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8195  *destination++ = color;
8196 
8197  PIXCopyEventArgument(destination, limit, context);
8198  PIXCopyEventArgument(destination, limit, formatString);
8199  PIXCopyEventArgument(destination, limit, a1);
8200  PIXCopyEventArgument(destination, limit, a2);
8201  PIXCopyEventArgument(destination, limit, a3);
8202  PIXCopyEventArgument(destination, limit, a4);
8203  PIXCopyEventArgument(destination, limit, a5);
8204  *destination = PIXEventsBlockEndMarker;
8205  threadInfo->destination = destination;
8206  }
8207  }
8208 }
8209 
8210 template<class T1, class T2, class T3, class T4, class T5, class T6>
8211 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
8212 {
8213  UINT64 time = PIXEventsReplaceBlock(false);
8214  if (time)
8215  {
8216  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8217  UINT64* destination = threadInfo->destination;
8218  UINT64* limit = threadInfo->limit;
8219  if (destination < limit)
8220  {
8221  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8222  *destination++ = color;
8223 
8224  PIXCopyEventArgument(destination, limit, context);
8225  PIXCopyEventArgument(destination, limit, formatString);
8226  PIXCopyEventArgument(destination, limit, a1);
8227  PIXCopyEventArgument(destination, limit, a2);
8228  PIXCopyEventArgument(destination, limit, a3);
8229  PIXCopyEventArgument(destination, limit, a4);
8230  PIXCopyEventArgument(destination, limit, a5);
8231  PIXCopyEventArgument(destination, limit, a6);
8232  *destination = PIXEventsBlockEndMarker;
8233  threadInfo->destination = destination;
8234  }
8235  }
8236 }
8237 
8238 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
8239 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
8240 {
8241  UINT64 time = PIXEventsReplaceBlock(false);
8242  if (time)
8243  {
8244  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8245  UINT64* destination = threadInfo->destination;
8246  UINT64* limit = threadInfo->limit;
8247  if (destination < limit)
8248  {
8249  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8250  *destination++ = color;
8251 
8252  PIXCopyEventArgument(destination, limit, context);
8253  PIXCopyEventArgument(destination, limit, formatString);
8254  PIXCopyEventArgument(destination, limit, a1);
8255  PIXCopyEventArgument(destination, limit, a2);
8256  PIXCopyEventArgument(destination, limit, a3);
8257  PIXCopyEventArgument(destination, limit, a4);
8258  PIXCopyEventArgument(destination, limit, a5);
8259  PIXCopyEventArgument(destination, limit, a6);
8260  PIXCopyEventArgument(destination, limit, a7);
8261  *destination = PIXEventsBlockEndMarker;
8262  threadInfo->destination = destination;
8263  }
8264  }
8265 }
8266 
8267 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
8268 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
8269 {
8270  UINT64 time = PIXEventsReplaceBlock(false);
8271  if (time)
8272  {
8273  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8274  UINT64* destination = threadInfo->destination;
8275  UINT64* limit = threadInfo->limit;
8276  if (destination < limit)
8277  {
8278  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8279  *destination++ = color;
8280 
8281  PIXCopyEventArgument(destination, limit, context);
8282  PIXCopyEventArgument(destination, limit, formatString);
8283  PIXCopyEventArgument(destination, limit, a1);
8284  PIXCopyEventArgument(destination, limit, a2);
8285  PIXCopyEventArgument(destination, limit, a3);
8286  PIXCopyEventArgument(destination, limit, a4);
8287  PIXCopyEventArgument(destination, limit, a5);
8288  PIXCopyEventArgument(destination, limit, a6);
8289  PIXCopyEventArgument(destination, limit, a7);
8290  PIXCopyEventArgument(destination, limit, a8);
8291  *destination = PIXEventsBlockEndMarker;
8292  threadInfo->destination = destination;
8293  }
8294  }
8295 }
8296 
8297 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
8298 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
8299 {
8300  UINT64 time = PIXEventsReplaceBlock(false);
8301  if (time)
8302  {
8303  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8304  UINT64* destination = threadInfo->destination;
8305  UINT64* limit = threadInfo->limit;
8306  if (destination < limit)
8307  {
8308  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8309  *destination++ = color;
8310 
8311  PIXCopyEventArgument(destination, limit, context);
8312  PIXCopyEventArgument(destination, limit, formatString);
8313  PIXCopyEventArgument(destination, limit, a1);
8314  PIXCopyEventArgument(destination, limit, a2);
8315  PIXCopyEventArgument(destination, limit, a3);
8316  PIXCopyEventArgument(destination, limit, a4);
8317  PIXCopyEventArgument(destination, limit, a5);
8318  PIXCopyEventArgument(destination, limit, a6);
8319  PIXCopyEventArgument(destination, limit, a7);
8320  PIXCopyEventArgument(destination, limit, a8);
8321  PIXCopyEventArgument(destination, limit, a9);
8322  *destination = PIXEventsBlockEndMarker;
8323  threadInfo->destination = destination;
8324  }
8325  }
8326 }
8327 
8328 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
8329 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
8330 {
8331  UINT64 time = PIXEventsReplaceBlock(false);
8332  if (time)
8333  {
8334  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8335  UINT64* destination = threadInfo->destination;
8336  UINT64* limit = threadInfo->limit;
8337  if (destination < limit)
8338  {
8339  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8340  *destination++ = color;
8341 
8342  PIXCopyEventArgument(destination, limit, context);
8343  PIXCopyEventArgument(destination, limit, formatString);
8344  PIXCopyEventArgument(destination, limit, a1);
8345  PIXCopyEventArgument(destination, limit, a2);
8346  PIXCopyEventArgument(destination, limit, a3);
8347  PIXCopyEventArgument(destination, limit, a4);
8348  PIXCopyEventArgument(destination, limit, a5);
8349  PIXCopyEventArgument(destination, limit, a6);
8350  PIXCopyEventArgument(destination, limit, a7);
8351  PIXCopyEventArgument(destination, limit, a8);
8352  PIXCopyEventArgument(destination, limit, a9);
8353  PIXCopyEventArgument(destination, limit, a10);
8354  *destination = PIXEventsBlockEndMarker;
8355  threadInfo->destination = destination;
8356  }
8357  }
8358 }
8359 
8360 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
8361 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
8362 {
8363  UINT64 time = PIXEventsReplaceBlock(false);
8364  if (time)
8365  {
8366  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8367  UINT64* destination = threadInfo->destination;
8368  UINT64* limit = threadInfo->limit;
8369  if (destination < limit)
8370  {
8371  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8372  *destination++ = color;
8373 
8374  PIXCopyEventArgument(destination, limit, context);
8375  PIXCopyEventArgument(destination, limit, formatString);
8376  PIXCopyEventArgument(destination, limit, a1);
8377  PIXCopyEventArgument(destination, limit, a2);
8378  PIXCopyEventArgument(destination, limit, a3);
8379  PIXCopyEventArgument(destination, limit, a4);
8380  PIXCopyEventArgument(destination, limit, a5);
8381  PIXCopyEventArgument(destination, limit, a6);
8382  PIXCopyEventArgument(destination, limit, a7);
8383  PIXCopyEventArgument(destination, limit, a8);
8384  PIXCopyEventArgument(destination, limit, a9);
8385  PIXCopyEventArgument(destination, limit, a10);
8386  PIXCopyEventArgument(destination, limit, a11);
8387  *destination = PIXEventsBlockEndMarker;
8388  threadInfo->destination = destination;
8389  }
8390  }
8391 }
8392 
8393 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
8394 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
8395 {
8396  UINT64 time = PIXEventsReplaceBlock(false);
8397  if (time)
8398  {
8399  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8400  UINT64* destination = threadInfo->destination;
8401  UINT64* limit = threadInfo->limit;
8402  if (destination < limit)
8403  {
8404  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8405  *destination++ = color;
8406 
8407  PIXCopyEventArgument(destination, limit, context);
8408  PIXCopyEventArgument(destination, limit, formatString);
8409  PIXCopyEventArgument(destination, limit, a1);
8410  PIXCopyEventArgument(destination, limit, a2);
8411  PIXCopyEventArgument(destination, limit, a3);
8412  PIXCopyEventArgument(destination, limit, a4);
8413  PIXCopyEventArgument(destination, limit, a5);
8414  PIXCopyEventArgument(destination, limit, a6);
8415  PIXCopyEventArgument(destination, limit, a7);
8416  PIXCopyEventArgument(destination, limit, a8);
8417  PIXCopyEventArgument(destination, limit, a9);
8418  PIXCopyEventArgument(destination, limit, a10);
8419  PIXCopyEventArgument(destination, limit, a11);
8420  PIXCopyEventArgument(destination, limit, a12);
8421  *destination = PIXEventsBlockEndMarker;
8422  threadInfo->destination = destination;
8423  }
8424  }
8425 }
8426 
8427 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
8428 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
8429 {
8430  UINT64 time = PIXEventsReplaceBlock(false);
8431  if (time)
8432  {
8433  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8434  UINT64* destination = threadInfo->destination;
8435  UINT64* limit = threadInfo->limit;
8436  if (destination < limit)
8437  {
8438  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8439  *destination++ = color;
8440 
8441  PIXCopyEventArgument(destination, limit, context);
8442  PIXCopyEventArgument(destination, limit, formatString);
8443  PIXCopyEventArgument(destination, limit, a1);
8444  PIXCopyEventArgument(destination, limit, a2);
8445  PIXCopyEventArgument(destination, limit, a3);
8446  PIXCopyEventArgument(destination, limit, a4);
8447  PIXCopyEventArgument(destination, limit, a5);
8448  PIXCopyEventArgument(destination, limit, a6);
8449  PIXCopyEventArgument(destination, limit, a7);
8450  PIXCopyEventArgument(destination, limit, a8);
8451  PIXCopyEventArgument(destination, limit, a9);
8452  PIXCopyEventArgument(destination, limit, a10);
8453  PIXCopyEventArgument(destination, limit, a11);
8454  PIXCopyEventArgument(destination, limit, a12);
8455  PIXCopyEventArgument(destination, limit, a13);
8456  *destination = PIXEventsBlockEndMarker;
8457  threadInfo->destination = destination;
8458  }
8459  }
8460 }
8461 
8462 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
8463 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
8464 {
8465  UINT64 time = PIXEventsReplaceBlock(false);
8466  if (time)
8467  {
8468  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8469  UINT64* destination = threadInfo->destination;
8470  UINT64* limit = threadInfo->limit;
8471  if (destination < limit)
8472  {
8473  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8474  *destination++ = color;
8475 
8476  PIXCopyEventArgument(destination, limit, context);
8477  PIXCopyEventArgument(destination, limit, formatString);
8478  PIXCopyEventArgument(destination, limit, a1);
8479  PIXCopyEventArgument(destination, limit, a2);
8480  PIXCopyEventArgument(destination, limit, a3);
8481  PIXCopyEventArgument(destination, limit, a4);
8482  PIXCopyEventArgument(destination, limit, a5);
8483  PIXCopyEventArgument(destination, limit, a6);
8484  PIXCopyEventArgument(destination, limit, a7);
8485  PIXCopyEventArgument(destination, limit, a8);
8486  PIXCopyEventArgument(destination, limit, a9);
8487  PIXCopyEventArgument(destination, limit, a10);
8488  PIXCopyEventArgument(destination, limit, a11);
8489  PIXCopyEventArgument(destination, limit, a12);
8490  PIXCopyEventArgument(destination, limit, a13);
8491  PIXCopyEventArgument(destination, limit, a14);
8492  *destination = PIXEventsBlockEndMarker;
8493  threadInfo->destination = destination;
8494  }
8495  }
8496 }
8497 
8498 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
8499 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
8500 {
8501  UINT64 time = PIXEventsReplaceBlock(false);
8502  if (time)
8503  {
8504  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8505  UINT64* destination = threadInfo->destination;
8506  UINT64* limit = threadInfo->limit;
8507  if (destination < limit)
8508  {
8509  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8510  *destination++ = color;
8511 
8512  PIXCopyEventArgument(destination, limit, context);
8513  PIXCopyEventArgument(destination, limit, formatString);
8514  PIXCopyEventArgument(destination, limit, a1);
8515  PIXCopyEventArgument(destination, limit, a2);
8516  PIXCopyEventArgument(destination, limit, a3);
8517  PIXCopyEventArgument(destination, limit, a4);
8518  PIXCopyEventArgument(destination, limit, a5);
8519  PIXCopyEventArgument(destination, limit, a6);
8520  PIXCopyEventArgument(destination, limit, a7);
8521  PIXCopyEventArgument(destination, limit, a8);
8522  PIXCopyEventArgument(destination, limit, a9);
8523  PIXCopyEventArgument(destination, limit, a10);
8524  PIXCopyEventArgument(destination, limit, a11);
8525  PIXCopyEventArgument(destination, limit, a12);
8526  PIXCopyEventArgument(destination, limit, a13);
8527  PIXCopyEventArgument(destination, limit, a14);
8528  PIXCopyEventArgument(destination, limit, a15);
8529  *destination = PIXEventsBlockEndMarker;
8530  threadInfo->destination = destination;
8531  }
8532  }
8533 }
8534 
8535 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
8536 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
8537 {
8538  UINT64 time = PIXEventsReplaceBlock(false);
8539  if (time)
8540  {
8541  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8542  UINT64* destination = threadInfo->destination;
8543  UINT64* limit = threadInfo->limit;
8544  if (destination < limit)
8545  {
8546  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8547  *destination++ = color;
8548 
8549  PIXCopyEventArgument(destination, limit, context);
8550  PIXCopyEventArgument(destination, limit, formatString);
8551  PIXCopyEventArgument(destination, limit, a1);
8552  PIXCopyEventArgument(destination, limit, a2);
8553  PIXCopyEventArgument(destination, limit, a3);
8554  PIXCopyEventArgument(destination, limit, a4);
8555  PIXCopyEventArgument(destination, limit, a5);
8556  PIXCopyEventArgument(destination, limit, a6);
8557  PIXCopyEventArgument(destination, limit, a7);
8558  PIXCopyEventArgument(destination, limit, a8);
8559  PIXCopyEventArgument(destination, limit, a9);
8560  PIXCopyEventArgument(destination, limit, a10);
8561  PIXCopyEventArgument(destination, limit, a11);
8562  PIXCopyEventArgument(destination, limit, a12);
8563  PIXCopyEventArgument(destination, limit, a13);
8564  PIXCopyEventArgument(destination, limit, a14);
8565  PIXCopyEventArgument(destination, limit, a15);
8566  PIXCopyEventArgument(destination, limit, a16);
8567  *destination = PIXEventsBlockEndMarker;
8568  threadInfo->destination = destination;
8569  }
8570  }
8571 }
8572 
8573 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString)
8574 {
8575  UINT64 time = PIXEventsReplaceBlock(false);
8576  if (time)
8577  {
8578  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8579  UINT64* destination = threadInfo->destination;
8580  UINT64* limit = threadInfo->limit;
8581  if (destination < limit)
8582  {
8583  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_NoArgs);
8584  *destination++ = color;
8585 
8586  PIXCopyEventArgument(destination, limit, context);
8587  PIXCopyEventArgument(destination, limit, formatString);
8588  *destination = PIXEventsBlockEndMarker;
8589  threadInfo->destination = destination;
8590  }
8591  }
8592 }
8593 
8594 template<class T1>
8595 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1)
8596 {
8597  UINT64 time = PIXEventsReplaceBlock(false);
8598  if (time)
8599  {
8600  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8601  UINT64* destination = threadInfo->destination;
8602  UINT64* limit = threadInfo->limit;
8603  if (destination < limit)
8604  {
8605  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8606  *destination++ = color;
8607 
8608  PIXCopyEventArgument(destination, limit, context);
8609  PIXCopyEventArgument(destination, limit, formatString);
8610  PIXCopyEventArgument(destination, limit, a1);
8611  *destination = PIXEventsBlockEndMarker;
8612  threadInfo->destination = destination;
8613  }
8614  }
8615 }
8616 
8617 template<class T1, class T2>
8618 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2)
8619 {
8620  UINT64 time = PIXEventsReplaceBlock(false);
8621  if (time)
8622  {
8623  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8624  UINT64* destination = threadInfo->destination;
8625  UINT64* limit = threadInfo->limit;
8626  if (destination < limit)
8627  {
8628  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8629  *destination++ = color;
8630 
8631  PIXCopyEventArgument(destination, limit, context);
8632  PIXCopyEventArgument(destination, limit, formatString);
8633  PIXCopyEventArgument(destination, limit, a1);
8634  PIXCopyEventArgument(destination, limit, a2);
8635  *destination = PIXEventsBlockEndMarker;
8636  threadInfo->destination = destination;
8637  }
8638  }
8639 }
8640 
8641 template<class T1, class T2, class T3>
8642 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
8643 {
8644  UINT64 time = PIXEventsReplaceBlock(false);
8645  if (time)
8646  {
8647  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8648  UINT64* destination = threadInfo->destination;
8649  UINT64* limit = threadInfo->limit;
8650  if (destination < limit)
8651  {
8652  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8653  *destination++ = color;
8654 
8655  PIXCopyEventArgument(destination, limit, context);
8656  PIXCopyEventArgument(destination, limit, formatString);
8657  PIXCopyEventArgument(destination, limit, a1);
8658  PIXCopyEventArgument(destination, limit, a2);
8659  PIXCopyEventArgument(destination, limit, a3);
8660  *destination = PIXEventsBlockEndMarker;
8661  threadInfo->destination = destination;
8662  }
8663  }
8664 }
8665 
8666 template<class T1, class T2, class T3, class T4>
8667 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
8668 {
8669  UINT64 time = PIXEventsReplaceBlock(false);
8670  if (time)
8671  {
8672  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8673  UINT64* destination = threadInfo->destination;
8674  UINT64* limit = threadInfo->limit;
8675  if (destination < limit)
8676  {
8677  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8678  *destination++ = color;
8679 
8680  PIXCopyEventArgument(destination, limit, context);
8681  PIXCopyEventArgument(destination, limit, formatString);
8682  PIXCopyEventArgument(destination, limit, a1);
8683  PIXCopyEventArgument(destination, limit, a2);
8684  PIXCopyEventArgument(destination, limit, a3);
8685  PIXCopyEventArgument(destination, limit, a4);
8686  *destination = PIXEventsBlockEndMarker;
8687  threadInfo->destination = destination;
8688  }
8689  }
8690 }
8691 
8692 template<class T1, class T2, class T3, class T4, class T5>
8693 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
8694 {
8695  UINT64 time = PIXEventsReplaceBlock(false);
8696  if (time)
8697  {
8698  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8699  UINT64* destination = threadInfo->destination;
8700  UINT64* limit = threadInfo->limit;
8701  if (destination < limit)
8702  {
8703  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8704  *destination++ = color;
8705 
8706  PIXCopyEventArgument(destination, limit, context);
8707  PIXCopyEventArgument(destination, limit, formatString);
8708  PIXCopyEventArgument(destination, limit, a1);
8709  PIXCopyEventArgument(destination, limit, a2);
8710  PIXCopyEventArgument(destination, limit, a3);
8711  PIXCopyEventArgument(destination, limit, a4);
8712  PIXCopyEventArgument(destination, limit, a5);
8713  *destination = PIXEventsBlockEndMarker;
8714  threadInfo->destination = destination;
8715  }
8716  }
8717 }
8718 
8719 template<class T1, class T2, class T3, class T4, class T5, class T6>
8720 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
8721 {
8722  UINT64 time = PIXEventsReplaceBlock(false);
8723  if (time)
8724  {
8725  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8726  UINT64* destination = threadInfo->destination;
8727  UINT64* limit = threadInfo->limit;
8728  if (destination < limit)
8729  {
8730  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8731  *destination++ = color;
8732 
8733  PIXCopyEventArgument(destination, limit, context);
8734  PIXCopyEventArgument(destination, limit, formatString);
8735  PIXCopyEventArgument(destination, limit, a1);
8736  PIXCopyEventArgument(destination, limit, a2);
8737  PIXCopyEventArgument(destination, limit, a3);
8738  PIXCopyEventArgument(destination, limit, a4);
8739  PIXCopyEventArgument(destination, limit, a5);
8740  PIXCopyEventArgument(destination, limit, a6);
8741  *destination = PIXEventsBlockEndMarker;
8742  threadInfo->destination = destination;
8743  }
8744  }
8745 }
8746 
8747 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
8748 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
8749 {
8750  UINT64 time = PIXEventsReplaceBlock(false);
8751  if (time)
8752  {
8753  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8754  UINT64* destination = threadInfo->destination;
8755  UINT64* limit = threadInfo->limit;
8756  if (destination < limit)
8757  {
8758  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8759  *destination++ = color;
8760 
8761  PIXCopyEventArgument(destination, limit, context);
8762  PIXCopyEventArgument(destination, limit, formatString);
8763  PIXCopyEventArgument(destination, limit, a1);
8764  PIXCopyEventArgument(destination, limit, a2);
8765  PIXCopyEventArgument(destination, limit, a3);
8766  PIXCopyEventArgument(destination, limit, a4);
8767  PIXCopyEventArgument(destination, limit, a5);
8768  PIXCopyEventArgument(destination, limit, a6);
8769  PIXCopyEventArgument(destination, limit, a7);
8770  *destination = PIXEventsBlockEndMarker;
8771  threadInfo->destination = destination;
8772  }
8773  }
8774 }
8775 
8776 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
8777 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
8778 {
8779  UINT64 time = PIXEventsReplaceBlock(false);
8780  if (time)
8781  {
8782  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8783  UINT64* destination = threadInfo->destination;
8784  UINT64* limit = threadInfo->limit;
8785  if (destination < limit)
8786  {
8787  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8788  *destination++ = color;
8789 
8790  PIXCopyEventArgument(destination, limit, context);
8791  PIXCopyEventArgument(destination, limit, formatString);
8792  PIXCopyEventArgument(destination, limit, a1);
8793  PIXCopyEventArgument(destination, limit, a2);
8794  PIXCopyEventArgument(destination, limit, a3);
8795  PIXCopyEventArgument(destination, limit, a4);
8796  PIXCopyEventArgument(destination, limit, a5);
8797  PIXCopyEventArgument(destination, limit, a6);
8798  PIXCopyEventArgument(destination, limit, a7);
8799  PIXCopyEventArgument(destination, limit, a8);
8800  *destination = PIXEventsBlockEndMarker;
8801  threadInfo->destination = destination;
8802  }
8803  }
8804 }
8805 
8806 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
8807 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
8808 {
8809  UINT64 time = PIXEventsReplaceBlock(false);
8810  if (time)
8811  {
8812  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8813  UINT64* destination = threadInfo->destination;
8814  UINT64* limit = threadInfo->limit;
8815  if (destination < limit)
8816  {
8817  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8818  *destination++ = color;
8819 
8820  PIXCopyEventArgument(destination, limit, context);
8821  PIXCopyEventArgument(destination, limit, formatString);
8822  PIXCopyEventArgument(destination, limit, a1);
8823  PIXCopyEventArgument(destination, limit, a2);
8824  PIXCopyEventArgument(destination, limit, a3);
8825  PIXCopyEventArgument(destination, limit, a4);
8826  PIXCopyEventArgument(destination, limit, a5);
8827  PIXCopyEventArgument(destination, limit, a6);
8828  PIXCopyEventArgument(destination, limit, a7);
8829  PIXCopyEventArgument(destination, limit, a8);
8830  PIXCopyEventArgument(destination, limit, a9);
8831  *destination = PIXEventsBlockEndMarker;
8832  threadInfo->destination = destination;
8833  }
8834  }
8835 }
8836 
8837 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
8838 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
8839 {
8840  UINT64 time = PIXEventsReplaceBlock(false);
8841  if (time)
8842  {
8843  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8844  UINT64* destination = threadInfo->destination;
8845  UINT64* limit = threadInfo->limit;
8846  if (destination < limit)
8847  {
8848  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8849  *destination++ = color;
8850 
8851  PIXCopyEventArgument(destination, limit, context);
8852  PIXCopyEventArgument(destination, limit, formatString);
8853  PIXCopyEventArgument(destination, limit, a1);
8854  PIXCopyEventArgument(destination, limit, a2);
8855  PIXCopyEventArgument(destination, limit, a3);
8856  PIXCopyEventArgument(destination, limit, a4);
8857  PIXCopyEventArgument(destination, limit, a5);
8858  PIXCopyEventArgument(destination, limit, a6);
8859  PIXCopyEventArgument(destination, limit, a7);
8860  PIXCopyEventArgument(destination, limit, a8);
8861  PIXCopyEventArgument(destination, limit, a9);
8862  PIXCopyEventArgument(destination, limit, a10);
8863  *destination = PIXEventsBlockEndMarker;
8864  threadInfo->destination = destination;
8865  }
8866  }
8867 }
8868 
8869 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
8870 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
8871 {
8872  UINT64 time = PIXEventsReplaceBlock(false);
8873  if (time)
8874  {
8875  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8876  UINT64* destination = threadInfo->destination;
8877  UINT64* limit = threadInfo->limit;
8878  if (destination < limit)
8879  {
8880  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8881  *destination++ = color;
8882 
8883  PIXCopyEventArgument(destination, limit, context);
8884  PIXCopyEventArgument(destination, limit, formatString);
8885  PIXCopyEventArgument(destination, limit, a1);
8886  PIXCopyEventArgument(destination, limit, a2);
8887  PIXCopyEventArgument(destination, limit, a3);
8888  PIXCopyEventArgument(destination, limit, a4);
8889  PIXCopyEventArgument(destination, limit, a5);
8890  PIXCopyEventArgument(destination, limit, a6);
8891  PIXCopyEventArgument(destination, limit, a7);
8892  PIXCopyEventArgument(destination, limit, a8);
8893  PIXCopyEventArgument(destination, limit, a9);
8894  PIXCopyEventArgument(destination, limit, a10);
8895  PIXCopyEventArgument(destination, limit, a11);
8896  *destination = PIXEventsBlockEndMarker;
8897  threadInfo->destination = destination;
8898  }
8899  }
8900 }
8901 
8902 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
8903 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
8904 {
8905  UINT64 time = PIXEventsReplaceBlock(false);
8906  if (time)
8907  {
8908  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8909  UINT64* destination = threadInfo->destination;
8910  UINT64* limit = threadInfo->limit;
8911  if (destination < limit)
8912  {
8913  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8914  *destination++ = color;
8915 
8916  PIXCopyEventArgument(destination, limit, context);
8917  PIXCopyEventArgument(destination, limit, formatString);
8918  PIXCopyEventArgument(destination, limit, a1);
8919  PIXCopyEventArgument(destination, limit, a2);
8920  PIXCopyEventArgument(destination, limit, a3);
8921  PIXCopyEventArgument(destination, limit, a4);
8922  PIXCopyEventArgument(destination, limit, a5);
8923  PIXCopyEventArgument(destination, limit, a6);
8924  PIXCopyEventArgument(destination, limit, a7);
8925  PIXCopyEventArgument(destination, limit, a8);
8926  PIXCopyEventArgument(destination, limit, a9);
8927  PIXCopyEventArgument(destination, limit, a10);
8928  PIXCopyEventArgument(destination, limit, a11);
8929  PIXCopyEventArgument(destination, limit, a12);
8930  *destination = PIXEventsBlockEndMarker;
8931  threadInfo->destination = destination;
8932  }
8933  }
8934 }
8935 
8936 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
8937 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
8938 {
8939  UINT64 time = PIXEventsReplaceBlock(false);
8940  if (time)
8941  {
8942  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8943  UINT64* destination = threadInfo->destination;
8944  UINT64* limit = threadInfo->limit;
8945  if (destination < limit)
8946  {
8947  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8948  *destination++ = color;
8949 
8950  PIXCopyEventArgument(destination, limit, context);
8951  PIXCopyEventArgument(destination, limit, formatString);
8952  PIXCopyEventArgument(destination, limit, a1);
8953  PIXCopyEventArgument(destination, limit, a2);
8954  PIXCopyEventArgument(destination, limit, a3);
8955  PIXCopyEventArgument(destination, limit, a4);
8956  PIXCopyEventArgument(destination, limit, a5);
8957  PIXCopyEventArgument(destination, limit, a6);
8958  PIXCopyEventArgument(destination, limit, a7);
8959  PIXCopyEventArgument(destination, limit, a8);
8960  PIXCopyEventArgument(destination, limit, a9);
8961  PIXCopyEventArgument(destination, limit, a10);
8962  PIXCopyEventArgument(destination, limit, a11);
8963  PIXCopyEventArgument(destination, limit, a12);
8964  PIXCopyEventArgument(destination, limit, a13);
8965  *destination = PIXEventsBlockEndMarker;
8966  threadInfo->destination = destination;
8967  }
8968  }
8969 }
8970 
8971 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
8972 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
8973 {
8974  UINT64 time = PIXEventsReplaceBlock(false);
8975  if (time)
8976  {
8977  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
8978  UINT64* destination = threadInfo->destination;
8979  UINT64* limit = threadInfo->limit;
8980  if (destination < limit)
8981  {
8982  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
8983  *destination++ = color;
8984 
8985  PIXCopyEventArgument(destination, limit, context);
8986  PIXCopyEventArgument(destination, limit, formatString);
8987  PIXCopyEventArgument(destination, limit, a1);
8988  PIXCopyEventArgument(destination, limit, a2);
8989  PIXCopyEventArgument(destination, limit, a3);
8990  PIXCopyEventArgument(destination, limit, a4);
8991  PIXCopyEventArgument(destination, limit, a5);
8992  PIXCopyEventArgument(destination, limit, a6);
8993  PIXCopyEventArgument(destination, limit, a7);
8994  PIXCopyEventArgument(destination, limit, a8);
8995  PIXCopyEventArgument(destination, limit, a9);
8996  PIXCopyEventArgument(destination, limit, a10);
8997  PIXCopyEventArgument(destination, limit, a11);
8998  PIXCopyEventArgument(destination, limit, a12);
8999  PIXCopyEventArgument(destination, limit, a13);
9000  PIXCopyEventArgument(destination, limit, a14);
9001  *destination = PIXEventsBlockEndMarker;
9002  threadInfo->destination = destination;
9003  }
9004  }
9005 }
9006 
9007 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
9008 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
9009 {
9010  UINT64 time = PIXEventsReplaceBlock(false);
9011  if (time)
9012  {
9013  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9014  UINT64* destination = threadInfo->destination;
9015  UINT64* limit = threadInfo->limit;
9016  if (destination < limit)
9017  {
9018  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9019  *destination++ = color;
9020 
9021  PIXCopyEventArgument(destination, limit, context);
9022  PIXCopyEventArgument(destination, limit, formatString);
9023  PIXCopyEventArgument(destination, limit, a1);
9024  PIXCopyEventArgument(destination, limit, a2);
9025  PIXCopyEventArgument(destination, limit, a3);
9026  PIXCopyEventArgument(destination, limit, a4);
9027  PIXCopyEventArgument(destination, limit, a5);
9028  PIXCopyEventArgument(destination, limit, a6);
9029  PIXCopyEventArgument(destination, limit, a7);
9030  PIXCopyEventArgument(destination, limit, a8);
9031  PIXCopyEventArgument(destination, limit, a9);
9032  PIXCopyEventArgument(destination, limit, a10);
9033  PIXCopyEventArgument(destination, limit, a11);
9034  PIXCopyEventArgument(destination, limit, a12);
9035  PIXCopyEventArgument(destination, limit, a13);
9036  PIXCopyEventArgument(destination, limit, a14);
9037  PIXCopyEventArgument(destination, limit, a15);
9038  *destination = PIXEventsBlockEndMarker;
9039  threadInfo->destination = destination;
9040  }
9041  }
9042 }
9043 
9044 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
9045 __declspec(noinline) inline void MakeCPUBeginEventForContextAllocate(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
9046 {
9047  UINT64 time = PIXEventsReplaceBlock(false);
9048  if (time)
9049  {
9050  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9051  UINT64* destination = threadInfo->destination;
9052  UINT64* limit = threadInfo->limit;
9053  if (destination < limit)
9054  {
9055  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9056  *destination++ = color;
9057 
9058  PIXCopyEventArgument(destination, limit, context);
9059  PIXCopyEventArgument(destination, limit, formatString);
9060  PIXCopyEventArgument(destination, limit, a1);
9061  PIXCopyEventArgument(destination, limit, a2);
9062  PIXCopyEventArgument(destination, limit, a3);
9063  PIXCopyEventArgument(destination, limit, a4);
9064  PIXCopyEventArgument(destination, limit, a5);
9065  PIXCopyEventArgument(destination, limit, a6);
9066  PIXCopyEventArgument(destination, limit, a7);
9067  PIXCopyEventArgument(destination, limit, a8);
9068  PIXCopyEventArgument(destination, limit, a9);
9069  PIXCopyEventArgument(destination, limit, a10);
9070  PIXCopyEventArgument(destination, limit, a11);
9071  PIXCopyEventArgument(destination, limit, a12);
9072  PIXCopyEventArgument(destination, limit, a13);
9073  PIXCopyEventArgument(destination, limit, a14);
9074  PIXCopyEventArgument(destination, limit, a15);
9075  PIXCopyEventArgument(destination, limit, a16);
9076  *destination = PIXEventsBlockEndMarker;
9077  threadInfo->destination = destination;
9078  }
9079  }
9080 }
9081 
9082 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString)
9083 {
9084  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9085  UINT64* destination = threadInfo->destination;
9086  UINT64* limit = threadInfo->biasedLimit;
9087  if (destination < limit)
9088  {
9089  limit += PIXEventsSafeFastCopySpaceQwords;
9090  UINT64 time = PIXGetTimestampCounter();
9091  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_NoArgs);
9092  *destination++ = color;
9093 
9094  PIXCopyEventArgument(destination, limit, context);
9095  PIXCopyEventArgument(destination, limit, formatString);
9096 
9097  *destination = PIXEventsBlockEndMarker;
9098  threadInfo->destination = destination;
9099  }
9100  else if (limit != nullptr)
9101  {
9102  MakeCPUBeginEventForContextAllocate(color, context, formatString);
9103  }
9104 }
9105 
9106 template<class T1>
9107 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1)
9108 {
9109  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9110  UINT64* destination = threadInfo->destination;
9111  UINT64* limit = threadInfo->biasedLimit;
9112  if (destination < limit)
9113  {
9114  limit += PIXEventsSafeFastCopySpaceQwords;
9115  UINT64 time = PIXGetTimestampCounter();
9116  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9117  *destination++ = color;
9118 
9119  PIXCopyEventArgument(destination, limit, context);
9120  PIXCopyEventArgument(destination, limit, formatString);
9121  PIXCopyEventArgument(destination, limit, a1);
9122 
9123  *destination = PIXEventsBlockEndMarker;
9124  threadInfo->destination = destination;
9125  }
9126  else if (limit != nullptr)
9127  {
9128  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1);
9129  }
9130 }
9131 
9132 template<class T1, class T2>
9133 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2)
9134 {
9135  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9136  UINT64* destination = threadInfo->destination;
9137  UINT64* limit = threadInfo->biasedLimit;
9138  if (destination < limit)
9139  {
9140  limit += PIXEventsSafeFastCopySpaceQwords;
9141  UINT64 time = PIXGetTimestampCounter();
9142  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9143  *destination++ = color;
9144 
9145  PIXCopyEventArgument(destination, limit, context);
9146  PIXCopyEventArgument(destination, limit, formatString);
9147  PIXCopyEventArgument(destination, limit, a1);
9148  PIXCopyEventArgument(destination, limit, a2);
9149 
9150  *destination = PIXEventsBlockEndMarker;
9151  threadInfo->destination = destination;
9152  }
9153  else if (limit != nullptr)
9154  {
9155  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2);
9156  }
9157 }
9158 
9159 template<class T1, class T2, class T3>
9160 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
9161 {
9162  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9163  UINT64* destination = threadInfo->destination;
9164  UINT64* limit = threadInfo->biasedLimit;
9165  if (destination < limit)
9166  {
9167  limit += PIXEventsSafeFastCopySpaceQwords;
9168  UINT64 time = PIXGetTimestampCounter();
9169  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9170  *destination++ = color;
9171 
9172  PIXCopyEventArgument(destination, limit, context);
9173  PIXCopyEventArgument(destination, limit, formatString);
9174  PIXCopyEventArgument(destination, limit, a1);
9175  PIXCopyEventArgument(destination, limit, a2);
9176  PIXCopyEventArgument(destination, limit, a3);
9177 
9178  *destination = PIXEventsBlockEndMarker;
9179  threadInfo->destination = destination;
9180  }
9181  else if (limit != nullptr)
9182  {
9183  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3);
9184  }
9185 }
9186 
9187 template<class T1, class T2, class T3, class T4>
9188 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
9189 {
9190  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9191  UINT64* destination = threadInfo->destination;
9192  UINT64* limit = threadInfo->biasedLimit;
9193  if (destination < limit)
9194  {
9195  limit += PIXEventsSafeFastCopySpaceQwords;
9196  UINT64 time = PIXGetTimestampCounter();
9197  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9198  *destination++ = color;
9199 
9200  PIXCopyEventArgument(destination, limit, context);
9201  PIXCopyEventArgument(destination, limit, formatString);
9202  PIXCopyEventArgument(destination, limit, a1);
9203  PIXCopyEventArgument(destination, limit, a2);
9204  PIXCopyEventArgument(destination, limit, a3);
9205  PIXCopyEventArgument(destination, limit, a4);
9206 
9207  *destination = PIXEventsBlockEndMarker;
9208  threadInfo->destination = destination;
9209  }
9210  else if (limit != nullptr)
9211  {
9212  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4);
9213  }
9214 }
9215 
9216 template<class T1, class T2, class T3, class T4, class T5>
9217 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
9218 {
9219  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9220  UINT64* destination = threadInfo->destination;
9221  UINT64* limit = threadInfo->biasedLimit;
9222  if (destination < limit)
9223  {
9224  limit += PIXEventsSafeFastCopySpaceQwords;
9225  UINT64 time = PIXGetTimestampCounter();
9226  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9227  *destination++ = color;
9228 
9229  PIXCopyEventArgument(destination, limit, context);
9230  PIXCopyEventArgument(destination, limit, formatString);
9231  PIXCopyEventArgument(destination, limit, a1);
9232  PIXCopyEventArgument(destination, limit, a2);
9233  PIXCopyEventArgument(destination, limit, a3);
9234  PIXCopyEventArgument(destination, limit, a4);
9235  PIXCopyEventArgument(destination, limit, a5);
9236 
9237  *destination = PIXEventsBlockEndMarker;
9238  threadInfo->destination = destination;
9239  }
9240  else if (limit != nullptr)
9241  {
9242  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5);
9243  }
9244 }
9245 
9246 template<class T1, class T2, class T3, class T4, class T5, class T6>
9247 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
9248 {
9249  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9250  UINT64* destination = threadInfo->destination;
9251  UINT64* limit = threadInfo->biasedLimit;
9252  if (destination < limit)
9253  {
9254  limit += PIXEventsSafeFastCopySpaceQwords;
9255  UINT64 time = PIXGetTimestampCounter();
9256  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9257  *destination++ = color;
9258 
9259  PIXCopyEventArgument(destination, limit, context);
9260  PIXCopyEventArgument(destination, limit, formatString);
9261  PIXCopyEventArgument(destination, limit, a1);
9262  PIXCopyEventArgument(destination, limit, a2);
9263  PIXCopyEventArgument(destination, limit, a3);
9264  PIXCopyEventArgument(destination, limit, a4);
9265  PIXCopyEventArgument(destination, limit, a5);
9266  PIXCopyEventArgument(destination, limit, a6);
9267 
9268  *destination = PIXEventsBlockEndMarker;
9269  threadInfo->destination = destination;
9270  }
9271  else if (limit != nullptr)
9272  {
9273  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6);
9274  }
9275 }
9276 
9277 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
9278 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
9279 {
9280  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9281  UINT64* destination = threadInfo->destination;
9282  UINT64* limit = threadInfo->biasedLimit;
9283  if (destination < limit)
9284  {
9285  limit += PIXEventsSafeFastCopySpaceQwords;
9286  UINT64 time = PIXGetTimestampCounter();
9287  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9288  *destination++ = color;
9289 
9290  PIXCopyEventArgument(destination, limit, context);
9291  PIXCopyEventArgument(destination, limit, formatString);
9292  PIXCopyEventArgument(destination, limit, a1);
9293  PIXCopyEventArgument(destination, limit, a2);
9294  PIXCopyEventArgument(destination, limit, a3);
9295  PIXCopyEventArgument(destination, limit, a4);
9296  PIXCopyEventArgument(destination, limit, a5);
9297  PIXCopyEventArgument(destination, limit, a6);
9298  PIXCopyEventArgument(destination, limit, a7);
9299 
9300  *destination = PIXEventsBlockEndMarker;
9301  threadInfo->destination = destination;
9302  }
9303  else if (limit != nullptr)
9304  {
9305  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7);
9306  }
9307 }
9308 
9309 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
9310 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
9311 {
9312  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9313  UINT64* destination = threadInfo->destination;
9314  UINT64* limit = threadInfo->biasedLimit;
9315  if (destination < limit)
9316  {
9317  limit += PIXEventsSafeFastCopySpaceQwords;
9318  UINT64 time = PIXGetTimestampCounter();
9319  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9320  *destination++ = color;
9321 
9322  PIXCopyEventArgument(destination, limit, context);
9323  PIXCopyEventArgument(destination, limit, formatString);
9324  PIXCopyEventArgument(destination, limit, a1);
9325  PIXCopyEventArgument(destination, limit, a2);
9326  PIXCopyEventArgument(destination, limit, a3);
9327  PIXCopyEventArgument(destination, limit, a4);
9328  PIXCopyEventArgument(destination, limit, a5);
9329  PIXCopyEventArgument(destination, limit, a6);
9330  PIXCopyEventArgument(destination, limit, a7);
9331  PIXCopyEventArgument(destination, limit, a8);
9332 
9333  *destination = PIXEventsBlockEndMarker;
9334  threadInfo->destination = destination;
9335  }
9336  else if (limit != nullptr)
9337  {
9338  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
9339  }
9340 }
9341 
9342 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
9343 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
9344 {
9345  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9346  UINT64* destination = threadInfo->destination;
9347  UINT64* limit = threadInfo->biasedLimit;
9348  if (destination < limit)
9349  {
9350  limit += PIXEventsSafeFastCopySpaceQwords;
9351  UINT64 time = PIXGetTimestampCounter();
9352  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9353  *destination++ = color;
9354 
9355  PIXCopyEventArgument(destination, limit, context);
9356  PIXCopyEventArgument(destination, limit, formatString);
9357  PIXCopyEventArgument(destination, limit, a1);
9358  PIXCopyEventArgument(destination, limit, a2);
9359  PIXCopyEventArgument(destination, limit, a3);
9360  PIXCopyEventArgument(destination, limit, a4);
9361  PIXCopyEventArgument(destination, limit, a5);
9362  PIXCopyEventArgument(destination, limit, a6);
9363  PIXCopyEventArgument(destination, limit, a7);
9364  PIXCopyEventArgument(destination, limit, a8);
9365  PIXCopyEventArgument(destination, limit, a9);
9366 
9367  *destination = PIXEventsBlockEndMarker;
9368  threadInfo->destination = destination;
9369  }
9370  else if (limit != nullptr)
9371  {
9372  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
9373  }
9374 }
9375 
9376 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
9377 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
9378 {
9379  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9380  UINT64* destination = threadInfo->destination;
9381  UINT64* limit = threadInfo->biasedLimit;
9382  if (destination < limit)
9383  {
9384  limit += PIXEventsSafeFastCopySpaceQwords;
9385  UINT64 time = PIXGetTimestampCounter();
9386  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9387  *destination++ = color;
9388 
9389  PIXCopyEventArgument(destination, limit, context);
9390  PIXCopyEventArgument(destination, limit, formatString);
9391  PIXCopyEventArgument(destination, limit, a1);
9392  PIXCopyEventArgument(destination, limit, a2);
9393  PIXCopyEventArgument(destination, limit, a3);
9394  PIXCopyEventArgument(destination, limit, a4);
9395  PIXCopyEventArgument(destination, limit, a5);
9396  PIXCopyEventArgument(destination, limit, a6);
9397  PIXCopyEventArgument(destination, limit, a7);
9398  PIXCopyEventArgument(destination, limit, a8);
9399  PIXCopyEventArgument(destination, limit, a9);
9400  PIXCopyEventArgument(destination, limit, a10);
9401 
9402  *destination = PIXEventsBlockEndMarker;
9403  threadInfo->destination = destination;
9404  }
9405  else if (limit != nullptr)
9406  {
9407  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
9408  }
9409 }
9410 
9411 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
9412 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
9413 {
9414  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9415  UINT64* destination = threadInfo->destination;
9416  UINT64* limit = threadInfo->biasedLimit;
9417  if (destination < limit)
9418  {
9419  limit += PIXEventsSafeFastCopySpaceQwords;
9420  UINT64 time = PIXGetTimestampCounter();
9421  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9422  *destination++ = color;
9423 
9424  PIXCopyEventArgument(destination, limit, context);
9425  PIXCopyEventArgument(destination, limit, formatString);
9426  PIXCopyEventArgument(destination, limit, a1);
9427  PIXCopyEventArgument(destination, limit, a2);
9428  PIXCopyEventArgument(destination, limit, a3);
9429  PIXCopyEventArgument(destination, limit, a4);
9430  PIXCopyEventArgument(destination, limit, a5);
9431  PIXCopyEventArgument(destination, limit, a6);
9432  PIXCopyEventArgument(destination, limit, a7);
9433  PIXCopyEventArgument(destination, limit, a8);
9434  PIXCopyEventArgument(destination, limit, a9);
9435  PIXCopyEventArgument(destination, limit, a10);
9436  PIXCopyEventArgument(destination, limit, a11);
9437 
9438  *destination = PIXEventsBlockEndMarker;
9439  threadInfo->destination = destination;
9440  }
9441  else if (limit != nullptr)
9442  {
9443  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
9444  }
9445 }
9446 
9447 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
9448 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
9449 {
9450  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9451  UINT64* destination = threadInfo->destination;
9452  UINT64* limit = threadInfo->biasedLimit;
9453  if (destination < limit)
9454  {
9455  limit += PIXEventsSafeFastCopySpaceQwords;
9456  UINT64 time = PIXGetTimestampCounter();
9457  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9458  *destination++ = color;
9459 
9460  PIXCopyEventArgument(destination, limit, context);
9461  PIXCopyEventArgument(destination, limit, formatString);
9462  PIXCopyEventArgument(destination, limit, a1);
9463  PIXCopyEventArgument(destination, limit, a2);
9464  PIXCopyEventArgument(destination, limit, a3);
9465  PIXCopyEventArgument(destination, limit, a4);
9466  PIXCopyEventArgument(destination, limit, a5);
9467  PIXCopyEventArgument(destination, limit, a6);
9468  PIXCopyEventArgument(destination, limit, a7);
9469  PIXCopyEventArgument(destination, limit, a8);
9470  PIXCopyEventArgument(destination, limit, a9);
9471  PIXCopyEventArgument(destination, limit, a10);
9472  PIXCopyEventArgument(destination, limit, a11);
9473  PIXCopyEventArgument(destination, limit, a12);
9474 
9475  *destination = PIXEventsBlockEndMarker;
9476  threadInfo->destination = destination;
9477  }
9478  else if (limit != nullptr)
9479  {
9480  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
9481  }
9482 }
9483 
9484 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
9485 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
9486 {
9487  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9488  UINT64* destination = threadInfo->destination;
9489  UINT64* limit = threadInfo->biasedLimit;
9490  if (destination < limit)
9491  {
9492  limit += PIXEventsSafeFastCopySpaceQwords;
9493  UINT64 time = PIXGetTimestampCounter();
9494  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9495  *destination++ = color;
9496 
9497  PIXCopyEventArgument(destination, limit, context);
9498  PIXCopyEventArgument(destination, limit, formatString);
9499  PIXCopyEventArgument(destination, limit, a1);
9500  PIXCopyEventArgument(destination, limit, a2);
9501  PIXCopyEventArgument(destination, limit, a3);
9502  PIXCopyEventArgument(destination, limit, a4);
9503  PIXCopyEventArgument(destination, limit, a5);
9504  PIXCopyEventArgument(destination, limit, a6);
9505  PIXCopyEventArgument(destination, limit, a7);
9506  PIXCopyEventArgument(destination, limit, a8);
9507  PIXCopyEventArgument(destination, limit, a9);
9508  PIXCopyEventArgument(destination, limit, a10);
9509  PIXCopyEventArgument(destination, limit, a11);
9510  PIXCopyEventArgument(destination, limit, a12);
9511  PIXCopyEventArgument(destination, limit, a13);
9512 
9513  *destination = PIXEventsBlockEndMarker;
9514  threadInfo->destination = destination;
9515  }
9516  else if (limit != nullptr)
9517  {
9518  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
9519  }
9520 }
9521 
9522 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
9523 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
9524 {
9525  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9526  UINT64* destination = threadInfo->destination;
9527  UINT64* limit = threadInfo->biasedLimit;
9528  if (destination < limit)
9529  {
9530  limit += PIXEventsSafeFastCopySpaceQwords;
9531  UINT64 time = PIXGetTimestampCounter();
9532  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9533  *destination++ = color;
9534 
9535  PIXCopyEventArgument(destination, limit, context);
9536  PIXCopyEventArgument(destination, limit, formatString);
9537  PIXCopyEventArgument(destination, limit, a1);
9538  PIXCopyEventArgument(destination, limit, a2);
9539  PIXCopyEventArgument(destination, limit, a3);
9540  PIXCopyEventArgument(destination, limit, a4);
9541  PIXCopyEventArgument(destination, limit, a5);
9542  PIXCopyEventArgument(destination, limit, a6);
9543  PIXCopyEventArgument(destination, limit, a7);
9544  PIXCopyEventArgument(destination, limit, a8);
9545  PIXCopyEventArgument(destination, limit, a9);
9546  PIXCopyEventArgument(destination, limit, a10);
9547  PIXCopyEventArgument(destination, limit, a11);
9548  PIXCopyEventArgument(destination, limit, a12);
9549  PIXCopyEventArgument(destination, limit, a13);
9550  PIXCopyEventArgument(destination, limit, a14);
9551 
9552  *destination = PIXEventsBlockEndMarker;
9553  threadInfo->destination = destination;
9554  }
9555  else if (limit != nullptr)
9556  {
9557  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
9558  }
9559 }
9560 
9561 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
9562 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
9563 {
9564  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9565  UINT64* destination = threadInfo->destination;
9566  UINT64* limit = threadInfo->biasedLimit;
9567  if (destination < limit)
9568  {
9569  limit += PIXEventsSafeFastCopySpaceQwords;
9570  UINT64 time = PIXGetTimestampCounter();
9571  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9572  *destination++ = color;
9573 
9574  PIXCopyEventArgument(destination, limit, context);
9575  PIXCopyEventArgument(destination, limit, formatString);
9576  PIXCopyEventArgument(destination, limit, a1);
9577  PIXCopyEventArgument(destination, limit, a2);
9578  PIXCopyEventArgument(destination, limit, a3);
9579  PIXCopyEventArgument(destination, limit, a4);
9580  PIXCopyEventArgument(destination, limit, a5);
9581  PIXCopyEventArgument(destination, limit, a6);
9582  PIXCopyEventArgument(destination, limit, a7);
9583  PIXCopyEventArgument(destination, limit, a8);
9584  PIXCopyEventArgument(destination, limit, a9);
9585  PIXCopyEventArgument(destination, limit, a10);
9586  PIXCopyEventArgument(destination, limit, a11);
9587  PIXCopyEventArgument(destination, limit, a12);
9588  PIXCopyEventArgument(destination, limit, a13);
9589  PIXCopyEventArgument(destination, limit, a14);
9590  PIXCopyEventArgument(destination, limit, a15);
9591 
9592  *destination = PIXEventsBlockEndMarker;
9593  threadInfo->destination = destination;
9594  }
9595  else if (limit != nullptr)
9596  {
9597  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
9598  }
9599 }
9600 
9601 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
9602 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
9603 {
9604  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9605  UINT64* destination = threadInfo->destination;
9606  UINT64* limit = threadInfo->biasedLimit;
9607  if (destination < limit)
9608  {
9609  limit += PIXEventsSafeFastCopySpaceQwords;
9610  UINT64 time = PIXGetTimestampCounter();
9611  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9612  *destination++ = color;
9613 
9614  PIXCopyEventArgument(destination, limit, context);
9615  PIXCopyEventArgument(destination, limit, formatString);
9616  PIXCopyEventArgument(destination, limit, a1);
9617  PIXCopyEventArgument(destination, limit, a2);
9618  PIXCopyEventArgument(destination, limit, a3);
9619  PIXCopyEventArgument(destination, limit, a4);
9620  PIXCopyEventArgument(destination, limit, a5);
9621  PIXCopyEventArgument(destination, limit, a6);
9622  PIXCopyEventArgument(destination, limit, a7);
9623  PIXCopyEventArgument(destination, limit, a8);
9624  PIXCopyEventArgument(destination, limit, a9);
9625  PIXCopyEventArgument(destination, limit, a10);
9626  PIXCopyEventArgument(destination, limit, a11);
9627  PIXCopyEventArgument(destination, limit, a12);
9628  PIXCopyEventArgument(destination, limit, a13);
9629  PIXCopyEventArgument(destination, limit, a14);
9630  PIXCopyEventArgument(destination, limit, a15);
9631  PIXCopyEventArgument(destination, limit, a16);
9632 
9633  *destination = PIXEventsBlockEndMarker;
9634  threadInfo->destination = destination;
9635  }
9636  else if (limit != nullptr)
9637  {
9638  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
9639  }
9640 }
9641 
9642 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString)
9643 {
9644  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9645  UINT64* destination = threadInfo->destination;
9646  UINT64* limit = threadInfo->biasedLimit;
9647  if (destination < limit)
9648  {
9649  limit += PIXEventsSafeFastCopySpaceQwords;
9650  UINT64 time = PIXGetTimestampCounter();
9651  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_NoArgs);
9652  *destination++ = color;
9653 
9654  PIXCopyEventArgument(destination, limit, context);
9655  PIXCopyEventArgument(destination, limit, formatString);
9656 
9657  *destination = PIXEventsBlockEndMarker;
9658  threadInfo->destination = destination;
9659  }
9660  else if (limit != nullptr)
9661  {
9662  MakeCPUBeginEventForContextAllocate(color, context, formatString);
9663  }
9664 }
9665 
9666 template<class T1>
9667 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1)
9668 {
9669  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9670  UINT64* destination = threadInfo->destination;
9671  UINT64* limit = threadInfo->biasedLimit;
9672  if (destination < limit)
9673  {
9674  limit += PIXEventsSafeFastCopySpaceQwords;
9675  UINT64 time = PIXGetTimestampCounter();
9676  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9677  *destination++ = color;
9678 
9679  PIXCopyEventArgument(destination, limit, context);
9680  PIXCopyEventArgument(destination, limit, formatString);
9681  PIXCopyEventArgument(destination, limit, a1);
9682 
9683  *destination = PIXEventsBlockEndMarker;
9684  threadInfo->destination = destination;
9685  }
9686  else if (limit != nullptr)
9687  {
9688  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1);
9689  }
9690 }
9691 
9692 template<class T1, class T2>
9693 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2)
9694 {
9695  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9696  UINT64* destination = threadInfo->destination;
9697  UINT64* limit = threadInfo->biasedLimit;
9698  if (destination < limit)
9699  {
9700  limit += PIXEventsSafeFastCopySpaceQwords;
9701  UINT64 time = PIXGetTimestampCounter();
9702  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9703  *destination++ = color;
9704 
9705  PIXCopyEventArgument(destination, limit, context);
9706  PIXCopyEventArgument(destination, limit, formatString);
9707  PIXCopyEventArgument(destination, limit, a1);
9708  PIXCopyEventArgument(destination, limit, a2);
9709 
9710  *destination = PIXEventsBlockEndMarker;
9711  threadInfo->destination = destination;
9712  }
9713  else if (limit != nullptr)
9714  {
9715  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2);
9716  }
9717 }
9718 
9719 template<class T1, class T2, class T3>
9720 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
9721 {
9722  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9723  UINT64* destination = threadInfo->destination;
9724  UINT64* limit = threadInfo->biasedLimit;
9725  if (destination < limit)
9726  {
9727  limit += PIXEventsSafeFastCopySpaceQwords;
9728  UINT64 time = PIXGetTimestampCounter();
9729  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9730  *destination++ = color;
9731 
9732  PIXCopyEventArgument(destination, limit, context);
9733  PIXCopyEventArgument(destination, limit, formatString);
9734  PIXCopyEventArgument(destination, limit, a1);
9735  PIXCopyEventArgument(destination, limit, a2);
9736  PIXCopyEventArgument(destination, limit, a3);
9737 
9738  *destination = PIXEventsBlockEndMarker;
9739  threadInfo->destination = destination;
9740  }
9741  else if (limit != nullptr)
9742  {
9743  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3);
9744  }
9745 }
9746 
9747 template<class T1, class T2, class T3, class T4>
9748 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
9749 {
9750  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9751  UINT64* destination = threadInfo->destination;
9752  UINT64* limit = threadInfo->biasedLimit;
9753  if (destination < limit)
9754  {
9755  limit += PIXEventsSafeFastCopySpaceQwords;
9756  UINT64 time = PIXGetTimestampCounter();
9757  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9758  *destination++ = color;
9759 
9760  PIXCopyEventArgument(destination, limit, context);
9761  PIXCopyEventArgument(destination, limit, formatString);
9762  PIXCopyEventArgument(destination, limit, a1);
9763  PIXCopyEventArgument(destination, limit, a2);
9764  PIXCopyEventArgument(destination, limit, a3);
9765  PIXCopyEventArgument(destination, limit, a4);
9766 
9767  *destination = PIXEventsBlockEndMarker;
9768  threadInfo->destination = destination;
9769  }
9770  else if (limit != nullptr)
9771  {
9772  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4);
9773  }
9774 }
9775 
9776 template<class T1, class T2, class T3, class T4, class T5>
9777 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
9778 {
9779  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9780  UINT64* destination = threadInfo->destination;
9781  UINT64* limit = threadInfo->biasedLimit;
9782  if (destination < limit)
9783  {
9784  limit += PIXEventsSafeFastCopySpaceQwords;
9785  UINT64 time = PIXGetTimestampCounter();
9786  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9787  *destination++ = color;
9788 
9789  PIXCopyEventArgument(destination, limit, context);
9790  PIXCopyEventArgument(destination, limit, formatString);
9791  PIXCopyEventArgument(destination, limit, a1);
9792  PIXCopyEventArgument(destination, limit, a2);
9793  PIXCopyEventArgument(destination, limit, a3);
9794  PIXCopyEventArgument(destination, limit, a4);
9795  PIXCopyEventArgument(destination, limit, a5);
9796 
9797  *destination = PIXEventsBlockEndMarker;
9798  threadInfo->destination = destination;
9799  }
9800  else if (limit != nullptr)
9801  {
9802  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5);
9803  }
9804 }
9805 
9806 template<class T1, class T2, class T3, class T4, class T5, class T6>
9807 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
9808 {
9809  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9810  UINT64* destination = threadInfo->destination;
9811  UINT64* limit = threadInfo->biasedLimit;
9812  if (destination < limit)
9813  {
9814  limit += PIXEventsSafeFastCopySpaceQwords;
9815  UINT64 time = PIXGetTimestampCounter();
9816  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9817  *destination++ = color;
9818 
9819  PIXCopyEventArgument(destination, limit, context);
9820  PIXCopyEventArgument(destination, limit, formatString);
9821  PIXCopyEventArgument(destination, limit, a1);
9822  PIXCopyEventArgument(destination, limit, a2);
9823  PIXCopyEventArgument(destination, limit, a3);
9824  PIXCopyEventArgument(destination, limit, a4);
9825  PIXCopyEventArgument(destination, limit, a5);
9826  PIXCopyEventArgument(destination, limit, a6);
9827 
9828  *destination = PIXEventsBlockEndMarker;
9829  threadInfo->destination = destination;
9830  }
9831  else if (limit != nullptr)
9832  {
9833  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6);
9834  }
9835 }
9836 
9837 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
9838 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
9839 {
9840  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9841  UINT64* destination = threadInfo->destination;
9842  UINT64* limit = threadInfo->biasedLimit;
9843  if (destination < limit)
9844  {
9845  limit += PIXEventsSafeFastCopySpaceQwords;
9846  UINT64 time = PIXGetTimestampCounter();
9847  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9848  *destination++ = color;
9849 
9850  PIXCopyEventArgument(destination, limit, context);
9851  PIXCopyEventArgument(destination, limit, formatString);
9852  PIXCopyEventArgument(destination, limit, a1);
9853  PIXCopyEventArgument(destination, limit, a2);
9854  PIXCopyEventArgument(destination, limit, a3);
9855  PIXCopyEventArgument(destination, limit, a4);
9856  PIXCopyEventArgument(destination, limit, a5);
9857  PIXCopyEventArgument(destination, limit, a6);
9858  PIXCopyEventArgument(destination, limit, a7);
9859 
9860  *destination = PIXEventsBlockEndMarker;
9861  threadInfo->destination = destination;
9862  }
9863  else if (limit != nullptr)
9864  {
9865  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7);
9866  }
9867 }
9868 
9869 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
9870 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
9871 {
9872  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9873  UINT64* destination = threadInfo->destination;
9874  UINT64* limit = threadInfo->biasedLimit;
9875  if (destination < limit)
9876  {
9877  limit += PIXEventsSafeFastCopySpaceQwords;
9878  UINT64 time = PIXGetTimestampCounter();
9879  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9880  *destination++ = color;
9881 
9882  PIXCopyEventArgument(destination, limit, context);
9883  PIXCopyEventArgument(destination, limit, formatString);
9884  PIXCopyEventArgument(destination, limit, a1);
9885  PIXCopyEventArgument(destination, limit, a2);
9886  PIXCopyEventArgument(destination, limit, a3);
9887  PIXCopyEventArgument(destination, limit, a4);
9888  PIXCopyEventArgument(destination, limit, a5);
9889  PIXCopyEventArgument(destination, limit, a6);
9890  PIXCopyEventArgument(destination, limit, a7);
9891  PIXCopyEventArgument(destination, limit, a8);
9892 
9893  *destination = PIXEventsBlockEndMarker;
9894  threadInfo->destination = destination;
9895  }
9896  else if (limit != nullptr)
9897  {
9898  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
9899  }
9900 }
9901 
9902 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
9903 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
9904 {
9905  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9906  UINT64* destination = threadInfo->destination;
9907  UINT64* limit = threadInfo->biasedLimit;
9908  if (destination < limit)
9909  {
9910  limit += PIXEventsSafeFastCopySpaceQwords;
9911  UINT64 time = PIXGetTimestampCounter();
9912  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9913  *destination++ = color;
9914 
9915  PIXCopyEventArgument(destination, limit, context);
9916  PIXCopyEventArgument(destination, limit, formatString);
9917  PIXCopyEventArgument(destination, limit, a1);
9918  PIXCopyEventArgument(destination, limit, a2);
9919  PIXCopyEventArgument(destination, limit, a3);
9920  PIXCopyEventArgument(destination, limit, a4);
9921  PIXCopyEventArgument(destination, limit, a5);
9922  PIXCopyEventArgument(destination, limit, a6);
9923  PIXCopyEventArgument(destination, limit, a7);
9924  PIXCopyEventArgument(destination, limit, a8);
9925  PIXCopyEventArgument(destination, limit, a9);
9926 
9927  *destination = PIXEventsBlockEndMarker;
9928  threadInfo->destination = destination;
9929  }
9930  else if (limit != nullptr)
9931  {
9932  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
9933  }
9934 }
9935 
9936 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
9937 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
9938 {
9939  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9940  UINT64* destination = threadInfo->destination;
9941  UINT64* limit = threadInfo->biasedLimit;
9942  if (destination < limit)
9943  {
9944  limit += PIXEventsSafeFastCopySpaceQwords;
9945  UINT64 time = PIXGetTimestampCounter();
9946  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9947  *destination++ = color;
9948 
9949  PIXCopyEventArgument(destination, limit, context);
9950  PIXCopyEventArgument(destination, limit, formatString);
9951  PIXCopyEventArgument(destination, limit, a1);
9952  PIXCopyEventArgument(destination, limit, a2);
9953  PIXCopyEventArgument(destination, limit, a3);
9954  PIXCopyEventArgument(destination, limit, a4);
9955  PIXCopyEventArgument(destination, limit, a5);
9956  PIXCopyEventArgument(destination, limit, a6);
9957  PIXCopyEventArgument(destination, limit, a7);
9958  PIXCopyEventArgument(destination, limit, a8);
9959  PIXCopyEventArgument(destination, limit, a9);
9960  PIXCopyEventArgument(destination, limit, a10);
9961 
9962  *destination = PIXEventsBlockEndMarker;
9963  threadInfo->destination = destination;
9964  }
9965  else if (limit != nullptr)
9966  {
9967  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
9968  }
9969 }
9970 
9971 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
9972 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
9973 {
9974  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
9975  UINT64* destination = threadInfo->destination;
9976  UINT64* limit = threadInfo->biasedLimit;
9977  if (destination < limit)
9978  {
9979  limit += PIXEventsSafeFastCopySpaceQwords;
9980  UINT64 time = PIXGetTimestampCounter();
9981  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
9982  *destination++ = color;
9983 
9984  PIXCopyEventArgument(destination, limit, context);
9985  PIXCopyEventArgument(destination, limit, formatString);
9986  PIXCopyEventArgument(destination, limit, a1);
9987  PIXCopyEventArgument(destination, limit, a2);
9988  PIXCopyEventArgument(destination, limit, a3);
9989  PIXCopyEventArgument(destination, limit, a4);
9990  PIXCopyEventArgument(destination, limit, a5);
9991  PIXCopyEventArgument(destination, limit, a6);
9992  PIXCopyEventArgument(destination, limit, a7);
9993  PIXCopyEventArgument(destination, limit, a8);
9994  PIXCopyEventArgument(destination, limit, a9);
9995  PIXCopyEventArgument(destination, limit, a10);
9996  PIXCopyEventArgument(destination, limit, a11);
9997 
9998  *destination = PIXEventsBlockEndMarker;
9999  threadInfo->destination = destination;
10000  }
10001  else if (limit != nullptr)
10002  {
10003  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
10004  }
10005 }
10006 
10007 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
10008 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
10009 {
10010  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10011  UINT64* destination = threadInfo->destination;
10012  UINT64* limit = threadInfo->biasedLimit;
10013  if (destination < limit)
10014  {
10015  limit += PIXEventsSafeFastCopySpaceQwords;
10016  UINT64 time = PIXGetTimestampCounter();
10017  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
10018  *destination++ = color;
10019 
10020  PIXCopyEventArgument(destination, limit, context);
10021  PIXCopyEventArgument(destination, limit, formatString);
10022  PIXCopyEventArgument(destination, limit, a1);
10023  PIXCopyEventArgument(destination, limit, a2);
10024  PIXCopyEventArgument(destination, limit, a3);
10025  PIXCopyEventArgument(destination, limit, a4);
10026  PIXCopyEventArgument(destination, limit, a5);
10027  PIXCopyEventArgument(destination, limit, a6);
10028  PIXCopyEventArgument(destination, limit, a7);
10029  PIXCopyEventArgument(destination, limit, a8);
10030  PIXCopyEventArgument(destination, limit, a9);
10031  PIXCopyEventArgument(destination, limit, a10);
10032  PIXCopyEventArgument(destination, limit, a11);
10033  PIXCopyEventArgument(destination, limit, a12);
10034 
10035  *destination = PIXEventsBlockEndMarker;
10036  threadInfo->destination = destination;
10037  }
10038  else if (limit != nullptr)
10039  {
10040  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
10041  }
10042 }
10043 
10044 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
10045 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
10046 {
10047  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10048  UINT64* destination = threadInfo->destination;
10049  UINT64* limit = threadInfo->biasedLimit;
10050  if (destination < limit)
10051  {
10052  limit += PIXEventsSafeFastCopySpaceQwords;
10053  UINT64 time = PIXGetTimestampCounter();
10054  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
10055  *destination++ = color;
10056 
10057  PIXCopyEventArgument(destination, limit, context);
10058  PIXCopyEventArgument(destination, limit, formatString);
10059  PIXCopyEventArgument(destination, limit, a1);
10060  PIXCopyEventArgument(destination, limit, a2);
10061  PIXCopyEventArgument(destination, limit, a3);
10062  PIXCopyEventArgument(destination, limit, a4);
10063  PIXCopyEventArgument(destination, limit, a5);
10064  PIXCopyEventArgument(destination, limit, a6);
10065  PIXCopyEventArgument(destination, limit, a7);
10066  PIXCopyEventArgument(destination, limit, a8);
10067  PIXCopyEventArgument(destination, limit, a9);
10068  PIXCopyEventArgument(destination, limit, a10);
10069  PIXCopyEventArgument(destination, limit, a11);
10070  PIXCopyEventArgument(destination, limit, a12);
10071  PIXCopyEventArgument(destination, limit, a13);
10072 
10073  *destination = PIXEventsBlockEndMarker;
10074  threadInfo->destination = destination;
10075  }
10076  else if (limit != nullptr)
10077  {
10078  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
10079  }
10080 }
10081 
10082 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
10083 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
10084 {
10085  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10086  UINT64* destination = threadInfo->destination;
10087  UINT64* limit = threadInfo->biasedLimit;
10088  if (destination < limit)
10089  {
10090  limit += PIXEventsSafeFastCopySpaceQwords;
10091  UINT64 time = PIXGetTimestampCounter();
10092  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
10093  *destination++ = color;
10094 
10095  PIXCopyEventArgument(destination, limit, context);
10096  PIXCopyEventArgument(destination, limit, formatString);
10097  PIXCopyEventArgument(destination, limit, a1);
10098  PIXCopyEventArgument(destination, limit, a2);
10099  PIXCopyEventArgument(destination, limit, a3);
10100  PIXCopyEventArgument(destination, limit, a4);
10101  PIXCopyEventArgument(destination, limit, a5);
10102  PIXCopyEventArgument(destination, limit, a6);
10103  PIXCopyEventArgument(destination, limit, a7);
10104  PIXCopyEventArgument(destination, limit, a8);
10105  PIXCopyEventArgument(destination, limit, a9);
10106  PIXCopyEventArgument(destination, limit, a10);
10107  PIXCopyEventArgument(destination, limit, a11);
10108  PIXCopyEventArgument(destination, limit, a12);
10109  PIXCopyEventArgument(destination, limit, a13);
10110  PIXCopyEventArgument(destination, limit, a14);
10111 
10112  *destination = PIXEventsBlockEndMarker;
10113  threadInfo->destination = destination;
10114  }
10115  else if (limit != nullptr)
10116  {
10117  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
10118  }
10119 }
10120 
10121 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
10122 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
10123 {
10124  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10125  UINT64* destination = threadInfo->destination;
10126  UINT64* limit = threadInfo->biasedLimit;
10127  if (destination < limit)
10128  {
10129  limit += PIXEventsSafeFastCopySpaceQwords;
10130  UINT64 time = PIXGetTimestampCounter();
10131  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
10132  *destination++ = color;
10133 
10134  PIXCopyEventArgument(destination, limit, context);
10135  PIXCopyEventArgument(destination, limit, formatString);
10136  PIXCopyEventArgument(destination, limit, a1);
10137  PIXCopyEventArgument(destination, limit, a2);
10138  PIXCopyEventArgument(destination, limit, a3);
10139  PIXCopyEventArgument(destination, limit, a4);
10140  PIXCopyEventArgument(destination, limit, a5);
10141  PIXCopyEventArgument(destination, limit, a6);
10142  PIXCopyEventArgument(destination, limit, a7);
10143  PIXCopyEventArgument(destination, limit, a8);
10144  PIXCopyEventArgument(destination, limit, a9);
10145  PIXCopyEventArgument(destination, limit, a10);
10146  PIXCopyEventArgument(destination, limit, a11);
10147  PIXCopyEventArgument(destination, limit, a12);
10148  PIXCopyEventArgument(destination, limit, a13);
10149  PIXCopyEventArgument(destination, limit, a14);
10150  PIXCopyEventArgument(destination, limit, a15);
10151 
10152  *destination = PIXEventsBlockEndMarker;
10153  threadInfo->destination = destination;
10154  }
10155  else if (limit != nullptr)
10156  {
10157  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
10158  }
10159 }
10160 
10161 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
10162 inline void MakeCPUBeginEventForContext(UINT64 color, PVOID context, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
10163 {
10164  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10165  UINT64* destination = threadInfo->destination;
10166  UINT64* limit = threadInfo->biasedLimit;
10167  if (destination < limit)
10168  {
10169  limit += PIXEventsSafeFastCopySpaceQwords;
10170  UINT64 time = PIXGetTimestampCounter();
10171  *destination++ = PIXEncodeEventInfo(time, PIXEvent_BeginEvent_OnContext_VarArgs);
10172  *destination++ = color;
10173 
10174  PIXCopyEventArgument(destination, limit, context);
10175  PIXCopyEventArgument(destination, limit, formatString);
10176  PIXCopyEventArgument(destination, limit, a1);
10177  PIXCopyEventArgument(destination, limit, a2);
10178  PIXCopyEventArgument(destination, limit, a3);
10179  PIXCopyEventArgument(destination, limit, a4);
10180  PIXCopyEventArgument(destination, limit, a5);
10181  PIXCopyEventArgument(destination, limit, a6);
10182  PIXCopyEventArgument(destination, limit, a7);
10183  PIXCopyEventArgument(destination, limit, a8);
10184  PIXCopyEventArgument(destination, limit, a9);
10185  PIXCopyEventArgument(destination, limit, a10);
10186  PIXCopyEventArgument(destination, limit, a11);
10187  PIXCopyEventArgument(destination, limit, a12);
10188  PIXCopyEventArgument(destination, limit, a13);
10189  PIXCopyEventArgument(destination, limit, a14);
10190  PIXCopyEventArgument(destination, limit, a15);
10191  PIXCopyEventArgument(destination, limit, a16);
10192 
10193  *destination = PIXEventsBlockEndMarker;
10194  threadInfo->destination = destination;
10195  }
10196  else if (limit != nullptr)
10197  {
10198  MakeCPUBeginEventForContextAllocate(color, context, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
10199  }
10200 }
10201 
10202 
10203 __declspec(noinline) inline void PIXEndEventAllocate()
10204 {
10205  UINT64 time = PIXEventsReplaceBlock(true);
10206  if (time)
10207  {
10208  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10209  UINT64* destination = threadInfo->destination;
10210  UINT64* limit = threadInfo->limit;
10211  if (destination < limit)
10212  {
10213  *destination++ = PIXEncodeEventInfo(time, PIXEvent_EndEvent);
10214  *destination = PIXEventsBlockEndMarker;
10215  threadInfo->destination = destination;
10216  }
10217  }
10218 }
10219 
10220 inline void PIXEndEvent()
10221 {
10222  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10223  UINT64* destination = threadInfo->destination;
10224  UINT64* limit = threadInfo->limit;
10225  if (destination < limit)
10226  {
10227  UINT64 time = PIXGetTimestampCounter();
10228  *destination++ = PIXEncodeEventInfo(time, PIXEvent_EndEvent);
10229  *destination = PIXEventsBlockEndMarker;
10230  threadInfo->destination = destination;
10231  }
10232  else if (limit != nullptr)
10233  {
10234  PIXEndEventAllocate();
10235  }
10236 }
10237 
10238 __declspec(noinline) inline void MakeCPUEndEventForContextAllocate(PVOID context)
10239 {
10240  UINT64 time = PIXEventsReplaceBlock(true);
10241  if (time)
10242  {
10243  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10244  UINT64* destination = threadInfo->destination;
10245  UINT64* limit = threadInfo->limit;
10246  if (destination < limit)
10247  {
10248  *destination++ = PIXEncodeEventInfo(time, PIXEvent_EndEvent_OnContext);
10249  PIXCopyEventArgument(destination, limit, context);
10250  *destination = PIXEventsBlockEndMarker;
10251  threadInfo->destination = destination;
10252  }
10253  }
10254 }
10255 
10256 inline void MakeCPUEndEventForContext(PVOID context)
10257 {
10258  PIXEventsThreadInfo* threadInfo = PIXGetThreadInfo();
10259  UINT64* destination = threadInfo->destination;
10260  UINT64* limit = threadInfo->biasedLimit;
10261  if (destination < limit)
10262  {
10263  limit += PIXEventsSafeFastCopySpaceQwords;
10264  UINT64 time = PIXGetTimestampCounter();
10265  *destination++ = PIXEncodeEventInfo(time, PIXEvent_EndEvent_OnContext);
10266  PIXCopyEventArgument(destination, limit, context);
10267  *destination = PIXEventsBlockEndMarker;
10268  threadInfo->destination = destination;
10269  }
10270  else if (limit != nullptr)
10271  {
10272  MakeCPUEndEventForContextAllocate(context);
10273  }
10274 }
10275 
10276 template<class TContext>
10277 inline void PIXEndEvent(TContext* context)
10278 {
10279  PIXEndCPUEventOnContext(context);
10280  PIXEndEventOnContext(context);
10281 }
10282 
10283 template<class TContext>
10285 {
10286 private:
10287  TContext* m_context;
10288 
10289 public:
10290  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString)
10291  : m_context(context)
10292  {
10293  PIXBeginEvent(context, color, formatString);
10294  }
10295 
10296  template<class T1>
10297  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1)
10298  : m_context(context)
10299  {
10300  PIXBeginEvent(context, color, formatString, a1);
10301  }
10302 
10303  template<class T1, class T2>
10304  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
10305  : m_context(context)
10306  {
10307  PIXBeginEvent(context, color, formatString, a1, a2);
10308  }
10309 
10310  template<class T1, class T2, class T3>
10311  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
10312  : m_context(context)
10313  {
10314  PIXBeginEvent(context, color, formatString, a1, a2, a3);
10315  }
10316 
10317  template<class T1, class T2, class T3, class T4>
10318  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
10319  : m_context(context)
10320  {
10321  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4);
10322  }
10323 
10324  template<class T1, class T2, class T3, class T4, class T5>
10325  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
10326  : m_context(context)
10327  {
10328  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5);
10329  }
10330 
10331  template<class T1, class T2, class T3, class T4, class T5, class T6>
10332  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
10333  : m_context(context)
10334  {
10335  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6);
10336  }
10337 
10338  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
10339  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
10340  : m_context(context)
10341  {
10342  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
10343  }
10344 
10345  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
10346  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
10347  : m_context(context)
10348  {
10349  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
10350  }
10351 
10352  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
10353  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
10354  : m_context(context)
10355  {
10356  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
10357  }
10358 
10359  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
10360  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
10361  : m_context(context)
10362  {
10363  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
10364  }
10365 
10366  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
10367  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
10368  : m_context(context)
10369  {
10370  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
10371  }
10372 
10373  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
10374  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
10375  : m_context(context)
10376  {
10377  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
10378  }
10379 
10380  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
10381  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
10382  : m_context(context)
10383  {
10384  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
10385  }
10386 
10387  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
10388  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
10389  : m_context(context)
10390  {
10391  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
10392  }
10393 
10394  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
10395  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
10396  : m_context(context)
10397  {
10398  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
10399  }
10400 
10401  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
10402  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
10403  : m_context(context)
10404  {
10405  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
10406  }
10407 
10408  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString)
10409  : m_context(context)
10410  {
10411  PIXBeginEvent(context, color, formatString);
10412  }
10413 
10414  template<class T1>
10415  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1)
10416  : m_context(context)
10417  {
10418  PIXBeginEvent(context, color, formatString, a1);
10419  }
10420 
10421  template<class T1, class T2>
10422  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
10423  : m_context(context)
10424  {
10425  PIXBeginEvent(context, color, formatString, a1, a2);
10426  }
10427 
10428  template<class T1, class T2, class T3>
10429  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
10430  : m_context(context)
10431  {
10432  PIXBeginEvent(context, color, formatString, a1, a2, a3);
10433  }
10434 
10435  template<class T1, class T2, class T3, class T4>
10436  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
10437  : m_context(context)
10438  {
10439  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4);
10440  }
10441 
10442  template<class T1, class T2, class T3, class T4, class T5>
10443  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
10444  : m_context(context)
10445  {
10446  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5);
10447  }
10448 
10449  template<class T1, class T2, class T3, class T4, class T5, class T6>
10450  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
10451  : m_context(context)
10452  {
10453  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6);
10454  }
10455 
10456  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
10457  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
10458  : m_context(context)
10459  {
10460  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7);
10461  }
10462 
10463  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
10464  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
10465  : m_context(context)
10466  {
10467  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
10468  }
10469 
10470  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
10471  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
10472  : m_context(context)
10473  {
10474  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
10475  }
10476 
10477  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
10478  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
10479  : m_context(context)
10480  {
10481  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
10482  }
10483 
10484  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
10485  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
10486  : m_context(context)
10487  {
10488  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
10489  }
10490 
10491  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
10492  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
10493  : m_context(context)
10494  {
10495  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
10496  }
10497 
10498  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
10499  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
10500  : m_context(context)
10501  {
10502  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
10503  }
10504 
10505  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
10506  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
10507  : m_context(context)
10508  {
10509  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
10510  }
10511 
10512  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
10513  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
10514  : m_context(context)
10515  {
10516  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
10517  }
10518 
10519  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
10520  PIXScopedEventObject(TContext* context, UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
10521  : m_context(context)
10522  {
10523  PIXBeginEvent(context, color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
10524  }
10525 
10527  {
10528  PIXEndEvent(m_context);
10529  }
10530 };
10531 
10532 template<>
10534 {
10535 public:
10536  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString)
10537  {
10538  PIXBeginEvent(color, formatString);
10539  }
10540 
10541  template<class T1>
10542  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1)
10543  {
10544  PIXBeginEvent(color, formatString, a1);
10545  }
10546 
10547  template<class T1, class T2>
10548  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2)
10549  {
10550  PIXBeginEvent(color, formatString, a1, a2);
10551  }
10552 
10553  template<class T1, class T2, class T3>
10554  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3)
10555  {
10556  PIXBeginEvent(color, formatString, a1, a2, a3);
10557  }
10558 
10559  template<class T1, class T2, class T3, class T4>
10560  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
10561  {
10562  PIXBeginEvent(color, formatString, a1, a2, a3, a4);
10563  }
10564 
10565  template<class T1, class T2, class T3, class T4, class T5>
10566  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
10567  {
10568  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5);
10569  }
10570 
10571  template<class T1, class T2, class T3, class T4, class T5, class T6>
10572  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
10573  {
10574  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6);
10575  }
10576 
10577  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
10578  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
10579  {
10580  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7);
10581  }
10582 
10583  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
10584  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
10585  {
10586  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
10587  }
10588 
10589  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
10590  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
10591  {
10592  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
10593  }
10594 
10595  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
10596  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
10597  {
10598  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
10599  }
10600 
10601  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
10602  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
10603  {
10604  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
10605  }
10606 
10607  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
10608  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
10609  {
10610  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
10611  }
10612 
10613  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
10614  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
10615  {
10616  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
10617  }
10618 
10619  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
10620  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
10621  {
10622  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
10623  }
10624 
10625  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
10626  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
10627  {
10628  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
10629  }
10630 
10631  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
10632  PIXScopedEventObject(UINT64 color, _In_ PCSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
10633  {
10634  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
10635  }
10636 
10637  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString)
10638  {
10639  PIXBeginEvent(color, formatString);
10640  }
10641 
10642  template<class T1>
10643  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1)
10644  {
10645  PIXBeginEvent(color, formatString, a1);
10646  }
10647 
10648  template<class T1, class T2>
10649  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2)
10650  {
10651  PIXBeginEvent(color, formatString, a1, a2);
10652  }
10653 
10654  template<class T1, class T2, class T3>
10655  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3)
10656  {
10657  PIXBeginEvent(color, formatString, a1, a2, a3);
10658  }
10659 
10660  template<class T1, class T2, class T3, class T4>
10661  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4)
10662  {
10663  PIXBeginEvent(color, formatString, a1, a2, a3, a4);
10664  }
10665 
10666  template<class T1, class T2, class T3, class T4, class T5>
10667  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
10668  {
10669  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5);
10670  }
10671 
10672  template<class T1, class T2, class T3, class T4, class T5, class T6>
10673  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
10674  {
10675  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6);
10676  }
10677 
10678  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
10679  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
10680  {
10681  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7);
10682  }
10683 
10684  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
10685  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8)
10686  {
10687  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8);
10688  }
10689 
10690  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
10691  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9)
10692  {
10693  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9);
10694  }
10695 
10696  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
10697  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10)
10698  {
10699  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
10700  }
10701 
10702  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
10703  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11)
10704  {
10705  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
10706  }
10707 
10708  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
10709  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12)
10710  {
10711  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
10712  }
10713 
10714  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
10715  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13)
10716  {
10717  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
10718  }
10719 
10720  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
10721  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14)
10722  {
10723  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
10724  }
10725 
10726  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
10727  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15)
10728  {
10729  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
10730  }
10731 
10732  template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16>
10733  PIXScopedEventObject(UINT64 color, _In_ PCWSTR formatString, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10, T11 a11, T12 a12, T13 a13, T14 a14, T15 a15, T16 a16)
10734  {
10735  PIXBeginEvent(color, formatString, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
10736  }
10737 
10739  {
10740  PIXEndEvent();
10741  }
10742 };
10743 
10744 #define PIXConcatenate(a, b) a ## b
10745 #define PIXGetScopedEventVariableName(a, b) PIXConcatenate(a, b)
10746 #define PIXScopedEvent(context, ...) PIXScopedEventObject<PIXInferScopedEventType<decltype(context)>::Type> PIXGetScopedEventVariableName(pixEvent, __LINE__)(context, __VA_ARGS__)
10747 
10748 #endif
Definition: PIXEventsGenerated.h:10284
Definition: pix3_win.h:24