37 template <CEnum FormatType>
44 template <CEnum ToFormatType, CEnum FromFormatType>
45 requires (!CSameAs<ToFormatType, FromFormatType>)
48 return static_cast<ToFormatType
>(from);
52 template <CEnum ToFormatType, CEnum FromFormatType>
53 requires CSameAs<ToFormatType, FromFormatType>
64 case PF_G8:
return RTF_R8;
65 case PF_R8G8:
return RTF_RG8;
66 case PF_B8G8R8A8:
return RTF_RGBA8;
68 case PF_R16F:
return RTF_R16f;
69 case PF_G16R16F:
return RTF_RG16f;
70 case PF_FloatRGBA:
return RTF_RGBA16f;
72 case PF_R32_FLOAT:
return RTF_R32f;
73 case PF_G32R32F:
return RTF_RG32f;
74 case PF_A32B32G32R32F:
return RTF_RGBA32f;
75 case PF_A2B10G10R10:
return RTF_RGB10A2;
79 ->WithMessageF(TEXT(
"Unhandled ETextureRenderTargetFormat entry %s"), GetPixelFormatString(from))
92 case RTF_R8:
return PF_G8;
93 case RTF_RG8:
return PF_R8G8;
94 case RTF_RGBA8:
return PF_B8G8R8A8;
95 case RTF_RGBA8_SRGB:
return PF_B8G8R8A8;
97 case RTF_R16f:
return PF_R16F;
98 case RTF_RG16f:
return PF_G16R16F;
99 case RTF_RGBA16f:
return PF_FloatRGBA;
101 case RTF_R32f:
return PF_R32_FLOAT;
102 case RTF_RG32f:
return PF_G32R32F;
103 case RTF_RGBA32f:
return PF_A32B32G32R32F;
104 case RTF_RGB10A2:
return PF_A2B10G10R10;
107 auto enumName = UEnum::GetValueAsString(from);
109 ->WithMessageF(TEXT(
"Unhandled ETextureRenderTargetFormat entry %s"), *enumName)
123 template <CScalar SizeType, CEnum InFormatType>
130 template <CScalar SizeTypeArg, CEnum FormatTypeArg>
131 TTextureSize(SizeTypeArg width, SizeTypeArg height, FormatTypeArg format)
132 :
Width(static_cast<SizeType>(width))
133 ,
Height(static_cast<SizeType>(height))
137 template <CTextureSize OtherTextureSize>
144 template <CTextureSize OtherTextureSize>
155 operator bool()
const
160 template <CTextureSize OtherTextureSize>
161 operator OtherTextureSize()
const
163 return OtherTextureSize(
170 template <CTextureSize Left, CTextureSize Right>
173 return l.Width == r.Width
174 && l.Height == r.Height
179 template <CTextureSize Left, CTextureSize Right>
180 bool operator != (Left
const& l, Right
const& r) {
return !(l == r); }
constexpr auto GetUnknownFormat< ETextureRenderTargetFormat >()
FORCEINLINE_DEBUGGABLE EPixelFormat ConvertFormat< EPixelFormat, ETextureRenderTargetFormat >(ETextureRenderTargetFormat from)
MCRO_API FUnrealTextureSize GetTextureSize(UTexture *texture)
FORCEINLINE_DEBUGGABLE ETextureRenderTargetFormat ConvertFormat< ETextureRenderTargetFormat, EPixelFormat >(EPixelFormat from)
constexpr auto GetUnknownFormat< EPixelFormat >()
constexpr auto GetUnknownFormat()
bool operator==(Left const &l, Right const &r)
bool operator!=(Left const &l, Right const &r)
MCRO_API FRHITexture * GetRhiTexture2D(UTexture *target)
ToFormatType ConvertFormat(FromFormatType from)
TTextureSize(OtherTextureSize &&other)
TTextureSize(OtherTextureSize const &other)
TTextureSize(SizeTypeArg width, SizeTypeArg height, FormatTypeArg format)