UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IStereoRenderTargetManager Class Referenceabstract

#include <StereoRenderTargetManager.h>

+ Inheritance diagram for IStereoRenderTargetManager:

Public Member Functions

virtual bool ShouldUseSeparateRenderTarget () const =0
 
virtual void UpdateViewport (bool bUseSeparateRenderTarget, const class FViewport &Viewport, class SViewport *ViewportWidget=nullptr)=0
 
virtual void CalculateRenderTargetSize (const class FViewport &Viewport, uint32 &InOutSizeX, uint32 &InOutSizeY)=0
 
virtual bool NeedReAllocateViewportRenderTarget (const class FViewport &Viewport)=0
 
virtual bool NeedReAllocateDepthTexture (const TRefCountPtr< struct IPooledRenderTarget > &DepthTarget)
 
virtual bool NeedReAllocateShadingRateTexture (const TRefCountPtr< struct IPooledRenderTarget > &ShadingRateTarget)
 
virtual uint32 GetNumberOfBufferedFrames () const
 
virtual bool AllocateRenderTargetTexture (uint32 Index, uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTargetableTexture, FTextureRHIRef &OutShaderResourceTexture, uint32 NumSamples=1)
 
virtual bool AllocateRenderTargetTextures (uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumLayers, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, TArray< FTextureRHIRef > &OutTargetableTextures, TArray< FTextureRHIRef > &OutShaderResourceTextures, uint32 NumSamples=1)
 
virtual EPixelFormat GetActualColorSwapchainFormat () const
 
virtual int32 AcquireColorTexture ()
 
virtual int32 AcquireDepthTexture ()
 
virtual bool AllocateDepthTexture (uint32 Index, uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTargetableTexture, FTextureRHIRef &OutShaderResourceTexture, uint32 NumSamples=1)
 
virtual bool AllocateShadingRateTexture (uint32 Index, uint32 RenderSizeX, uint32 RenderSizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTexture, FIntPoint &OutTextureSize)
 
virtual bool HDRGetMetaDataForStereo (EDisplayOutputFormat &OutDisplayOutputFormat, EDisplayColorGamut &OutDisplayColorGamut, bool &OutbHDRSupported)
 
virtual bool ReconfigureForShaderPlatform (EShaderPlatform NewShaderPlatform)
 
virtual bool GetRecommendedMotionVectorTextureSize (FIntPoint &OutTextureSize)
 
virtual bool GetMotionVectorTexture (uint32 Index, const FIntPoint &Size, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, FTextureRHIRef &OutTexture, uint32 NumSamples=1)
 
virtual bool GetMotionVectorDepthTexture (uint32 Index, const FIntPoint &Size, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, FTextureRHIRef &OutTexture, uint32 NumSamples=1)
 

Static Public Member Functions

static EPixelFormat GetStereoLayerPixelFormat ()
 

Detailed Description

The IStereoRenderTargetManager can be returned from IStereoRendering::GetRenderTargetManager() implementations. Implement this interface if a stereo rendering device requires all output to be rendered into separate render targets and/or to customize how separate render targets are allocated.

Member Function Documentation

◆ AcquireColorTexture()

virtual int32 IStereoRenderTargetManager::AcquireColorTexture ( )
inlinevirtual

Acquires the next available color texture.

Returns
the index of the texture in the array returned by AllocateRenderTargetTexture.

◆ AcquireDepthTexture()

virtual int32 IStereoRenderTargetManager::AcquireDepthTexture ( )
inlinevirtual

Acquires the next available depth texture.

Returns
the index of the texture in the array returned by AllocateRenderTargetTexture.

◆ AllocateDepthTexture()

virtual bool IStereoRenderTargetManager::AllocateDepthTexture ( uint32  Index,
uint32  SizeX,
uint32  SizeY,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
ETextureCreateFlags  TargetableTextureFlags,
FTextureRHIRef OutTargetableTexture,
FTextureRHIRef OutShaderResourceTexture,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates a depth texture.

Parameters
Index(in) index of the buffer, changing from 0 to GetNumberOfBufferedFrames()
Returns
true, if texture was allocated; false, if the default texture allocation should be used.

◆ AllocateRenderTargetTexture()

virtual bool IStereoRenderTargetManager::AllocateRenderTargetTexture ( uint32  Index,
uint32  SizeX,
uint32  SizeY,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
ETextureCreateFlags  TargetableTextureFlags,
FTextureRHIRef OutTargetableTexture,
FTextureRHIRef OutShaderResourceTexture,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates a render target texture. The default implementation always return false to indicate that the default texture allocation should be used instead.

Parameters
Index(in) index of the buffer, changing from 0 to GetNumberOfBufferedFrames()
Returns
true, if texture was allocated; false, if the default texture allocation should be used.

◆ AllocateRenderTargetTextures()

virtual bool IStereoRenderTargetManager::AllocateRenderTargetTextures ( uint32  SizeX,
uint32  SizeY,
uint8  Format,
uint32  NumLayers,
ETextureCreateFlags  Flags,
ETextureCreateFlags  TargetableTextureFlags,
TArray< FTextureRHIRef > &  OutTargetableTextures,
TArray< FTextureRHIRef > &  OutShaderResourceTextures,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates the render target textures, which includes the color textures and optionally other textures like depth. The default implementation always returns false to indicate that the default texture allocation should be used instead.

Returns
true, if textures were allocated; false, if the default texture allocation should be used.

Reimplemented in FFakeStereoRenderingDevice.

◆ AllocateShadingRateTexture()

virtual bool IStereoRenderTargetManager::AllocateShadingRateTexture ( uint32  Index,
uint32  RenderSizeX,
uint32  RenderSizeY,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
ETextureCreateFlags  TargetableTextureFlags,
FTextureRHIRef OutTexture,
FIntPoint OutTextureSize 
)
inlinevirtual

Allocates a shading rate texture. The default implementation always returns false to indicate that the default texture allocation should be used instead.

Parameters
Index(in) index of the buffer, changing from 0 to GetNumberOfBufferedFrames()
Returns
true, if texture was allocated; false, if the default texture allocation should be used.

◆ CalculateRenderTargetSize()

virtual void IStereoRenderTargetManager::CalculateRenderTargetSize ( const class FViewport Viewport,
uint32 InOutSizeX,
uint32 InOutSizeY 
)
pure virtual

Calculates dimensions of the render target texture for direct rendering of distortion.

Implemented in FFakeStereoRenderingDevice.

◆ GetActualColorSwapchainFormat()

virtual EPixelFormat IStereoRenderTargetManager::GetActualColorSwapchainFormat ( ) const
inlinevirtual

Returns pixel format that the device created its swapchain with (which can be different than what was requested in AllocateRenderTargetTexture)

◆ GetMotionVectorDepthTexture()

virtual bool IStereoRenderTargetManager::GetMotionVectorDepthTexture ( uint32  Index,
const FIntPoint Size,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
FTextureRHIRef OutTexture,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates a motion vector depth texture. The default implementation always returns false to indicate that the stereo device doesn't support motion vector depth textures.

Parameters
Size(in) requested motion vector depth texture size
Format(in) requested motion vector depth texture format
NumMips(in) requested motion vector depth texture mips count
Flags(in) requested motion vector depth texture flags
OutTexture(out) motion vector depth texture resource allocated by the stereo device
NumSamples(in) requested motion vector depth texture samples count
Returns
true, if texture was allocated; false, if the stereo device can't provide a texture.

◆ GetMotionVectorTexture()

virtual bool IStereoRenderTargetManager::GetMotionVectorTexture ( uint32  Index,
const FIntPoint Size,
uint8  Format,
uint32  NumMips,
ETextureCreateFlags  Flags,
FTextureRHIRef OutTexture,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates a motion vector texture. The default implementation always returns false to indicate that the stereo device does not support motion vector textures.

Parameters
Size(in) requested motion vector texture size
Format(in) requested motion vector texture format
NumMips(in) requested motion vector texture mips count
Flags(in) requested motion vector texture flags
OutTexture(out) motion vector texture resource allocated by the stereo device
NumSamples(in) requested motion vector texture samples count
Returns
true, if texture was allocated; false, if the stereo device can't provide a texture.

◆ GetNumberOfBufferedFrames()

virtual uint32 IStereoRenderTargetManager::GetNumberOfBufferedFrames ( ) const
inlinevirtual

Returns number of required buffered frames.

◆ GetRecommendedMotionVectorTextureSize()

virtual bool IStereoRenderTargetManager::GetRecommendedMotionVectorTextureSize ( FIntPoint OutTextureSize)
inlinevirtual

Gets the size of the motion vector texture recommended by the stereo device. Allocating a motion vector texture of any other size may be detrimental to performance or be unsupported by the stereo device.

Parameters
OutTextureSize(out) The size of the motion vector texture.
Returns
true, if the stereo device can recommend a texture size; false, if not.

◆ GetStereoLayerPixelFormat()

static EPixelFormat IStereoRenderTargetManager::GetStereoLayerPixelFormat ( )
inlinestatic

◆ HDRGetMetaDataForStereo()

virtual bool IStereoRenderTargetManager::HDRGetMetaDataForStereo ( EDisplayOutputFormat OutDisplayOutputFormat,
EDisplayColorGamut OutDisplayColorGamut,
bool OutbHDRSupported 
)
inlinevirtual

Retrieves HDR information about the stereo device, if any is available. The default implementation always returns false to indicate that the information from the monitor can be used instead.

Parameters
OutDisplayOutputFormat(out) encoding used by the stereo device
OutDisplayColorGamut(out) color space used by the stereo device
OutbHDRSupported(out) whether HDR is supported by the stereo device
Returns
true, if HDR information is available for the stereo device

◆ NeedReAllocateDepthTexture()

virtual bool IStereoRenderTargetManager::NeedReAllocateDepthTexture ( const TRefCountPtr< struct IPooledRenderTarget > &  DepthTarget)
inlinevirtual

Returns true, if render target texture must be re-calculated.

◆ NeedReAllocateShadingRateTexture()

virtual bool IStereoRenderTargetManager::NeedReAllocateShadingRateTexture ( const TRefCountPtr< struct IPooledRenderTarget > &  ShadingRateTarget)
inlinevirtual

Returns true, if shading rate texture must be re-calculated.

◆ NeedReAllocateViewportRenderTarget()

virtual bool IStereoRenderTargetManager::NeedReAllocateViewportRenderTarget ( const class FViewport Viewport)
pure virtual

Returns true, if render target texture must be re-calculated.

Implemented in FFakeStereoRenderingDevice.

◆ ReconfigureForShaderPlatform()

virtual bool IStereoRenderTargetManager::ReconfigureForShaderPlatform ( EShaderPlatform  NewShaderPlatform)
inlinevirtual

In the editor, we may switch between preview shader platforms, which support various single-pass rendering methods (e.g. InstancedStereo or MobileMultiView). Sometimes RT managers have their own state that depends on the method, so this API provides them with the possibility to reconfigure it

◆ ShouldUseSeparateRenderTarget()

virtual bool IStereoRenderTargetManager::ShouldUseSeparateRenderTarget ( ) const
pure virtual

Whether a separate render target should be used or not. In case the stereo rendering implementation does not require special handling of separate render targets at all, it can leave out implementing this interface completely and simply let the default implementation of IStereoRendering::GetRenderTargetManager() return nullptr.

Implemented in FFakeStereoRenderingDevice.

◆ UpdateViewport()

virtual void IStereoRenderTargetManager::UpdateViewport ( bool  bUseSeparateRenderTarget,
const class FViewport Viewport,
class SViewport ViewportWidget = nullptr 
)
pure virtual

Updates viewport for direct rendering of distortion. Should be called on a game thread.

Parameters
bUseSeparateRenderTargetSet to true if a separate render target will be used. Can potentiallt be true even if ShouldUseSeparateRenderTarget() returned false earlier.
ViewportThe Viewport instance calling this method.
ViewportWidget(optional) The Viewport widget containing the view. Can be used to access SWindow object.

Implemented in FFakeStereoRenderingDevice.


The documentation for this class was generated from the following file: