Skip to content

[IDEA] Introduce PIX bindings #57

@john-h-k

Description

@john-h-k

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions