MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Rendering::Textures Namespace Reference

Data Structures

struct  TTextureSize
 

Concepts

concept  CTextureSize
 

Typedefs

using FUnrealTextureSize = TTextureSize<uint32, EPixelFormat>
 

Functions

MCRO_API FRHITexture * GetRhiTexture2D (UTexture *target)
 
template<CEnum FormatType>
constexpr auto GetUnknownFormat ()
 
template<>
constexpr auto GetUnknownFormat< EPixelFormat > ()
 
template<>
constexpr auto GetUnknownFormat< ETextureRenderTargetFormat > ()
 
template<CEnum ToFormatType, CEnum FromFormatType>
requires (!CSameAs<ToFormatType, FromFormatType>)
ToFormatType ConvertFormat (FromFormatType from)
 
template<CEnum ToFormatType, CEnum FromFormatType>
requires CSameAs<ToFormatType, FromFormatType>
ToFormatType ConvertFormat (FromFormatType from)
 
template<>
FORCEINLINE_DEBUGGABLE ETextureRenderTargetFormat ConvertFormat< ETextureRenderTargetFormat, EPixelFormat > (EPixelFormat from)
 
template<>
FORCEINLINE_DEBUGGABLE EPixelFormat ConvertFormat< EPixelFormat, ETextureRenderTargetFormat > (ETextureRenderTargetFormat from)
 
template<CTextureSize Left, CTextureSize Right>
bool operator== (Left const &l, Right const &r)
 
template<CTextureSize Left, CTextureSize Right>
bool operator!= (Left const &l, Right const &r)
 
MCRO_API FUnrealTextureSize GetTextureSize (UTexture *texture)
 
template<>
FORCEINLINE constexpr auto GetUnknownFormat< DXGI_FORMAT > ()
 
template<>
MCROWINDOWS_API DXGI_FORMAT ConvertFormat< DXGI_FORMAT, EPixelFormat > (EPixelFormat from)
 
template<>
MCROWINDOWS_API EPixelFormat ConvertFormat< EPixelFormat, DXGI_FORMAT > (DXGI_FORMAT from)
 
template<>
MCROWINDOWS_API DXGI_FORMAT ConvertFormat< DXGI_FORMAT, ETextureRenderTargetFormat > (ETextureRenderTargetFormat from)
 
template<>
MCROWINDOWS_API ETextureRenderTargetFormat ConvertFormat< ETextureRenderTargetFormat, DXGI_FORMAT > (DXGI_FORMAT from)
 

Detailed Description

This namespace contain utilities regarding high-level cross-platform and cross-rhi texture objects

Typedef Documentation

◆ FUnrealTextureSize

Definition at line 182 of file Textures.h.

Function Documentation

◆ ConvertFormat() [1/2]

template<CEnum ToFormatType, CEnum FromFormatType>
requires (!CSameAs<ToFormatType, FromFormatType>)
ToFormatType Mcro::Rendering::Textures::ConvertFormat ( FromFormatType from)

Specialize this function template to define format conversion of equivalent formats between RHIs

Definition at line 46 of file Textures.h.

◆ ConvertFormat() [2/2]

template<CEnum ToFormatType, CEnum FromFormatType>
requires CSameAs<ToFormatType, FromFormatType>
ToFormatType Mcro::Rendering::Textures::ConvertFormat ( FromFormatType from)

Special case when ToFormatType and FromFormatType are the same there's no need for conversion

Definition at line 54 of file Textures.h.

◆ ConvertFormat< DXGI_FORMAT, EPixelFormat >()

template<>
MCROWINDOWS_API DXGI_FORMAT Mcro::Rendering::Textures::ConvertFormat< DXGI_FORMAT, EPixelFormat > ( EPixelFormat from)

◆ ConvertFormat< DXGI_FORMAT, ETextureRenderTargetFormat >()

template<>
MCROWINDOWS_API DXGI_FORMAT Mcro::Rendering::Textures::ConvertFormat< DXGI_FORMAT, ETextureRenderTargetFormat > ( ETextureRenderTargetFormat from)

◆ ConvertFormat< EPixelFormat, DXGI_FORMAT >()

template<>
MCROWINDOWS_API EPixelFormat Mcro::Rendering::Textures::ConvertFormat< EPixelFormat, DXGI_FORMAT > ( DXGI_FORMAT from)

◆ ConvertFormat< EPixelFormat, ETextureRenderTargetFormat >()

template<>
FORCEINLINE_DEBUGGABLE EPixelFormat Mcro::Rendering::Textures::ConvertFormat< EPixelFormat, ETextureRenderTargetFormat > ( ETextureRenderTargetFormat from)

Definition at line 87 of file Textures.h.

◆ ConvertFormat< ETextureRenderTargetFormat, DXGI_FORMAT >()

template<>
MCROWINDOWS_API ETextureRenderTargetFormat Mcro::Rendering::Textures::ConvertFormat< ETextureRenderTargetFormat, DXGI_FORMAT > ( DXGI_FORMAT from)

◆ ConvertFormat< ETextureRenderTargetFormat, EPixelFormat >()

template<>
FORCEINLINE_DEBUGGABLE ETextureRenderTargetFormat Mcro::Rendering::Textures::ConvertFormat< ETextureRenderTargetFormat, EPixelFormat > ( EPixelFormat from)

Definition at line 60 of file Textures.h.

◆ GetRhiTexture2D()

MCRO_API FRHITexture * Mcro::Rendering::Textures::GetRhiTexture2D ( UTexture * target)

Get the lower level RHI texture from a high level UTexture2D object if it's possible, nullptr otherwise

◆ GetTextureSize()

MCRO_API FUnrealTextureSize Mcro::Rendering::Textures::GetTextureSize ( UTexture * texture)

◆ GetUnknownFormat()

template<CEnum FormatType>
auto Mcro::Rendering::Textures::GetUnknownFormat ( )
constexpr

Specialize this function template to define the unknown format for an RHI texture format

Definition at line 38 of file Textures.h.

◆ GetUnknownFormat< DXGI_FORMAT >()

template<>
FORCEINLINE constexpr auto Mcro::Rendering::Textures::GetUnknownFormat< DXGI_FORMAT > ( )
constexpr

Definition at line 23 of file Textures.h.

◆ GetUnknownFormat< EPixelFormat >()

template<>
auto Mcro::Rendering::Textures::GetUnknownFormat< EPixelFormat > ( )
constexpr

Definition at line 40 of file Textures.h.

◆ GetUnknownFormat< ETextureRenderTargetFormat >()

template<>
auto Mcro::Rendering::Textures::GetUnknownFormat< ETextureRenderTargetFormat > ( )
constexpr

Definition at line 41 of file Textures.h.

◆ operator!=()

template<CTextureSize Left, CTextureSize Right>
bool Mcro::Rendering::Textures::operator!= ( Left const & l,
Right const & r )

Definition at line 180 of file Textures.h.

◆ operator==()

template<CTextureSize Left, CTextureSize Right>
bool Mcro::Rendering::Textures::operator== ( Left const & l,
Right const & r )

Definition at line 171 of file Textures.h.