microdee / Uranium

Fast and versatile implementation of CEF for Unreal Engine
MIT License
64 stars 6 forks source link

Migrating to UE5 #6

Open Brennan-VanderLaan opened 2 years ago

Brennan-VanderLaan commented 2 years ago

Figured I'd go out on a limb. I pulled your repo, updated dependencies, the powershell defs, and moved it to UE5, that worked as far as getting BPs to show up and I have my widget defined. When I try to actually run it errors out. This is not a request for you to fix this. I was just wondering if you have any ideas on where I should start to get it working again - I'm new to UE plugin development and this one has not exactly been googleable.

Any ideas?


LogOutputDevice: Error: Ensure condition failed: oldValue == newValue [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\ThreadingBase.cpp] [Line: 300]
LogOutputDevice: Error: oldValue(1) newValue(0) If this check fails make sure that there is a FTaskTagScope(ETaskTag::EParallelRenderingThread) as deep as possible on the current callstack, you can see the current value in ActiveNamedThreads(1), GRenderingThread(b4bfd7c0), GIsRenderingThreadSuspended(0)
LogOutputDevice: Error: Stack: 
LogOutputDevice: Error: [Callstack] 0x00007ffec9e4920c UnrealEditor-Core.dll!IsInParallelRenderingThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\ThreadingBase.cpp:300]
LogOutputDevice: Error: [Callstack] 0x00007ffec3947b0d UnrealEditor-Engine.dll!UTexture::GetResource() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Texture.cpp:150]
LogOutputDevice: Error: [Callstack] 0x00007ffec39497be UnrealEditor-Engine.dll!UTexture::HasPendingRenderResourceInitialization() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Texture.cpp:858]
LogOutputDevice: Error: [Callstack] 0x00007ffec38767fe UnrealEditor-Engine.dll!UStreamableRenderAsset::HasPendingInitOrStreaming() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\StreamableRenderAsset.cpp:262]
LogOutputDevice: Error: [Callstack] 0x00007ffec389368d UnrealEditor-Engine.dll!UStreamableRenderAsset::WaitForPendingInitOrStreaming() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\StreamableRenderAsset.cpp:336]
LogOutputDevice: Error: [Callstack] 0x00007ffec39640c6 UnrealEditor-Engine.dll!UTexture2D::UpdateResource() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Texture2D.cpp:683]
LogOutputDevice: Error: [Callstack] 0x00007ffe96643045 UnrealEditor-Uranium.dll!UD3D12SharedTexture::InvalidateUeResources() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\Uranium\Private\SharedTexture\D3D12\D3D12SharedTexture.cpp:186]
LogOutputDevice: Error: [Callstack] 0x00007ffe96645b9a UnrealEditor-Uranium.dll!UD3D12SharedTexture::OnAcceleratedPaint() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\Uranium\Private\SharedTexture\D3D12\D3D12SharedTexture.cpp:101]
LogOutputDevice: Error: [Callstack] 0x00007ffe96645c05 UnrealEditor-Uranium.dll!UUrDefaultRenderResourceHandler::OnAcceleratedPaint() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\Uranium\Private\Handlers\UrDefaultRenderHandler.cpp:23]
LogOutputDevice: Error: [Callstack] 0x00007ffe9664525c UnrealEditor-Uranium.dll!ICefRenderHandler::OnAcceleratedPaint() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\Uranium\Private\Handlers\UrRenderHandler.cpp:79]
LogOutputDevice: Error: [Callstack] 0x00007ffe9669d955 UnrealEditor-Uranium.dll!`anonymous namespace'::render_handler_on_accelerated_paint() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\ThirdParty\CEF\Win64\85.0.4183.121.ST\libcef_dll\cpptoc\render_handler_cpptoc.cc:323]
LogOutputDevice: Error: [Callstack] 0x00007ffdec24b1ff libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdf1710044 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdf1ec5fcf libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdecba5b46 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdf1ec66bc libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee763571 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee767c0b libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee767809 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee7625cf libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee762b72 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee773974 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee67c910 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdef023367 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdef0230c6 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee6a64a5 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee6a5bbe libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdef0239c8 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdee666b7a libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffdeefdcc09 libcef.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ffe96644bbe UnrealEditor-Uranium.dll!UDefaultUraniumContext::MessageLoop() [C:\Users\brenn\Documents\Unreal Projects\PigeonGame\Plugins\Uranium\Source\Uranium\Private\DefaultUraniumContext.cpp:62]
LogOutputDevice: Error: [Callstack] 0x00007ffe965fc9b3 UnrealEditor-Uranium.dll!std::thread::_Invoke<std::tuple<std::_Binder<std::_Unforced,void (__cdecl UDefaultUraniumContext::*)(void),UDefaultUraniumContext *> >,0>() [C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\INCLUDE\thread:56]
LogOutputDevice: Error: [Callstack] 0x00007fff796e1bb2 ucrtbase.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff7b5b7034 KERNEL32.DLL!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff7bf22651 ntdll.dll!UnknownFunction []
LogStats:                SubmitErrorReport -  0.000 s
LogRHI: Error: Breadcrumbs 'RHIThread'
LogStats:                    SendNewReport -  1.098 s
LogStats:             FDebug::EnsureFailed -  1.811 s```
Brennan-VanderLaan commented 2 years ago

void UD3D12SharedTexture::InvalidateUeResources(int width, int height, EPixelFormat format) { Width = width; Height = height; Format = format; TargetTexture = UTexture2D::CreateTransient(width, height, format, TextureName); TargetTexture->UpdateResource(); D3D11On12TargetTexture.Reset(); }

TargetTexture->UpdateResource(); is where it's blowing up

It looks like when it tries to switch out the resource UE expects that to come from a EParallelRenderingThread. I tried dropping in FTaskTagScope Scope(ETaskTag::EParallelRenderingThread); in a few places and UE was angry about wanting it to be tagged only by the main game thread.

I'm fairly certain this has to do with the new engine's RHI setup? https://docs.unrealengine.com/5.0/en-US/parallel-rendering-overview-for-unreal-engine/

Brennan-VanderLaan commented 2 years ago

I'm going to keep poking at it, @microdee holler if you'd like to see a branch when it's working with UE5 or if you have any ideas :)

microdee commented 2 years ago

Hi! Thanks for the report and the pointer which might cause this. At the moment I'm busy with other matters, and the company I work with don't see any value in this plugin so it will not be on the agenda for a while. On the contrary tho there's still a rewrite happening which makes Uranium code quality much better and working with it much more convenient, also it will have the capacity to support multiple HTML renderers ;) (Only CEF is implemented yet tho)

microdee commented 2 years ago

Probably, this will also mean I will need to make extra implementations for the texture renderers when I will port this to 5.0