Navigation
API > API/Plugins > API/Plugins/MovieRenderPipelineCore
When the GPU finishes rendering a view we can copy the resulting data back to the CPU. Because the buffer is still in use this requires flushing the RHI and stalling the GPU from doing any additional work while the copy is in progress. To resolve this issue, when the data is returned we schedule a copy to a surface that isn't in use which allows the GPU to resume work. Then when the surface is written to, we can copy it to the CPU without blocking the GPU. This requires ensuring that the surface is available, so this SurfaceReader implements a trigger system to ensure we don't try to access the surface until it has been written to, combined with a round-robin of surfaces to avoid stalls.
| Name | FMoviePipelineSurfaceReader |
| Type | struct |
| Header File | /Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MoviePipelineSurfaceReader.h |
| Include Path | #include "MoviePipelineSurfaceReader.h" |
Syntax
struct FMoviePipelineSurfaceReader : public TSharedFromThis< FMoviePipelineSurfaceReader, ESPMode::ThreadSafe >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FMoviePipelineSurfaceReader
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMoviePipelineSurfaceReader
(
EPixelFormat InPixelFormat, |
Construct a surface reader with the given pixel format and size. | MoviePipelineSurfaceReader.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FMoviePipelineSurfaceReader() |
MoviePipelineSurfaceReader.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BlockUntilAvailable () |
Wait until this surface is available for reuse. | MoviePipelineSurfaceReader.h | |
void CopyReadbackTexture_RenderThread
(
TUniqueFunction< void(TUniquePtr< FImagePixelData >&&)>&& InFunctionCallback, |
Maps the ReadbackTexture to the CPU (which should have been resolved to before this point) and copies the data over. | MoviePipelineSurfaceReader.h | |
void Initialize() |
Initialize this reader so that it can be waited on. | MoviePipelineSurfaceReader.h | |
bool IsAvailable() |
MoviePipelineSurfaceReader.h | ||
void Reset () |
Safely resets the state of the wait event. | MoviePipelineSurfaceReader.h | |
void ResolveSampleToReadbackTexture_RenderThread
(
const FTextureRHIRef& SourceSurfaceSample |
Issues a command to the GPU to copy the given SourceSurfaceSample to our local ReadbackTexture for this surface. | MoviePipelineSurfaceReader.h | |
bool WasEverQueued() |
MoviePipelineSurfaceReader.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ResizeImpl
(
uint32 Width, |
Set up this surface to the specified width/height | MoviePipelineSurfaceReader.h |