diff --git a/qrenderdoc/Code/Interface/PersistantConfig.cpp b/qrenderdoc/Code/Interface/PersistantConfig.cpp index 0e9a4f55d..9c32c5ab3 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.cpp +++ b/qrenderdoc/Code/Interface/PersistantConfig.cpp @@ -291,6 +291,7 @@ bool PersistantConfig::Load(const rdcstr &filename) } RENDERDOC_SetConfigSetting("Disassembly_FriendlyNaming", ShaderViewer_FriendlyNaming ? "1" : "0"); + RENDERDOC_SetConfigSetting("ExternalTool_RGPIntegration", ExternalTool_RGPIntegration ? "1" : "0"); RDDialog::DefaultBrowsePath = LastFileBrowsePath; @@ -419,6 +420,7 @@ bool PersistantConfig::Save() RemoteHostList.push_back(*host); RENDERDOC_SetConfigSetting("Disassembly_FriendlyNaming", ShaderViewer_FriendlyNaming ? "1" : "0"); + RENDERDOC_SetConfigSetting("ExternalTool_RGPIntegration", ExternalTool_RGPIntegration ? "1" : "0"); LastFileBrowsePath = RDDialog::DefaultBrowsePath; diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h index fe2d1dda7..ff994c314 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.h +++ b/qrenderdoc/Code/Interface/PersistantConfig.h @@ -332,6 +332,8 @@ DECLARE_REFLECTION_STRUCT(BugReport); CONFIG_SETTING_VAL(public, QDateTime, rdcdatetime, DegradedCapture_LastUpdate, \ rdcdatetime(2015, 01, 01)) \ \ + CONFIG_SETTING_VAL(public, bool, bool, ExternalTool_RGPIntegration, false) \ + \ CONFIG_SETTING_VAL(public, QString, rdcstr, ExternalTool_RadeonGPUProfiler, "") \ \ CONFIG_SETTING_VAL(public, bool, bool, Tips_HasSeenFirst, false) \ @@ -627,6 +629,10 @@ For more information about some of these settings that are user-facing see A date containing the last time that the user was warned about captures being loaded in degraded support. This prevents the user being spammed if their hardware is low spec. +.. data:: ExternalTool_RGPIntegration + + Whether to enable integration with the external Radeon GPU Profiler tool. + .. data:: ExternalTool_RadeonGPUProfiler The path to the executable of the external Radeon GPU Profiler tool. diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp index 37f22f921..28023155c 100644 --- a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp @@ -99,6 +99,7 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent) ui->deleteShaderTool->setEnabled(false); ui->editShaderTool->setEnabled(false); + ui->ExternalTool_RGPIntegration->setChecked(m_Ctx.Config().ExternalTool_RGPIntegration); ui->ExternalTool_RadeonGPUProfiler->setText(m_Ctx.Config().ExternalTool_RadeonGPUProfiler); ui->Android_SDKPath->setText(m_Ctx.Config().Android_SDKPath); @@ -386,6 +387,13 @@ void SettingsDialog::on_chooseSearchPaths_clicked() list.getItems().join(QLatin1Char(';'))); } +void SettingsDialog::on_ExternalTool_RGPIntegration_toggled(bool checked) +{ + m_Ctx.Config().ExternalTool_RGPIntegration = checked; + + m_Ctx.Config().Save(); +} + void SettingsDialog::on_ExternalTool_RadeonGPUProfiler_textEdited(const QString &rgp) { if(QFileInfo::exists(rgp) || rgp.isEmpty()) diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.h b/qrenderdoc/Windows/Dialogs/SettingsDialog.h index b59b57ac5..0fee3cc05 100644 --- a/qrenderdoc/Windows/Dialogs/SettingsDialog.h +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.h @@ -69,6 +69,7 @@ private slots: // core void on_chooseSearchPaths_clicked(); + void on_ExternalTool_RGPIntegration_toggled(bool checked); void on_ExternalTool_RadeonGPUProfiler_textEdited(const QString &rgp); void on_browseRGPPath_clicked(); diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui index bfa84f795..d342b7d2c 100644 --- a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui @@ -482,7 +482,7 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345 - + Locates the RadeonGPUProfiler.exe which will be used to interop with when generating and opening RGP profiles. @@ -492,14 +492,14 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345 - + Locates the RadeonGPUProfiler.exe which will be used to interop with when generating and opening RGP profiles. - + Locates the RadeonGPUProfiler.exe which will be used to interop with when generating and opening RGP profiles. @@ -509,7 +509,7 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345 - + Qt::Vertical @@ -522,6 +522,30 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345 + + + + RenderDoc can optionally have integration with AMD's Radeon GPU Profiler, to allow capturing RGP from RenderDoc and allowing interop between the two. + +After interop is enabled you will need to reload any capture. + + + + + + + + + + RenderDoc can optionally have integration with AMD's Radeon GPU Profiler, to allow capturing RGP from RenderDoc and allowing interop between the two. + +After interop is enabled you will need to reload any capture. + + + Enable Radeon GPU Profiler integration (requires capture reload) + + + diff --git a/renderdoc/driver/ihv/amd/amd_rgp.cpp b/renderdoc/driver/ihv/amd/amd_rgp.cpp index 1fc5412a6..a37862bad 100644 --- a/renderdoc/driver/ihv/amd/amd_rgp.cpp +++ b/renderdoc/driver/ihv/amd/amd_rgp.cpp @@ -24,6 +24,7 @@ #include "amd_rgp.h" #include "common/common.h" +#include "core/core.h" #include "core/plugins.h" #include "official/RGP/DevDriverAPI.h" @@ -67,8 +68,18 @@ AMDRGPControl::AMDRGPControl() m_RGPDispatchTable->minorVersion = DEV_DRIVER_API_MINOR_VERSION; m_RGPContext = NULL; + const bool enabled = RenderDoc::Inst().GetConfigSetting("ExternalTool_RGPIntegration") != "0"; + + if(!enabled) + { + RDCLOG("AMD RGP Interop is not enabled"); + return; + } + #if ENABLED(RDOC_WIN32) || ENABLED(RDOC_LINUX) + RDCLOG("Attempting to enable AMD RGP Interop"); + // manually load in the DevDriverAPI dll and set up the function table std::string dllName("DevDriverAPI"); @@ -119,6 +130,11 @@ AMDRGPControl::AMDRGPControl() if(rgpStatus == DEV_DRIVER_STATUS_SUCCESS) { supportsInterop = DriverSupportsInterop(); + + if(supportsInterop) + RDCLOG("AMD RGP Interop was successfully enabled"); + else + RDCLOG("AMD RGP Interop could not be enabled"); } // if initialization failed or driver doesn't support interop