diff --git a/docs/getting_started/tips_tricks.rst b/docs/getting_started/tips_tricks.rst index eb8ce2715..d274972a1 100644 --- a/docs/getting_started/tips_tricks.rst +++ b/docs/getting_started/tips_tricks.rst @@ -48,7 +48,7 @@ This page is a random hodge-podge of different tips and tricks that might not be You can also use the ``RENDERDOC_StartFrameCapture()`` and ``RENDERDOC_EndFrameCapture()`` functions to precisely define the period to be captured. For more information look at the :doc:`../in_application_api` documentation or the ``renderdoc_app.h`` header. #. When you have right clicked to select a pixel in the texture viewer, you can perform precise refinements with the arrow keys to nudge the selection in each direction. -#. To get API debug or error messages, enable "Create Debug Device" when capturing then check out the :doc:`../window/debug_messages` window. +#. To get API debug or error messages, enable "Enable API validation" when capturing then check out the :doc:`../window/debug_messages` window. #. Detecting RenderDoc from your code can either be done by trying to load and use the renderdoc :doc:`../in_application_api`, or through API specific ways: .. highlight:: c++ diff --git a/docs/window/capture_log_attach.rst b/docs/window/capture_log_attach.rst index 310b061d2..8cb3f62b4 100644 --- a/docs/window/capture_log_attach.rst +++ b/docs/window/capture_log_attach.rst @@ -80,9 +80,9 @@ This option modifies the above capturing of callstacks to only be saved for draw ---------- - | ``Create Debug Device`` Default: ``Disabled`` + | ``Enable API validation`` Default: ``Disabled`` -Create Debug Device causes RenderDoc to enable the API's built-in debugging, and where possible serialise this out and include it in the logfile for later inspection in the :doc:`debug_messages` window. +Enable API validation causes RenderDoc to enable the API's built-in debugging, and where possible serialise this out and include it in the logfile for later inspection in the :doc:`debug_messages` window. * On D3D11 this will activate the D3D debug layer and save out any messages. * For OpenGL this means ``ARB_debug_output`` is automatically enabled. diff --git a/docs/window/debug_messages.rst b/docs/window/debug_messages.rst index a7a5d532c..44b9edc04 100644 --- a/docs/window/debug_messages.rst +++ b/docs/window/debug_messages.rst @@ -8,7 +8,7 @@ RenderDoc will alert you if there are any debug messages to show from the log, b Capturing with debug messages included -------------------------------------- -To include these debug messages in a log, check on the "Create Debug Device" option in the capture options. For more information see :doc:`capture_log_attach` +To include these debug messages in a log, check on the "Enable API validation" option in the capture options. For more information see :doc:`capture_log_attach` Debug Messages -------------- diff --git a/renderdoc/api/app/renderdoc_app.h b/renderdoc/api/app/renderdoc_app.h index 67c179ad0..207942d12 100644 --- a/renderdoc/api/app/renderdoc_app.h +++ b/renderdoc/api/app/renderdoc_app.h @@ -83,7 +83,8 @@ typedef enum // 1 - Enable built-in API debugging features and records the results into // the capture logfile, which is matched up with events on replay // 0 - no API debugging is forcibly enabled - eRENDERDOC_Option_DebugDeviceMode = 2, + eRENDERDOC_Option_APIValidation = 2, + eRENDERDOC_Option_DebugDeviceMode = 2, // deprecated name of this enum // Capture CPU callstacks for API events // @@ -169,7 +170,7 @@ typedef enum // the period when a frame capture is in progress. eRENDERDOC_Option_CaptureAllCmdLists = 10, - // Mute API debugging output when the debug device mode option is enabled + // Mute API debugging output when the API validation mode option is enabled // // Default - enabled // @@ -461,6 +462,7 @@ typedef enum { eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00 eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01 + eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02 } RENDERDOC_Version; // API version changelog: @@ -468,8 +470,9 @@ typedef enum // 1.0.0 - initial release // 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered // by keypress or TriggerCapture, instead of Start/EndFrameCapture. +// 1.0.2 - Refactor: Renamed eRENDERDOC_Option_DebugDeviceMode to eRENDERDOC_Option_APIValidation -// eRENDERDOC_API_Version_1_0_1 +// eRENDERDOC_API_Version_1_0_2 typedef struct { pRENDERDOC_GetAPIVersion GetAPIVersion; @@ -505,9 +508,10 @@ typedef struct pRENDERDOC_StartFrameCapture StartFrameCapture; pRENDERDOC_IsFrameCapturing IsFrameCapturing; pRENDERDOC_EndFrameCapture EndFrameCapture; -} RENDERDOC_API_1_0_1; +} RENDERDOC_API_1_0_2; -typedef RENDERDOC_API_1_0_1 RENDERDOC_API_1_0_0; +typedef RENDERDOC_API_1_0_2 RENDERDOC_API_1_0_0; +typedef RENDERDOC_API_1_0_2 RENDERDOC_API_1_0_1; ////////////////////////////////////////////////////////////////////////////////////////////////// // RenderDoc API entry point diff --git a/renderdoc/api/replay/capture_options.h b/renderdoc/api/replay/capture_options.h index 814bf0e59..3d6e03ec4 100644 --- a/renderdoc/api/replay/capture_options.h +++ b/renderdoc/api/replay/capture_options.h @@ -37,7 +37,7 @@ struct CaptureOptions bool32 AllowVSync; bool32 AllowFullscreen; - bool32 DebugDeviceMode; + bool32 APIValidation; bool32 CaptureCallstacks; bool32 CaptureCallstacksOnlyDraws; uint32_t DelayForDebugger; diff --git a/renderdoc/driver/d3d11/d3d11_hooks.cpp b/renderdoc/driver/d3d11/d3d11_hooks.cpp index 2fead3ddd..d08d8d6cf 100644 --- a/renderdoc/driver/d3d11/d3d11_hooks.cpp +++ b/renderdoc/driver/d3d11/d3d11_hooks.cpp @@ -159,7 +159,7 @@ private: if(m_EnabledHooks) { - if(!reading && RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(!reading && RenderDoc::Inst().GetCaptureOptions().APIValidation) { Flags |= D3D11_CREATE_DEVICE_DEBUG; } diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 73a8392ea..00f98c464 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -1268,7 +1268,7 @@ void WrappedOpenGL::ActivateContext(GLWindowingData winData) const GLHookSet &gl = m_Real; - if(gl.glDebugMessageCallback && RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(gl.glDebugMessageCallback && RenderDoc::Inst().GetCaptureOptions().APIValidation) { gl.glDebugMessageCallback(&DebugSnoopStatic, this); gl.glEnable(eGL_DEBUG_OUTPUT_SYNCHRONOUS); diff --git a/renderdoc/driver/gl/gl_hooks_linux.cpp b/renderdoc/driver/gl/gl_hooks_linux.cpp index 86eb9a7b1..bc83808aa 100644 --- a/renderdoc/driver/gl/gl_hooks_linux.cpp +++ b/renderdoc/driver/gl/gl_hooks_linux.cpp @@ -647,7 +647,7 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte if(name == GLX_CONTEXT_FLAGS_ARB) { - if(RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(RenderDoc::Inst().GetCaptureOptions().APIValidation) val |= GLX_CONTEXT_DEBUG_BIT_ARB; else val &= ~GLX_CONTEXT_DEBUG_BIT_ARB; @@ -662,7 +662,7 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte attribVec.push_back(val); } - if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().APIValidation) { attribVec.push_back(GLX_CONTEXT_FLAGS_ARB); attribVec.push_back(GLX_CONTEXT_DEBUG_BIT_ARB); diff --git a/renderdoc/driver/gl/gl_hooks_win32.cpp b/renderdoc/driver/gl/gl_hooks_win32.cpp index 71b9daba6..2e5860a6e 100644 --- a/renderdoc/driver/gl/gl_hooks_win32.cpp +++ b/renderdoc/driver/gl/gl_hooks_win32.cpp @@ -474,7 +474,7 @@ class OpenGLHook : LibraryHook if(name == WGL_CONTEXT_FLAGS_ARB) { - if(RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(RenderDoc::Inst().GetCaptureOptions().APIValidation) val |= WGL_CONTEXT_DEBUG_BIT_ARB; else val &= ~WGL_CONTEXT_DEBUG_BIT_ARB; @@ -489,7 +489,7 @@ class OpenGLHook : LibraryHook attribVec.push_back(val); } - if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(!flagsFound && RenderDoc::Inst().GetCaptureOptions().APIValidation) { attribVec.push_back(WGL_CONTEXT_FLAGS_ARB); attribVec.push_back(WGL_CONTEXT_DEBUG_BIT_ARB); diff --git a/renderdoc/driver/vulkan/vk_tracelayer.cpp b/renderdoc/driver/vulkan/vk_tracelayer.cpp index 70801ee0c..ad4d01359 100644 --- a/renderdoc/driver/vulkan/vk_tracelayer.cpp +++ b/renderdoc/driver/vulkan/vk_tracelayer.cpp @@ -79,14 +79,14 @@ class VulkanHook : LibraryHook void OptionsUpdated(const char *libName) { - if(RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(RenderDoc::Inst().GetCaptureOptions().APIValidation) { Process::RegisterEnvironmentModification(Process::EnvironmentModification(Process::eEnvModification_AppendPlatform, "VK_INSTANCE_LAYERS", "VK_LAYER_LUNARG_standard_validation")); Process::RegisterEnvironmentModification(Process::EnvironmentModification(Process::eEnvModification_AppendPlatform, "VK_DEVICE_LAYERS", "VK_LAYER_LUNARG_standard_validation")); } else { - // can't disable if DebugDeviceMode is not set + // can't disable if APIValidation is not set } Process::ApplyEnvironmentModification(); diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index 47f1d0292..852bb5eb4 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -212,7 +212,7 @@ VkResult WrappedVulkan::vkCreateInstance( for(uint32_t i=0; i < modifiedCreateInfo.enabledExtensionCount; i++) addedExts[i] = modifiedCreateInfo.ppEnabledExtensionNames[i]; - if(RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode) + if(RenderDoc::Inst().GetCaptureOptions().APIValidation) addedExts[modifiedCreateInfo.enabledExtensionCount++] = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; modifiedCreateInfo.ppEnabledExtensionNames = addedExts; @@ -256,7 +256,7 @@ VkResult WrappedVulkan::vkCreateInstance( m_Queue = VK_NULL_HANDLE; m_InternalCmds.Reset(); - if(RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode && ObjDisp(m_Instance)->CreateDebugReportCallbackEXT) + if(RenderDoc::Inst().GetCaptureOptions().APIValidation && ObjDisp(m_Instance)->CreateDebugReportCallbackEXT) { VkDebugReportCallbackCreateInfoEXT debugInfo = {}; debugInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; diff --git a/renderdoc/replay/app_api.cpp b/renderdoc/replay/app_api.cpp index d2a7ca82c..cd2e9aa59 100644 --- a/renderdoc/replay/app_api.cpp +++ b/renderdoc/replay/app_api.cpp @@ -157,19 +157,19 @@ int RENDERDOC_CC SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val); uint32_t RENDERDOC_CC GetCaptureOptionU32(RENDERDOC_CaptureOption opt); float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt); -void RENDERDOC_CC GetAPIVersion_1_0_1(int *major, int *minor, int *patch) +void RENDERDOC_CC GetAPIVersion_1_0_2(int *major, int *minor, int *patch) { if(major) *major = 1; if(minor) *minor = 0; - if(patch) *patch = 1; + if(patch) *patch = 2; } -RENDERDOC_API_1_0_1 api_1_0_1; -void Init_1_0_1() +RENDERDOC_API_1_0_2 api_1_0_2; +void Init_1_0_2() { - RENDERDOC_API_1_0_1 &api = api_1_0_1; + RENDERDOC_API_1_0_2 &api = api_1_0_2; - api.GetAPIVersion = &GetAPIVersion_1_0_1; + api.GetAPIVersion = &GetAPIVersion_1_0_2; api.SetCaptureOptionU32 = &SetCaptureOptionU32; api.SetCaptureOptionF32 = &SetCaptureOptionF32; @@ -224,8 +224,9 @@ extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_GetAPI(RENDERDOC_Version ver ret = 1; \ } - API_VERSION_HANDLE(1_0_0, 1_0_1); - API_VERSION_HANDLE(1_0_1, 1_0_1); + API_VERSION_HANDLE(1_0_0, 1_0_2); + API_VERSION_HANDLE(1_0_1, 1_0_2); + API_VERSION_HANDLE(1_0_2, 1_0_2); #undef API_VERSION_HANDLE diff --git a/renderdoc/replay/capture_options.cpp b/renderdoc/replay/capture_options.cpp index 358b9f67a..d97b342d8 100644 --- a/renderdoc/replay/capture_options.cpp +++ b/renderdoc/replay/capture_options.cpp @@ -41,8 +41,8 @@ int RENDERDOC_CC SetCaptureOptionU32(RENDERDOC_CaptureOption opt, uint32_t val) case eRENDERDOC_Option_AllowFullscreen: opts.AllowFullscreen = (val != 0); break; - case eRENDERDOC_Option_DebugDeviceMode: - opts.DebugDeviceMode = (val != 0); + case eRENDERDOC_Option_APIValidation: + opts.APIValidation = (val != 0); break; case eRENDERDOC_Option_CaptureCallstacks: opts.CaptureCallstacks = (val != 0); @@ -92,8 +92,8 @@ int RENDERDOC_CC SetCaptureOptionF32(RENDERDOC_CaptureOption opt, float val) case eRENDERDOC_Option_AllowFullscreen: opts.AllowFullscreen = (val != 0.0f); break; - case eRENDERDOC_Option_DebugDeviceMode: - opts.DebugDeviceMode = (val != 0.0f); + case eRENDERDOC_Option_APIValidation: + opts.APIValidation = (val != 0.0f); break; case eRENDERDOC_Option_CaptureCallstacks: opts.CaptureCallstacks = (val != 0.0f); @@ -139,8 +139,8 @@ uint32_t RENDERDOC_CC GetCaptureOptionU32(RENDERDOC_CaptureOption opt) return (RenderDoc::Inst().GetCaptureOptions().AllowVSync ? 1 : 0); case eRENDERDOC_Option_AllowFullscreen: return (RenderDoc::Inst().GetCaptureOptions().AllowFullscreen ? 1 : 0); - case eRENDERDOC_Option_DebugDeviceMode: - return (RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode ? 1 : 0); + case eRENDERDOC_Option_APIValidation: + return (RenderDoc::Inst().GetCaptureOptions().APIValidation ? 1 : 0); case eRENDERDOC_Option_CaptureCallstacks: return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks ? 1 : 0); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: @@ -174,8 +174,8 @@ float RENDERDOC_CC GetCaptureOptionF32(RENDERDOC_CaptureOption opt) return (RenderDoc::Inst().GetCaptureOptions().AllowVSync ? 1.0f : 0.0f); case eRENDERDOC_Option_AllowFullscreen: return (RenderDoc::Inst().GetCaptureOptions().AllowFullscreen ? 1.0f : 0.0f); - case eRENDERDOC_Option_DebugDeviceMode: - return (RenderDoc::Inst().GetCaptureOptions().DebugDeviceMode ? 1.0f : 0.0f); + case eRENDERDOC_Option_APIValidation: + return (RenderDoc::Inst().GetCaptureOptions().APIValidation ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureCallstacks: return (RenderDoc::Inst().GetCaptureOptions().CaptureCallstacks ? 1.0f : 0.0f); case eRENDERDOC_Option_CaptureCallstacksOnlyDraws: @@ -205,7 +205,7 @@ CaptureOptions::CaptureOptions() { AllowVSync = true; AllowFullscreen = true; - DebugDeviceMode = false; + APIValidation = false; CaptureCallstacks = false; CaptureCallstacksOnlyDraws = false; DelayForDebugger = 0; diff --git a/renderdocui/Interop/CaptureOptions.cs b/renderdocui/Interop/CaptureOptions.cs index 9fd4bdff3..8ca4efdd5 100644 --- a/renderdocui/Interop/CaptureOptions.cs +++ b/renderdocui/Interop/CaptureOptions.cs @@ -70,7 +70,7 @@ namespace renderdoc { public bool AllowVSync; public bool AllowFullscreen; - public bool DebugDeviceMode; + public bool APIValidation; public bool CaptureCallstacks; public bool CaptureCallstacksOnlyDraws; public UInt32 DelayForDebugger; diff --git a/renderdocui/Windows/Dialogs/CaptureDialog.Designer.cs b/renderdocui/Windows/Dialogs/CaptureDialog.Designer.cs index b57c900e8..d8a141610 100644 --- a/renderdocui/Windows/Dialogs/CaptureDialog.Designer.cs +++ b/renderdocui/Windows/Dialogs/CaptureDialog.Designer.cs @@ -51,7 +51,7 @@ this.label4 = new System.Windows.Forms.Label(); this.CaptureCallstacks = new System.Windows.Forms.CheckBox(); this.CaptureCallstacksOnlyDraws = new System.Windows.Forms.CheckBox(); - this.DebugDeviceMode = new System.Windows.Forms.CheckBox(); + this.APIValidation = new System.Windows.Forms.CheckBox(); this.HookIntoChildren = new System.Windows.Forms.CheckBox(); this.SaveAllInitials = new System.Windows.Forms.CheckBox(); this.RefAllResources = new System.Windows.Forms.CheckBox(); @@ -275,7 +275,7 @@ this.capOptsFlow.Controls.Add(this.panel3); this.capOptsFlow.Controls.Add(this.CaptureCallstacks); this.capOptsFlow.Controls.Add(this.CaptureCallstacksOnlyDraws); - this.capOptsFlow.Controls.Add(this.DebugDeviceMode); + this.capOptsFlow.Controls.Add(this.APIValidation); this.capOptsFlow.Controls.Add(this.HookIntoChildren); this.capOptsFlow.Controls.Add(this.SaveAllInitials); this.capOptsFlow.Controls.Add(this.RefAllResources); @@ -362,16 +362,16 @@ this.toolTip.SetToolTip(this.CaptureCallstacksOnlyDraws, "Only collect callstacks on \'drawcall\' level api calls"); this.CaptureCallstacksOnlyDraws.UseVisualStyleBackColor = true; // - // DebugDeviceMode + // APIValidation // - this.DebugDeviceMode.Location = new System.Drawing.Point(139, 29); - this.DebugDeviceMode.Name = "DebugDeviceMode"; - this.DebugDeviceMode.Size = new System.Drawing.Size(130, 20); - this.DebugDeviceMode.TabIndex = 12; - this.DebugDeviceMode.Text = "Create Debug Device"; - this.toolTip.SetToolTip(this.DebugDeviceMode, "D3D11: Create a debug device - allows capturing and reading of D3D errors and war" + - "nings"); - this.DebugDeviceMode.UseVisualStyleBackColor = true; + this.APIValidation.Location = new System.Drawing.Point(139, 29); + this.APIValidation.Name = "APIValidation"; + this.APIValidation.Size = new System.Drawing.Size(130, 20); + this.APIValidation.TabIndex = 12; + this.APIValidation.Text = "Enable API validation"; + this.toolTip.SetToolTip(this.APIValidation, "Initialise the graphics API with built-in validation enabled - allows capturing and reading of errors and war" + + "nings generated by the API's own debugging system"); + this.APIValidation.UseVisualStyleBackColor = true; // // HookIntoChildren // @@ -751,7 +751,7 @@ private System.Windows.Forms.Button capture; private System.Windows.Forms.Button close; private System.Windows.Forms.CheckBox AllowVSync; - private System.Windows.Forms.CheckBox DebugDeviceMode; + private System.Windows.Forms.CheckBox APIValidation; private System.Windows.Forms.CheckBox AllowFullscreen; private System.Windows.Forms.CheckBox CaptureCallstacks; private System.Windows.Forms.Panel panel3; diff --git a/renderdocui/Windows/Dialogs/CaptureDialog.cs b/renderdocui/Windows/Dialogs/CaptureDialog.cs index 40cfe82fa..7e3044d45 100644 --- a/renderdocui/Windows/Dialogs/CaptureDialog.cs +++ b/renderdocui/Windows/Dialogs/CaptureDialog.cs @@ -76,7 +76,7 @@ namespace renderdocui.Windows.Dialogs HookIntoChildren.Checked = settings.Options.HookIntoChildren; CaptureCallstacks.Checked = settings.Options.CaptureCallstacks; CaptureCallstacksOnlyDraws.Checked = settings.Options.CaptureCallstacksOnlyDraws; - DebugDeviceMode.Checked = settings.Options.DebugDeviceMode; + APIValidation.Checked = settings.Options.APIValidation; RefAllResources.Checked = settings.Options.RefAllResources; SaveAllInitials.Checked = settings.Options.SaveAllInitials; DelayForDebugger.Value = settings.Options.DelayForDebugger; @@ -114,7 +114,7 @@ namespace renderdocui.Windows.Dialogs ret.Options.HookIntoChildren = HookIntoChildren.Checked; ret.Options.CaptureCallstacks = CaptureCallstacks.Checked; ret.Options.CaptureCallstacksOnlyDraws = CaptureCallstacksOnlyDraws.Checked; - ret.Options.DebugDeviceMode = DebugDeviceMode.Checked; + ret.Options.APIValidation = APIValidation.Checked; ret.Options.RefAllResources = RefAllResources.Checked; ret.Options.SaveAllInitials = SaveAllInitials.Checked; ret.Options.CaptureAllCmdLists = CaptureAllCmdLists.Checked;