mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 08:40:55 +00:00
Don't force API validation in development builds on D3D11/GL
This commit is contained in:
@@ -4306,16 +4306,10 @@ RDResult D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, IRepl
|
||||
// we control the debug flag ourselves
|
||||
flags &= ~D3D11_CREATE_DEVICE_DEBUG;
|
||||
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
// in development builds, always enable debug layer during replay
|
||||
flags |= D3D11_CREATE_DEVICE_DEBUG;
|
||||
#else
|
||||
// in release builds, only enable it if forced by replay options
|
||||
if(opts.apiValidation)
|
||||
flags |= D3D11_CREATE_DEVICE_DEBUG;
|
||||
else
|
||||
flags &= ~D3D11_CREATE_DEVICE_DEBUG;
|
||||
#endif
|
||||
|
||||
// we should now be set up to try creating feature level 11 devices either with a selected
|
||||
// adapter, a NULL (any) adapter, or WARP.
|
||||
|
||||
@@ -58,6 +58,7 @@ static void *GetEGLHandle()
|
||||
class EGLPlatform : public GLPlatform
|
||||
{
|
||||
RDCDriver m_API = RDCDriver::OpenGLES;
|
||||
bool m_Debug = false;
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
@@ -76,7 +77,7 @@ class EGLPlatform : public GLPlatform
|
||||
if(EGL.CreateContext)
|
||||
{
|
||||
EGLint baseAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_CONTEXT_FLAGS_KHR,
|
||||
EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, EGL_NONE};
|
||||
m_Debug ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0, EGL_NONE};
|
||||
|
||||
ret.egl_ctx = EGL.CreateContext(share.egl_dpy, share.egl_cfg, share.egl_ctx, baseAttribs);
|
||||
|
||||
@@ -208,10 +209,6 @@ class EGLPlatform : public GLPlatform
|
||||
GLWindowingData CreateWindowingData(EGLDisplay eglDisplay, EGLContext share_ctx,
|
||||
EGLNativeWindowType window, bool debug)
|
||||
{
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
debug = true;
|
||||
#endif
|
||||
|
||||
GLWindowingData ret;
|
||||
ret.egl_dpy = eglDisplay;
|
||||
ret.egl_ctx = NULL;
|
||||
@@ -383,6 +380,7 @@ class EGLPlatform : public GLPlatform
|
||||
RDCASSERT(api == RDCDriver::OpenGLES || api == RDCDriver::OpenGL);
|
||||
|
||||
m_API = api;
|
||||
m_Debug = debug;
|
||||
|
||||
if(api == RDCDriver::OpenGLES)
|
||||
EGL.BindAPI(EGL_OPENGL_ES_API);
|
||||
|
||||
@@ -51,6 +51,7 @@ void *GetGLHandle()
|
||||
class GLXPlatform : public GLPlatform
|
||||
{
|
||||
RDCDriver m_API = RDCDriver::OpenGL;
|
||||
bool m_Debug = false;
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
@@ -263,11 +264,7 @@ class GLXPlatform : public GLPlatform
|
||||
attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = GLCoreVersion % 10;
|
||||
attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = GLX_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = m_Debug ? GLX_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = m_API == RDCDriver::OpenGLES ? GLX_CONTEXT_ES2_PROFILE_BIT_EXT
|
||||
: GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
@@ -365,14 +362,10 @@ class GLXPlatform : public GLPlatform
|
||||
void SetDriverType(RDCDriver api) { m_API = api; }
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
// force debug in development builds
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
debug = true;
|
||||
#endif
|
||||
|
||||
RDCASSERT(api == RDCDriver::OpenGL || api == RDCDriver::OpenGLES);
|
||||
|
||||
m_API = api;
|
||||
m_Debug = debug;
|
||||
|
||||
int attribs[64] = {0};
|
||||
int i = 0;
|
||||
@@ -384,7 +377,7 @@ class GLXPlatform : public GLPlatform
|
||||
int &minor = attribs[i];
|
||||
attribs[i++] = 0;
|
||||
attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
|
||||
attribs[i++] = debug ? GLX_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = m_Debug ? GLX_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = api == RDCDriver::OpenGLES ? GLX_CONTEXT_ES2_PROFILE_BIT_EXT
|
||||
: GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
class WGLPlatform : public GLPlatform
|
||||
{
|
||||
RDCDriver m_API = RDCDriver::OpenGL;
|
||||
bool m_Debug = false;
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
@@ -288,11 +289,7 @@ class WGLPlatform : public GLPlatform
|
||||
attribs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = GLCoreVersion % 10;
|
||||
attribs[i++] = WGL_CONTEXT_FLAGS_ARB;
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = m_Debug ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = m_API == RDCDriver::OpenGLES ? WGL_CONTEXT_ES2_PROFILE_BIT_EXT
|
||||
: WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
@@ -374,14 +371,10 @@ class WGLPlatform : public GLPlatform
|
||||
void SetDriverType(RDCDriver api) { m_API = api; }
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
// force debug in development builds
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
debug = true;
|
||||
#endif
|
||||
|
||||
RDCASSERT(api == RDCDriver::OpenGL || api == RDCDriver::OpenGLES);
|
||||
|
||||
m_API = api;
|
||||
m_Debug = debug;
|
||||
|
||||
bool success = RegisterClass();
|
||||
|
||||
@@ -457,7 +450,7 @@ class WGLPlatform : public GLPlatform
|
||||
int &minor = attribs[i];
|
||||
attribs[i++] = 0;
|
||||
attribs[i++] = WGL_CONTEXT_FLAGS_ARB;
|
||||
attribs[i++] = debug ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = m_Debug ? WGL_CONTEXT_DEBUG_BIT_ARB : 0;
|
||||
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = api == RDCDriver::OpenGLES ? WGL_CONTEXT_ES2_PROFILE_BIT_EXT
|
||||
: WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
|
||||
Reference in New Issue
Block a user