Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Introduce PIX bindings #57

Open
john-h-k opened this issue May 10, 2020 · 0 comments
Open

[IDEA] Introduce PIX bindings #57

john-h-k opened this issue May 10, 2020 · 0 comments

Comments

@john-h-k
Copy link
Contributor

john-h-k commented May 10, 2020

Idea

Introduce PIX bindings for this repo

Rationale

PIX is the officially recommended debugger for DX and support is useful

Proposed API

// CPU only
void PIXBeginEvent(ulong color, ushort* formatString, __arglist);

// GPU and CPU
void PIXBeginEvent(ID3D12CommandList* commandList, ulong color, ushort* formatString, __arglist);
void PIXBeginEvent(ID3D12CommandQueue* commandQueue, ulong color, ushort* formatString, __arglist);

// CPU only
void PIXEndEvent();
        
// GPU and CPU
void PIXEndEvent(ID3D12CommandList* commandList);
void PIXEndEvent(ID3D12CommandQueue* commandQueue);

// CPU
void PIXSetMarker(ulong color, ushort* formatString, __arglist);

// GPU and CPU
void PIXSetMarker(ID3D12GraphicsCommandList* commandList, ulong color, ushort* formatString, __arglist);
void PIXSetMarker(ID3D12CommandQueue* commandQueue, ulong color, ushort* formatString, __arglist);

// Could be implemented with a IDisposable struct and a using

PIXScopedEvent(ulong color, ushort*  formatString, __arglist);
PIXScopedEvent(ID3D12GraphicsCommandList* commandList, ulong color, ushort*  formatString, __arglist);
PIXScopedEvent(ID3D12CommandQueue* commandQueue, ulong color, ushort* formatString, __arglist);

void PIXReportCounter(ushort* name, float value);

void PIXNotifyWakeFromFenceSignal(HANDLE event);

// Returns a color for a PIX event or marker from the specified red, green and blue values
int PIX_COLOR(byte r, byte g, byte b);

// Returns an arbitrary color value for the given index.
// PIX allocates a unique color for each index.
uint PIX_COLOR_INDEX(byte i);

Drawbacks

I am not sure about the copyright status of PIX, and obviously while calling the native functions is fine, porting the header ones might be an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant