UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FD3D12Viewport Class Reference

#include <D3D12Viewport.h>

+ Inheritance diagram for FD3D12Viewport:

Public Member Functions

 FD3D12Viewport (class FD3D12Adapter *InParent, HWND InWindowHandle, uint32 InSizeX, uint32 InSizeY, bool bInIsFullscreen, EPixelFormat InPixelFormat, uint32 InNumBackBuffers)
 
void Init ()
 
 ~FD3D12Viewport ()
 
void Resize (uint32 InSizeX, uint32 InSizeY, bool bInIsFullscreen, EPixelFormat PreferredPixelFormat)
 
void ConditionalResetSwapChain (bool bIgnoreFocus)
 
bool Present (class FD3D12CommandContextBase &Context, bool bLockToVsync)
 
FIntPoint GetSizeXY () const
 
FD3D12TextureGetBackBuffer_RenderThread () const
 
FD3D12TextureGetBackBuffer_RHIThread () const
 
FD3D12TextureGetSDRBackBuffer_RHIThread () const
 
virtual void WaitForFrameEventCompletion () override
 
virtual void IssueFrameEvent () override
 
virtual voidGetNativeSwapChain () const override
 
virtual voidGetNativeBackBufferTexture () const override
 
virtual voidGetNativeBackBufferRT () const override
 
virtual void SetCustomPresent (FRHICustomPresent *InCustomPresent) override
 
virtual FRHICustomPresentGetCustomPresent () const override
 
virtual voidGetNativeWindow (void **AddParam=nullptr) const override
 
uint32 GetNumBackBuffers () const
 
const bool IsFullscreen () const
 
bool CurrentOutputSupportsHDR () const
 
void AdvanceExpectedBackBufferIndex_RenderThread ()
 
void OnResumeRendering ()
 
void OnSuspendRendering ()
 
- Public Member Functions inherited from FRHIViewport
 FRHIViewport ()
 
virtual FRHITextureGetOptionalSDRBackBuffer (FRHITexture *BackBuffer) const
 
virtual void Tick (float DeltaTime)
 
- Public Member Functions inherited from FRHIResource
RHI_API FRHIResource (ERHIResourceType InResourceType)
 
uint32 AddRef () const
 
uint32 Release () const
 
uint32 GetRefCount () const
 
bool IsValid () const
 
void DisableLifetimeExtension ()
 
ERHIResourceType GetType () const
 
FName GetOwnerName () const
 
void SetOwnerName (FName InOwnerName)
 
- Public Member Functions inherited from FD3D12AdapterChild
 FD3D12AdapterChild (FD3D12Adapter *InParent=nullptr)
 
FORCEINLINE FD3D12AdapterGetParentAdapter () const
 
void SetParentAdapter (FD3D12Adapter *InParent)
 

Static Public Attributes

static FCriticalSection DXGIBackBufferLock
 

Additional Inherited Members

- Protected Member Functions inherited from FRHIResource
virtual RHI_API ~FRHIResource ()
 
- Protected Attributes inherited from FD3D12AdapterChild
FD3D12AdapterParentAdapter
 

Constructor & Destructor Documentation

◆ FD3D12Viewport()

FD3D12Viewport::FD3D12Viewport ( class FD3D12Adapter InParent,
HWND  InWindowHandle,
uint32  InSizeX,
uint32  InSizeY,
bool  bInIsFullscreen,
EPixelFormat  InPixelFormat,
uint32  InNumBackBuffers 
)

◆ ~FD3D12Viewport()

FD3D12Viewport::~FD3D12Viewport ( )

Member Function Documentation

◆ AdvanceExpectedBackBufferIndex_RenderThread()

void FD3D12Viewport::AdvanceExpectedBackBufferIndex_RenderThread ( )

Advance and get the next present GPU index

Update the expected next present GPU back buffer index from RenderThread point of view

◆ ConditionalResetSwapChain()

void FD3D12Viewport::ConditionalResetSwapChain ( bool  bIgnoreFocus)

If the swap chain has been invalidated by DXGI, resets the swap chain to the expected state; otherwise, does nothing. Called once/frame by the game thread on all viewports.

Parameters
bIgnoreFocus- Whether the reset should happen regardless of whether the window is focused.

◆ CurrentOutputSupportsHDR()

bool FD3D12Viewport::CurrentOutputSupportsHDR ( ) const

Query the swap chain's current connected output for HDR support.

◆ GetBackBuffer_RenderThread()

FD3D12Texture * FD3D12Viewport::GetBackBuffer_RenderThread ( ) const
inline

◆ GetBackBuffer_RHIThread()

FD3D12Texture * FD3D12Viewport::GetBackBuffer_RHIThread ( ) const
inline

◆ GetCustomPresent()

FRHICustomPresent * FD3D12Viewport::GetCustomPresent ( ) const
overridevirtual

Returns currently set custom present handler.

Reimplemented from FRHIViewport.

◆ GetNativeBackBufferRT()

void * FD3D12Viewport::GetNativeBackBufferRT ( ) const
overridevirtual

Returns access to the platform-specific native resource pointer to a backbuffer rendertarget. This is designed to be used to provide plugins with access to the underlying resource and should be used very carefully or not at all.

Returns
The pointer to the native resource or NULL if it not initialized or not supported for this resource type for some reason

Reimplemented from FRHIViewport.

◆ GetNativeBackBufferTexture()

void * FD3D12Viewport::GetNativeBackBufferTexture ( ) const
overridevirtual

Returns access to the platform-specific native resource pointer to a backbuffer texture. This is designed to be used to provide plugins with access to the underlying resource and should be used very carefully or not at all.

Returns
The pointer to the native resource or NULL if it not initialized or not supported for this resource type for some reason

Reimplemented from FRHIViewport.

◆ GetNativeSwapChain()

void * FD3D12Viewport::GetNativeSwapChain ( ) const
overridevirtual

Returns access to the platform-specific native resource pointer. This is designed to be used to provide plugins with access to the underlying resource and should be used very carefully or not at all.

Returns
The pointer to the native resource or NULL if it not initialized or not supported for this resource type for some reason

Reimplemented from FRHIViewport.

◆ GetNativeWindow()

virtual void * FD3D12Viewport::GetNativeWindow ( void **  AddParam = nullptr) const
inlineoverridevirtual

Returns access to the platform-specific native window. This is designed to be used to provide plugins with access to the underlying resource and should be used very carefully or not at all.

Returns
The pointer to the native resource or NULL if it not initialized or not supported for this resource type for some reason. AddParam could represent any additional platform-specific data (could be null).

Reimplemented from FRHIViewport.

◆ GetNumBackBuffers()

uint32 FD3D12Viewport::GetNumBackBuffers ( ) const
inline

◆ GetSDRBackBuffer_RHIThread()

FD3D12Texture * FD3D12Viewport::GetSDRBackBuffer_RHIThread ( ) const
inline

◆ GetSizeXY()

FIntPoint FD3D12Viewport::GetSizeXY ( ) const
inline

◆ Init()

void FD3D12Viewport::Init ( )

◆ IsFullscreen()

const bool FD3D12Viewport::IsFullscreen ( ) const
inline

◆ IssueFrameEvent()

void FD3D12Viewport::IssueFrameEvent ( )
overridevirtual

Reimplemented from FRHIViewport.

◆ OnResumeRendering()

void FD3D12Viewport::OnResumeRendering ( )

◆ OnSuspendRendering()

void FD3D12Viewport::OnSuspendRendering ( )

◆ Present()

bool FD3D12Viewport::Present ( class FD3D12CommandContextBase Context,
bool  bLockToVsync 
)

Presents the swap chain. Returns true if Present was done by Engine.

◆ Resize()

void FD3D12Viewport::Resize ( uint32  InSizeX,
uint32  InSizeY,
bool  bInIsFullscreen,
EPixelFormat  PreferredPixelFormat 
)

◆ SetCustomPresent()

void FD3D12Viewport::SetCustomPresent ( FRHICustomPresent )
overridevirtual

Sets custom Present handler on the viewport

Reimplemented from FRHIViewport.

◆ WaitForFrameEventCompletion()

void FD3D12Viewport::WaitForFrameEventCompletion ( )
overridevirtual

Reimplemented from FRHIViewport.

Member Data Documentation

◆ DXGIBackBufferLock

FCriticalSection FD3D12Viewport::DXGIBackBufferLock
static

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