diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp index 1fbe28a52..e25401085 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp @@ -37,6 +37,7 @@ #include "windowManager/platformWindow.h" #include "gfx/D3D11/screenshotD3D11.h" #include "materials/shaderData.h" +#include //ok now stressing out folks, this is just for debug events(D3DPER) :) #ifdef TORQUE_DEBUG #include "d3d11sdklayers.h" @@ -1678,4 +1679,32 @@ GFXCubemap * GFXD3D11Device::createCubemap() GFXD3D11Cubemap* cube = new GFXD3D11Cubemap(); cube->registerResourceWithDevice(this); return cube; +} + +//------------------------------------------------------------------------------ +void GFXD3D11Device::enterDebugEvent(ColorI color, const char *name) +{ + // BJGFIX + WCHAR eventName[260]; + MultiByteToWideChar(CP_ACP, 0, name, -1, eventName, 260); + + D3DPERF_BeginEvent(D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue), + (LPCWSTR)&eventName); +} + +//------------------------------------------------------------------------------ +void GFXD3D11Device::leaveDebugEvent() +{ + D3DPERF_EndEvent(); +} + +//------------------------------------------------------------------------------ +void GFXD3D11Device::setDebugMarker(ColorI color, const char *name) +{ + // BJGFIX + WCHAR eventName[260]; + MultiByteToWideChar(CP_ACP, 0, name, -1, eventName, 260); + + D3DPERF_SetMarker(D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue), + (LPCWSTR)&eventName); } \ No newline at end of file diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.h b/Engine/source/gfx/D3D11/gfxD3D11Device.h index 3b98e763c..acb04c461 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.h +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.h @@ -70,9 +70,9 @@ private: virtual GFXWindowTarget *allocWindowTarget(PlatformWindow *window); virtual GFXTextureTarget *allocRenderToTextureTarget(); - virtual void enterDebugEvent(ColorI color, const char *name){}; - virtual void leaveDebugEvent(){}; - virtual void setDebugMarker(ColorI color, const char *name){}; + virtual void enterDebugEvent(ColorI color, const char *name); + virtual void leaveDebugEvent(); + virtual void setDebugMarker(ColorI color, const char *name); protected: