Handling native rendering DX12

Hi guys,

I don’t know if someone has tried to extend unreal while in DX12 or even doing native rendering (plugin side). I’m half way porting our plugin to UE4 (dx12). To perform the rendering from our plugin I need the ID3D12Device which is easy to get but I also need an ID3D12GraphicsCommandList to submit the plugin commands. Right now I’m doing the following:



void* GetContextD3D12(IRHICommandContext* cmdContext)
{
    FD3D12CommandContext* cmdContext12 = (FD3D12CommandContext*)cmdContext;
    if (cmdContext12->CommandListHandle.IsClosed())
    {
        return nullptr;
    }
    return cmdContext12->CommandListHandle.CommandList();
}

I haven’t seen the IsClosed() triggering but sometimes I’m getting a closed command list (plugin side) this is totally random, sometimes it happens within the first frames other times it can take 5min or just don’t happen at all. I’ve been digging through the D3D12RHI and I’m not sure if there are other ways of getting command lists. Any ideas?

Many thanks.

EDIT:
It looks like I’m getting closed command lists while moving the mouse around the editor.

how did you resolve it?