This commit is contained in:
Branimir Karadžić 2014-09-28 11:03:47 -07:00
parent d705fbc9bd
commit 80f2044a7c
3 changed files with 41 additions and 23 deletions

View file

@ -16,6 +16,9 @@
#include <windowsx.h>
#include <tinystl/allocator.h>
#include <tinystl/string.h>
enum
{
WM_USER_WINDOW_CREATE = WM_USER,
@ -89,7 +92,7 @@ namespace entry
uint32_t m_width;
uint32_t m_height;
uint32_t m_flags;
std::string m_title;
tinystl::string m_title;
};
struct Context

View file

@ -7,8 +7,11 @@
#if BGFX_CONFIG_RENDERER_DIRECT3D11
# include "renderer_d3d11.h"
# if BGFX_CONFIG_DEBUG_PIX
# include <psapi.h>
# include <renderdoc/renderdoc_app.h>
# endif // BGFX_CONFIG_DEBUG_PIX
namespace bgfx
{
@ -404,26 +407,7 @@ namespace bgfx
return false;
};
#define RENDERDOC_IMPORT \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetLogFile); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_GetCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureOptions); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetActiveWindow); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_TriggerCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_StartFrameCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_EndFrameCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_GetOverlayBits); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_MaskOverlayBits); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetFocusToggleKeys); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureKeys); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_InitRemoteAccess);
#define RENDERDOC_IMPORT_FUNC(_func) p##_func _func
RENDERDOC_IMPORT
#undef RENDERDOC_IMPORT_FUNC
pRENDERDOC_GetAPIVersion RENDERDOC_GetAPIVersion;
#if BGFX_CONFIG_DEBUG_PIX && BX_PLATFORM_WINDOWS
bool findModule(const char* _name)
{
HANDLE process = GetCurrentProcess();
@ -464,6 +448,26 @@ RENDERDOC_IMPORT
return false;
}
#define RENDERDOC_IMPORT \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetLogFile); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_GetCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureOptions); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetActiveWindow); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_TriggerCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_StartFrameCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_EndFrameCapture); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_GetOverlayBits); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_MaskOverlayBits); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetFocusToggleKeys); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_SetCaptureKeys); \
RENDERDOC_IMPORT_FUNC(RENDERDOC_InitRemoteAccess);
#define RENDERDOC_IMPORT_FUNC(_func) p##_func _func
RENDERDOC_IMPORT
#undef RENDERDOC_IMPORT_FUNC
pRENDERDOC_GetAPIVersion RENDERDOC_GetAPIVersion;
void* loadRenderDoc()
{
// Skip loading RenderDoc when IntelGPA is present to avoid RenderDoc crash.
@ -521,6 +525,16 @@ RENDERDOC_IMPORT
bx::dlclose(_renderdocdll);
}
}
#else
void* loadRenderDoc()
{
return NULL;
}
void unloadRenderDoc(void*)
{
}
#endif // BGFX_CONFIG_DEBUG_PIX
struct RendererContextD3D11 : public RendererContextI
{

View file

@ -23,6 +23,7 @@
#else
# include <d3d11.h>
#endif // BX_COMPILER_MSVC
#include "renderer_d3d.h"
#define D3DCOLOR_ARGB(_a, _r, _g, _b) ( (DWORD)( ( ( (_a)&0xff)<<24)|( ( (_r)&0xff)<<16)|( ( (_g)&0xff)<<8)|( (_b)&0xff) ) )