5 return s_BitsPerElement[format];
11 return s_ChannelCount[format];
17 return format == DFloat || format == D16 || format == D24S8;
21PL_FORCE_INLINE
bool plGALResourceFormat::IsStencilFormat(Enum format)
23 return format == D24S8;
27PL_FORCE_INLINE
bool plGALResourceFormat::IsSrgb(plGALResourceFormat::Enum format)
29 return format == BGRAUByteNormalizedsRGB || format == RGBAUByteNormalizedsRGB || format == BC1sRGB || format == BC2sRGB || format == BC3sRGB ||
30 format == BC7UNormalizedsRGB;
38 case plGALResourceFormat::D16:
40 case plGALResourceFormat::RGBAUInt:
41 case plGALResourceFormat::RGBAInt:
43 case plGALResourceFormat::RGBUInt:
44 case plGALResourceFormat::RGBInt:
46 case plGALResourceFormat::RGBAUShort:
47 case plGALResourceFormat::RGBAShort:
49 case plGALResourceFormat::RGUInt:
50 case plGALResourceFormat::RGInt:
52 case plGALResourceFormat::RGB10A2UInt:
54 case plGALResourceFormat::RGBAUByte:
55 case plGALResourceFormat::RGBAByte:
57 case plGALResourceFormat::RGUShort:
58 case plGALResourceFormat::RGShort:
60 case plGALResourceFormat::RGUByte:
61 case plGALResourceFormat::RGByte:
63 case plGALResourceFormat::RUInt:
64 case plGALResourceFormat::RInt:
66 case plGALResourceFormat::RUShort:
67 case plGALResourceFormat::RShort:
69 case plGALResourceFormat::RUByte:
70 case plGALResourceFormat::RByte:
87 case RGBAShortNormalized:
90 case RGB10A2UIntNormalized:
92 case RGBAByteNormalized:
96 case RGShortNormalized:
98 case RGByteNormalized:
103 case RShortNormalized:
105 case RByteNormalized:
115template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
117 : m_eStorage(InvalidFormat)
118 , m_eRenderTarget(InvalidFormat)
119 , m_eDepthOnlyType(InvalidFormat)
120 , m_eStencilOnlyType(InvalidFormat)
121 , m_eDepthStencilType(InvalidFormat)
122 , m_eVertexAttributeType(InvalidFormat)
123 , m_eResourceViewType(InvalidFormat)
128template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
130 : m_eStorage(storage)
131 , m_eRenderTarget(InvalidFormat)
132 , m_eDepthOnlyType(InvalidFormat)
133 , m_eStencilOnlyType(InvalidFormat)
134 , m_eDepthStencilType(InvalidFormat)
135 , m_eVertexAttributeType(InvalidFormat)
136 , m_eResourceViewType(InvalidFormat)
140template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
142 NativeFormatType renderTargetType)
144 m_eRenderTarget = renderTargetType;
148template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
151 m_eDepthOnlyType = depthOnlyType;
155template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
158 m_eStencilOnlyType = stencilOnlyType;
162template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
164 NativeFormatType depthStencilType)
166 m_eDepthStencilType = depthStencilType;
170template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
172 NativeFormatType vertexAttributeType)
174 m_eVertexAttributeType = vertexAttributeType;
178template <
typename NativeFormatType, NativeFormatType Inval
idFormat>
180 NativeFormatType resourceViewType)
182 m_eResourceViewType = resourceViewType;
187template <
typename FormatClass>
190 for (plUInt32 i = 0; i < plGALResourceFormat::ENUM_COUNT; i++)
192 m_Formats[i] = FormatClass();
196template <
typename FormatClass>
199 return m_Formats[format];
202template <
typename FormatClass>
205 m_Formats[format] = newFormatInfo;
Definition ResourceFormats.h:136