diff --git a/src/renderer_d3d.h b/src/renderer_d3d.h index 1a0149a56..bade6cc65 100644 --- a/src/renderer_d3d.h +++ b/src/renderer_d3d.h @@ -64,6 +64,12 @@ namespace bgfx typedef ::IGraphicsUnknown IUnknown; #endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT + inline constexpr uint32_t toPixColor(uint32_t _abgr) + { + // ABGR -> BGRA + return (_abgr >> 8) | (_abgr << 24); + } + #define _DX_CHECK(_call) \ BX_MACRO_BLOCK_BEGIN \ HRESULT __hr__ = _call; \ diff --git a/src/renderer_d3d12.h b/src/renderer_d3d12.h index 3c9883408..a513817c3 100644 --- a/src/renderer_d3d12.h +++ b/src/renderer_d3d12.h @@ -44,8 +44,8 @@ extern "C" uint64_t WINAPI bgfx_PIXEventsReplaceBlock(PIXEven # include -# define _PIX3_BEGINEVENT(_commandList, _color, _name) PIXBeginEvent(_commandList, _color, _name) -# define _PIX3_SETMARKER(_commandList, _color, _name) PIXSetMarker(_commandList, _color, _name) +# define _PIX3_BEGINEVENT(_commandList, _color, _name) PIXBeginEvent(_commandList, toPixColor(_color), _name) +# define _PIX3_SETMARKER(_commandList, _color, _name) PIXSetMarker(_commandList, toPixColor(_color), _name) # define _PIX3_ENDEVENT(_commandList) PIXEndEvent(_commandList) # define PIX3_BEGINEVENT(_commandList, _color, _name) _PIX3_BEGINEVENT(_commandList, _color, _name)