Navigation
Unreal Engine C++ API Reference > Plugins > MovieRenderPipelineCore
Inheritance Hierarchy
- TSharedFromThis< FMoviePipelineSurfaceReader, ESPMode::ThreadSafe >
- FMoviePipelineSurfaceReader
References
Module | MovieRenderPipelineCore |
Header | /Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MoviePipelineSurfaceReader.h |
Include | #include "MoviePipelineSurfaceReader.h" |
Syntax
struct FMoviePipelineSurfaceReader : public TSharedFromThis< FMoviePipelineSurfaceReader, ESPMode::ThreadSafe >
Remarks
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.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
FEvent * | AvailableEvent | Optional event that is triggered when the surface is no longer in use |
![]() |
bool | bInvertAlpha | |
![]() |
bool | bQueuedForCapture | |
![]() |
EPixelFormat | PixelFormat | The desired pixel format of the resolved textures |
![]() |
TUniquePtr< FRHIGPUTextureReadback > | ReadbackTexture | Texture used to store the resolved render target |
![]() |
FIntPoint | Size | The desired size for this texture |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
FMoviePipelineSurfaceReader
(
EPixelFormat InPixelFormat, |
Construct a surface reader with the given pixel format and size. |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Wait until this surface is available for reuse. | |
![]() |
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. |
![]() |
void | Initialize () |
Initialize this reader so that it can be waited on. |
![]() ![]() |
bool | IsAvailable () |
|
![]() |
void | Reset () |
Safely resets the state of the wait event. |
![]() |
void | ResizeImpl
(
uint32 Width, |
Set up this surface to the specified width/height |
![]() |
void | ResolveSampleToReadbackTexture_RenderThread
(
const FTextureRHIRef& SourceSurfaceSample |
Issues a command to the GPU to copy the given SourceSurfaceSample to our local ReadbackTexture for this surface. |
![]() ![]() |
bool |