During capture use application's device configuration for root sigs

* If we don't, we'll try to use the builtin root sig decoder and possibly break.
This commit is contained in:
baldurk
2024-06-25 17:25:15 +01:00
parent bc94410ece
commit e2a03f5d23
5 changed files with 39 additions and 15 deletions
+2 -1
View File
@@ -4172,7 +4172,8 @@ void WrappedID3D12Device::CreateInternalResources()
m_GPUSyncCounter = 0;
GetShaderCache()->SetDevConfiguration(m_Replay->GetDevConfiguration());
if(IsReplayMode(m_State))
GetShaderCache()->SetDevConfiguration(m_Replay->GetDevConfiguration());
if(m_TextRenderer == NULL)
m_TextRenderer = new D3D12TextRenderer(this);
+30 -11
View File
@@ -28,6 +28,8 @@
#include "serialise/serialiser.h"
#include "d3d12_command_queue.h"
#include "d3d12_device.h"
#include "d3d12_replay.h"
#include "d3d12_shader_cache.h"
#include "driver/dx/official/D3D11On12On7.h"
@@ -396,12 +398,18 @@ public:
}
}
return CreateD3D12_Internal(
D3D12DevConfiguration devConfig;
devConfig.devfactory = this;
devConfig.devconfig = &config;
HRESULT ret = CreateD3D12_Internal(
[this](IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid,
void **ppDevice) {
return m_pReal->CreateDevice(pAdapter, MinimumFeatureLevel, riid, ppDevice);
},
adapter, FeatureLevel, riid, ppvDevice);
&devConfig, adapter, FeatureLevel, riid, ppvDevice);
return ret;
}
};
@@ -625,12 +633,13 @@ private:
return true;
}
friend HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, IUnknown *pAdapter,
D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid,
void **ppDevice);
friend HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, D3D12DevConfiguration *devConfig,
IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel,
REFIID riid, void **ppDevice);
HRESULT Create_Internal(RealD3D12CreateFunction real, IUnknown *pAdapter,
D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid, void **ppDevice)
HRESULT Create_Internal(RealD3D12CreateFunction real, D3D12DevConfiguration *devConfig,
IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid,
void **ppDevice)
{
// if we're already inside a wrapped create i.e. this function, then DON'T do anything
// special. Just grab the trampolined function and call it.
@@ -739,6 +748,13 @@ private:
WrappedID3D12Device *wrap = WrappedID3D12Device::Create(dev, params, EnableDebugLayer);
if(devConfig)
{
D3D12DevConfiguration *cfg = new D3D12DevConfiguration(*devConfig);
wrap->GetReplay()->SetDevConfiguration(cfg);
wrap->GetShaderCache()->SetDevConfiguration(cfg);
}
RDCDEBUG("created wrapped device.");
*ppDevice = (ID3D12Device *)wrap;
@@ -803,7 +819,8 @@ private:
}
}
return d3d12hooks.Create_Internal(createFunc, pAdapter, MinimumFeatureLevel, riid, ppDevice);
return d3d12hooks.Create_Internal(createFunc, NULL, pAdapter, MinimumFeatureLevel, riid,
ppDevice);
}
static HRESULT WINAPI D3D12EnableExperimentalFeatures_hook(UINT NumFeatures, const IID *pIIDs,
@@ -880,10 +897,12 @@ private:
D3D12Hook D3D12Hook::d3d12hooks;
HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, IUnknown *pAdapter,
D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid, void **ppDevice)
HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, D3D12DevConfiguration *devConfig,
IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid,
void **ppDevice)
{
return D3D12Hook::d3d12hooks.Create_Internal(real, pAdapter, MinimumFeatureLevel, riid, ppDevice);
return D3D12Hook::d3d12hooks.Create_Internal(real, devConfig, pAdapter, MinimumFeatureLevel, riid,
ppDevice);
}
HRESULT STDMETHODCALLTYPE WrappedID3D12DeviceFactory::GetConfigurationInterface(
+5 -2
View File
@@ -28,6 +28,8 @@
#include "driver/dx/official/d3d12.h"
#include "driver/dx/official/dxgi.h"
struct D3D12DevConfiguration;
// this is the type of the lambda we use to route the call out to the 'real' function inside our
// generic wrapper.
// Could be any of D3D12CreateDevice or the AMD wrapper
@@ -35,8 +37,9 @@ typedef std::function<HRESULT(IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatu
REFIID riid, void **ppDevice)>
RealD3D12CreateFunction;
HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, IUnknown *pAdapter,
D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid, void **ppDevice);
HRESULT CreateD3D12_Internal(RealD3D12CreateFunction real, D3D12DevConfiguration *devConfig,
IUnknown *pAdapter, D3D_FEATURE_LEVEL MinimumFeatureLevel, REFIID riid,
void **ppDevice);
struct ID3DDevice;
+1
View File
@@ -95,6 +95,7 @@ public:
D3D12Replay(WrappedID3D12Device *d);
D3D12DevConfiguration *GetDevConfiguration() { return m_DevConfig; }
void SetDevConfiguration(D3D12DevConfiguration *config) { m_DevConfig = config; }
D3D12DebugManager *GetDebugManager() { return m_DebugManager; }
void SetRGP(AMDRGPControl *rgp) { m_RGP = rgp; }
+1 -1
View File
@@ -325,7 +325,7 @@ private:
return S_OK;
},
creationParams->pAdapter, creationParams->FeatureLevel, __uuidof(ID3D12Device),
NULL, creationParams->pAdapter, creationParams->FeatureLevel, __uuidof(ID3D12Device),
(void **)&dev);
returnedParams->pDevice = dev;