Defer creating RT internal resources until after creation

* This will allow us to wrap the resources which can be useful for self-
  introspection
This commit is contained in:
baldurk
2024-05-27 10:13:57 +01:00
parent b715cce04f
commit 0497e2d226
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -4045,6 +4045,8 @@ void WrappedID3D12Device::CreateInternalResources()
}
}
GetResourceManager()->GetRaytracingResourceAndUtilHandler()->CreateInternalResources();
// we don't want replay-only shaders added in WrappedID3D12Shader to pollute the list of resources
WrappedID3D12Shader::InternalResources(true);
+10 -2
View File
@@ -694,6 +694,10 @@ D3D12RaytracingResourceAndUtilHandler::D3D12RaytracingResourceAndUtilHandler(Wra
m_gpuFence(NULL),
m_gpuSyncHandle(NULL),
m_gpuSyncCounter(0u)
{
}
void D3D12RaytracingResourceAndUtilHandler::CreateInternalResources()
{
if(m_wrappedDevice)
{
@@ -1238,7 +1242,7 @@ void D3D12RaytracingResourceAndUtilHandler::InitRayDispatchPatchingResources()
(void **)&m_RayPatchingData.rootSig);
if(!SUCCEEDED(result))
RDCERR("Unable to create root signature for patching the BLAS");
RDCERR("Unable to create root signature for dispatch patching");
// PipelineState
ID3DBlob *shader = NULL;
@@ -1259,7 +1263,11 @@ void D3D12RaytracingResourceAndUtilHandler::InitRayDispatchPatchingResources()
&pipeline, __uuidof(ID3D12PipelineState), (void **)&m_RayPatchingData.pipe);
if(!SUCCEEDED(result))
RDCERR("Unable to create pipeline for patching the BLAS");
RDCERR("Unable to create pipeline for dispatch patching");
}
else
{
RDCERR("Failed to get shader for dispatch patching");
}
SAFE_RELEASE(rootSig);
+2
View File
@@ -1084,6 +1084,8 @@ class D3D12RaytracingResourceAndUtilHandler
public:
D3D12RaytracingResourceAndUtilHandler(WrappedID3D12Device *device);
void CreateInternalResources();
ID3D12GraphicsCommandListX *GetCmd() const { return m_cmdList; }
ID3D12CommandAllocator *GetCmdAlloc() const { return m_cmdAlloc; }
ID3D12CommandQueue *GetCmdQueue() const { return m_cmdQueue; }