| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| #pragma once |
|
|
| #ifndef _PIX3_H_ |
| #define _PIX3_H_ |
|
|
| #include <sal.h> |
|
|
| #ifndef __cplusplus |
| #error "Only C++ files can include pix.h. C is not supported." |
| #endif |
|
|
| #if defined(XBOX) || defined(_XBOX_ONE) || defined(_DURANGO) |
| #include "pix3_xbox.h" |
| #else |
| #include "pix3_win.h" |
| #endif |
|
|
| |
| |
| |
| #if (!defined(USE_PIX)) && ((defined(_DEBUG) || DBG || (defined(PROFILE) && !defined(FASTCAP)) || defined(PROFILE_BUILD)) && !defined(i386) && defined(_AMD64_) && !defined(_PREFAST_)) |
| #define USE_PIX |
| #endif |
|
|
| #if defined(USE_PIX) && !defined(_AMD64_) |
| #pragma message("Warning: Pix markers are only supported on AMD64") |
| #endif |
|
|
| |
| #define PIX_CAPTURE_TIMING (1 << 0) |
| #define PIX_CAPTURE_GPU (1 << 1) |
| #define PIX_CAPTURE_FUNCTION_SUMMARY (1 << 2) |
| #define PIX_CAPTURE_FUNCTION_DETAILS (1 << 3) |
| #define PIX_CAPTURE_CALLGRAPH (1 << 4) |
| #define PIX_CAPTURE_INSTRUCTION_TRACE (1 << 5) |
| #define PIX_CAPTURE_SYSTEM_MONITOR_COUNTERS (1 << 6) |
| #define PIX_CAPTURE_VIDEO (1 << 7) |
| #define PIX_CAPTURE_AUDIO (1 << 8) |
|
|
| typedef union PIXCaptureParameters |
| { |
| struct GpuCaptureParameters |
| { |
| PVOID reserved; |
| } GpuCaptureParameters; |
|
|
| struct TimingCaptureParameters |
| { |
| BOOL CaptureCallstacks; |
| PWSTR FileName; |
| } TimingCaptureParameters; |
|
|
| } PIXCaptureParameters, *PPIXCaptureParameters; |
|
|
|
|
|
|
| #if defined (USE_PIX) && defined(_AMD64_) |
|
|
| #include "PIXEventsCommon.h" |
| #include "PIXEventsGenerated.h" |
|
|
| |
| |
| extern "C" HRESULT WINAPI PIXBeginCapture(DWORD captureFlags, _In_opt_ const PPIXCaptureParameters captureParameters); |
|
|
| |
| |
| |
| extern "C" HRESULT WINAPI PIXEndCapture(BOOL discard); |
|
|
| extern "C" DWORD WINAPI PIXGetCaptureState(); |
|
|
| extern "C" void WINAPI PIXReportCounter(_In_ PCWSTR name, float value); |
|
|
| #else |
|
|
| |
| inline HRESULT PIXBeginCapture(DWORD, _In_opt_ const PIXCaptureParameters*) { return S_OK; } |
| inline HRESULT PIXEndCapture(BOOL) { return S_OK; } |
| inline DWORD PIXGetCaptureState() { return 0; } |
| inline void PIXReportCounter(_In_ PCWSTR, float) {} |
|
|
| inline void PIXBeginEvent(UINT64, _In_ PCSTR, ...) {} |
| inline void PIXBeginEvent(UINT64, _In_ PCWSTR, ...) {} |
| inline void PIXBeginEvent(void*, UINT64, _In_ PCSTR, ...) {} |
| inline void PIXBeginEvent(void*, UINT64, _In_ PCWSTR, ...) {} |
| inline void PIXEndEvent() {} |
| inline void PIXEndEvent(void*) {} |
| inline void PIXSetMarker(UINT64, _In_ PCSTR, ...) {} |
| inline void PIXSetMarker(UINT64, _In_ PCWSTR, ...) {} |
| inline void PIXSetMarker(void*, UINT64, _In_ PCSTR, ...) {} |
| inline void PIXSetMarker(void*, UINT64, _In_ PCWSTR, ...) {} |
| inline void PIXScopedEvent(UINT64, _In_ PCSTR, ...) {} |
| inline void PIXScopedEvent(UINT64, _In_ PCWSTR, ...) {} |
| inline void PIXScopedEvent(void*, UINT64, _In_ PCSTR, ...) {} |
| inline void PIXScopedEvent(void*, UINT64, _In_ PCWSTR, ...) {} |
|
|
| |
| #pragma warning(disable:4548) |
| #pragma warning(disable:4555) |
|
|
| #endif |
|
|
| |
| |
| |
| |
| inline UINT PIX_COLOR(BYTE r, BYTE g, BYTE b) { return 0xff000000 | (r << 16) | (g << 8) | b; } |
| inline UINT PIX_COLOR_INDEX(BYTE i) { return i; } |
| const UINT PIX_COLOR_DEFAULT = PIX_COLOR_INDEX(0); |
|
|
| #endif |
|
|