diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 4f11d1767..91512864c 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -3789,14 +3789,17 @@ ReplayStatus D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I ID3D11Device *device = NULL; HRESULT hr = E_FAIL; + const bool isProxy = (rdc == NULL); + // This says whether we're using warp at all bool useWarp = false; // This says if we've fallen back to warp after failing to find anything better (hence degraded // support because using warp was not deliberate) bool warpFallback = false; - ChooseBestMatchingAdapter(GraphicsAPI::D3D11, factory, initParams.AdapterDesc, opts, &useWarp, - &adapter); + if(!isProxy) + ChooseBestMatchingAdapter(GraphicsAPI::D3D11, factory, initParams.AdapterDesc, opts, &useWarp, + &adapter); if(useWarp) SAFE_RELEASE(adapter); @@ -3909,7 +3912,7 @@ ReplayStatus D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I D3D_FEATURE_LEVEL *featureLevelSubset = featureLevels + featureLevelPass; UINT numFeatureLevels = ARRAY_COUNT(featureLevels) - featureLevelPass; - RDCLOG( + RDCDEBUG( "Creating D3D11 replay device, %ls adapter, driver type %s, flags %x, %d feature levels " "(first %s)", adapter ? chosenAdapter.Description : L"NULL", ToStr(driverType).c_str(), flags, @@ -3961,10 +3964,11 @@ ReplayStatus D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I WrappedID3D11Device *wrappedDev = new WrappedID3D11Device(device, initParams); wrappedDev->SetInitParams(initParams, ver, opts); - RDCLOG("Created device."); + if(!isProxy) + RDCLOG("Created device."); D3D11Replay *replay = wrappedDev->GetReplay(); - replay->SetProxy(rdc == NULL, warpFallback); + replay->SetProxy(isProxy, warpFallback); replay->CreateResources(factory); if(warpFallback) { @@ -3983,7 +3987,7 @@ ReplayStatus D3D11_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I RDCERR("Couldn't create any compatible d3d11 device."); - if(flags & D3D11_CREATE_DEVICE_DEBUG) + if((flags & D3D11_CREATE_DEVICE_DEBUG) && !isProxy) RDCLOG( "Development RenderDoc builds require D3D debug layers available, " "ensure you have the windows SDK or windows feature needed."); diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 6bc645ceb..4166f716e 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -3739,10 +3739,17 @@ ReplayStatus D3D12_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I if(initParams.MinimumFeatureLevel < D3D_FEATURE_LEVEL_11_0) initParams.MinimumFeatureLevel = D3D_FEATURE_LEVEL_11_0; - AMDRGPControl *rgp = new AMDRGPControl(); + const bool isProxy = (rdc == NULL); - if(!rgp->Initialised()) - SAFE_DELETE(rgp); + AMDRGPControl *rgp = NULL; + + if(!isProxy) + { + rgp = new AMDRGPControl(); + + if(!rgp->Initialised()) + SAFE_DELETE(rgp); + } typedef HRESULT(WINAPI * PFN_CREATE_DXGI_FACTORY)(REFIID, void **); @@ -3757,13 +3764,15 @@ ReplayStatus D3D12_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I IDXGIAdapter *adapter = NULL; - ChooseBestMatchingAdapter(GraphicsAPI::D3D12, factory, initParams.AdapterDesc, opts, NULL, - &adapter); + if(!isProxy) + ChooseBestMatchingAdapter(GraphicsAPI::D3D12, factory, initParams.AdapterDesc, opts, NULL, + &adapter); bool debugLayerEnabled = false; - RDCLOG("Creating D3D12 replay device, minimum feature level %s", - ToStr(initParams.MinimumFeatureLevel).c_str()); + if(!isProxy) + RDCLOG("Creating D3D12 replay device, minimum feature level %s", + ToStr(initParams.MinimumFeatureLevel).c_str()); bool shouldEnableDebugLayer = opts.apiValidation; @@ -3776,7 +3785,7 @@ ReplayStatus D3D12_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I { debugLayerEnabled = EnableD3D12DebugLayer(); - if(!debugLayerEnabled) + if(!debugLayerEnabled && !isProxy) { RDCLOG( "Enabling the D3D debug layers failed, " @@ -3811,11 +3820,12 @@ ReplayStatus D3D12_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, I WrappedID3D12Device *wrappedDev = new WrappedID3D12Device(dev, initParams, debugLayerEnabled); wrappedDev->SetInitParams(initParams, ver, opts); - RDCLOG("Created device."); + if(!isProxy) + RDCLOG("Created device."); D3D12Replay *replay = wrappedDev->GetReplay(); replay->Set12On7(d3d12on7); - replay->SetProxy(rdc == NULL); + replay->SetProxy(isProxy); replay->SetRGP(rgp); replay->Initialise(factory); diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 29e812ecf..baf76d527 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -4190,12 +4190,23 @@ ReplayStatus Vulkan_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, InitReplayTables(module); - AMDRGPControl *rgp = new AMDRGPControl(); + const bool isProxy = (rdc == NULL); - if(!rgp->Initialised()) - SAFE_DELETE(rgp); + AMDRGPControl *rgp = NULL; + + if(!isProxy) + { + rgp = new AMDRGPControl(); + + if(!rgp->Initialised()) + SAFE_DELETE(rgp); + } WrappedVulkan *vk = new WrappedVulkan(); + + VulkanReplay *replay = vk->GetReplay(); + replay->SetProxy(isProxy); + ReplayStatus status = vk->Initialise(initParams, ver, opts); if(status != ReplayStatus::Succeeded) @@ -4207,8 +4218,6 @@ ReplayStatus Vulkan_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, } RDCLOG("Created device."); - VulkanReplay *replay = vk->GetReplay(); - replay->SetProxy(rdc == NULL); replay->SetRGP(rgp); *driver = (IReplayDriver *)replay; diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index d2f63b420..796cb1fc6 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -249,6 +249,7 @@ ReplayStatus WrappedVulkan::Initialise(VkInitParams ¶ms, uint64_t sectionVer SAFE_DELETE_ARRAY(props); } + if(!m_Replay.IsRemoteProxy()) { size_t i = 0; for(const std::string &ext : supportedExtensions) @@ -303,14 +304,16 @@ ReplayStatus WrappedVulkan::Initialise(VkInitParams ¶ms, uint64_t sectionVer std::find(params.Extensions.begin(), params.Extensions.end(), VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == params.Extensions.end()) { - RDCLOG("Enabling VK_EXT_debug_utils"); + if(!m_Replay.IsRemoteProxy()) + RDCLOG("Enabling VK_EXT_debug_utils"); params.Extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); } else if(supportedExtensions.find(VK_EXT_DEBUG_REPORT_EXTENSION_NAME) != supportedExtensions.end() && std::find(params.Extensions.begin(), params.Extensions.end(), VK_EXT_DEBUG_REPORT_EXTENSION_NAME) == params.Extensions.end()) { - RDCLOG("Enabling VK_EXT_debug_report"); + if(!m_Replay.IsRemoteProxy()) + RDCLOG("Enabling VK_EXT_debug_report"); params.Extensions.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME); } @@ -352,7 +355,8 @@ ReplayStatus WrappedVulkan::Initialise(VkInitParams ¶ms, uint64_t sectionVer std::find(params.Extensions.begin(), params.Extensions.end(), VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME) == params.Extensions.end()) { - RDCLOG("Enabling VK_EXT_validation_features"); + if(!m_Replay.IsRemoteProxy()) + RDCLOG("Enabling VK_EXT_validation_features"); params.Extensions.push_back(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); instinfo.pNext = &featuresEXT; @@ -362,7 +366,8 @@ ReplayStatus WrappedVulkan::Initialise(VkInitParams ¶ms, uint64_t sectionVer std::find(params.Extensions.begin(), params.Extensions.end(), VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME) == params.Extensions.end()) { - RDCLOG("Enabling VK_EXT_validation_flags"); + if(!m_Replay.IsRemoteProxy()) + RDCLOG("Enabling VK_EXT_validation_flags"); params.Extensions.push_back(VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME); instinfo.pNext = &flagsEXT;