Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
PrecisionAlex's avatar
PrecisionAlex
Honored Guest
5 years ago

GetPixels crashes on oculus quest only. How can I safely read the framebuffer on Oculus quest?


Hi


I've been working on some functionality that requires capturing the screen to an RGB array for later processing/streaming.


I've been using a pretty well documented method of calling
GetPixels() on the a child class of UGameViewportClient which works
great on every platform I've tried it on (windows, windows with
vr/multiview enabled, android phone) but it crashes on Oculus quest android in
both opengl ES3 and Vulkan. I suspect the mobile-multiview + android
combination is causing issues. A thread describing the method is here (edit, I can't post links on these forums because my account is too young).


Ultimately I'd just like to know if there's a way I can copy the
backbuffer/framebuffer to an TArray
on the Oculus quest without crashing. Ideally with acceptable enough performance to allow the data to be used for streaming.

I've tried this with the oculus branches 4.22 and 4.24 with opengles3 on both and vulkan on 4.24.


Thank you for your time.



1 Reply

Replies have been turned off for this discussion
  • Hi, an update.

    I was able to re-recreate this crash by simply issuing the "shot" console command.  The command goes through essentially the same process as I do and crashes at the same place.

    Here is a callstack :

    FVulkanDynamicRHI::RHIReadSurfaceData(FRHITexture*, FIntRect, TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags) VulkanRenderTarget.cpp:796
    FRHICommandListImmediate::ReadSurfaceData(FRHITexture*, FIntRect, TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags) RHICommandList.h:4360
    FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_24::operator()(FRHICommandListImmediate&) const UnrealClient.cpp:76
    TEnqueueUniqueRenderCommandType<FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::ReadSurfaceCommandName, FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_24>::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) RenderingThread.h:198
    TGraphTask<TEnqueueUniqueRenderCommandType<FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::ReadSurfaceCommandName, FRenderTarget::ReadPixels(TArray<FColor, TSizedDefaultAllocator<32> >&, FReadSurfaceDataFlags, FIntRect)::$_24> >::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type) TaskGraphInterfaces.h:847
    FBaseGraphTask::Execute(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type) TaskGraphInterfaces.h:514
    FNamedTaskThread::ProcessTasksNamedThread(int, bool) TaskGraph.cpp:686
    FNamedTaskThread::ProcessTasksUntilQuit(int) TaskGraph.cpp:582
    RenderingThreadMain(FEvent*) RenderingThread.cpp:339
    FRenderingThread::Run() RenderingThread.cpp:488
    FRunnableThreadPThread::Run() PThreadRunnableThread.cpp:25
    FRunnableThreadPThread::_ThreadProc(void*) PThreadRunnableThread.h:177
    __pthread_start(void*) 0x0000007f8dc79458
    __start_thread 0x0000007f8dc21208