Can I call RHICmdList.ReadSurfaceData or ReadPixels equivalent without flushing
I'm working on a project that requires I read the pixel data from a render target very frequently. In order to do so I have been using the render request logic I found here. My project, which usually runs an average frame time of ~15-20ms, jumps to 250ms every time ReadSurfaceData is called. Looking at the profiler, it seems there is a call to RHIMETHOD_ReadSurfaceData_Flush that is causing this huge hiccup.
Is there a way around this? A similar question asked here describes how one might defer a ReadPixels call to a non-blocking thread, but that doesn't work for me because I NEED to block until I get data. Surely there must be a way to read the current pixel values off of a render target without this flush call?
asked Jul 17 '17 at 05:16 PM in C++ Programming
There is a way, in my case i use it for getting the pixels of the current viewport but it works in the same way.
With Vulkan there is a massive performance improvement, but vulkan is still experimental.
Caution: about the viewport, this only works if called in a overriden Draw function.
I also need to get the pixelsvalue of a render target, so when it's working i will of course update this post.
source: https://wiki.unrealengine.com/Render_Target_Lookup (propably much better explained)
Follow this question
Once you sign in you will be able to subscribe for any updates here