I ended up implementing fully headless rendering myself over the last couple of days. In other words, I rewrote some of the Vulkan Linux platform code and made use of the following Vulkan layer:
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer
Basically, this allows me to create a fake VkSurfaceKHR object that I can pass to the engine, so that headless rendering can be implemented without having to touch larger parts of the Vulkan renderer.
Announcement
Collapse
No announcement yet.
[Bug] SDL_Window* parameter being NULL when calling SDL_Vulkan_CreateSurface (with -RenderOffscreen)
Collapse
X
-
Edvard Fagerholm repliedHere's the command that I'm using to launch the engine:
Code:Engine/Binaries/Linux/UE4Editor /home/efagerho/git/UE4Upstream/Samples/StarterContent/StarterContent.uproject -game -MovieSceneCaptureType="/Script/MovieSceneCapture.AutomatedLevelSequenceCapture" -LevelSequence="/Game/Sequence" -MovieFolder="/home/efagerho/ue4/output/" -NoLoadingScreen -MovieFormat=JPG -MovieQuality=100 -ResX=1920 -ResY=1080 -vulkan -RenderOffscreen
Code:if (bRenderOffScreen) { TSharedRef< FGenericWindow > NewWindow = MakeShareable(new FGenericWindow()); InSlateWindow->SetNativeWindow(NewWindow); return NewWindow; }
Leave a comment:
-
[Bug] SDL_Window* parameter being NULL when calling SDL_Vulkan_CreateSurface (with -RenderOffscreen)
When trying to run the engine under Linux with the Vulkan backend and the -RenderOffscreen command line flag, the engine ends up passing a nullptr as the SDL_Window* into SDL_Vulkan_CreateSurface. This happens in VulkanLinuxPlatform.cpp:
Code:void FVulkanLinuxPlatform::CreateSurface(void* WindowHandle, VkInstance Instance, VkSurfaceKHR* OutSurface) { EnsureSDLIsInited(); if (SDL_Vulkan_CreateSurface((SDL_Window*)WindowHandle, Instance, OutSurface) == SDL_FALSE) { UE_LOG(LogInit, Error, TEXT("Error initializing SDL Vulkan Surface: %s"), SDL_GetError()); check(0); } }
Leave a comment: