mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
D3DPER debug events for DX11
This commit is contained in:
parent
4857e89ca8
commit
46037622c9
2 changed files with 32 additions and 3 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
#include "windowManager/platformWindow.h"
|
#include "windowManager/platformWindow.h"
|
||||||
#include "gfx/D3D11/screenshotD3D11.h"
|
#include "gfx/D3D11/screenshotD3D11.h"
|
||||||
#include "materials/shaderData.h"
|
#include "materials/shaderData.h"
|
||||||
|
#include <d3d9.h> //ok now stressing out folks, this is just for debug events(D3DPER) :)
|
||||||
|
|
||||||
#ifdef TORQUE_DEBUG
|
#ifdef TORQUE_DEBUG
|
||||||
#include "d3d11sdklayers.h"
|
#include "d3d11sdklayers.h"
|
||||||
|
|
@ -1678,4 +1679,32 @@ GFXCubemap * GFXD3D11Device::createCubemap()
|
||||||
GFXD3D11Cubemap* cube = new GFXD3D11Cubemap();
|
GFXD3D11Cubemap* cube = new GFXD3D11Cubemap();
|
||||||
cube->registerResourceWithDevice(this);
|
cube->registerResourceWithDevice(this);
|
||||||
return cube;
|
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);
|
||||||
}
|
}
|
||||||
|
|
@ -70,9 +70,9 @@ private:
|
||||||
virtual GFXWindowTarget *allocWindowTarget(PlatformWindow *window);
|
virtual GFXWindowTarget *allocWindowTarget(PlatformWindow *window);
|
||||||
virtual GFXTextureTarget *allocRenderToTextureTarget();
|
virtual GFXTextureTarget *allocRenderToTextureTarget();
|
||||||
|
|
||||||
virtual void enterDebugEvent(ColorI color, const char *name){};
|
virtual void enterDebugEvent(ColorI color, const char *name);
|
||||||
virtual void leaveDebugEvent(){};
|
virtual void leaveDebugEvent();
|
||||||
virtual void setDebugMarker(ColorI color, const char *name){};
|
virtual void setDebugMarker(ColorI color, const char *name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue