Graphics: Add PipelinePassList loader (able to load from a file)
Fix compilation
This commit is contained in:
committed by
Jérôme Leclercq
parent
ef0a34b7b1
commit
886991f86d
@@ -76,7 +76,8 @@ namespace Nz
|
||||
|
||||
static inline bool HasAlpha(PixelFormat format);
|
||||
|
||||
static PixelFormat IdentifyFormat(const PixelFormatDescription& info);
|
||||
static inline PixelFormat IdentifyFormat(const PixelFormatDescription& info);
|
||||
static inline PixelFormat IdentifyFormat(std::string_view formatName);
|
||||
|
||||
static inline bool IsCompressed(PixelFormat format);
|
||||
static inline bool IsConversionSupported(PixelFormat srcFormat, PixelFormat dstFormat);
|
||||
|
||||
@@ -243,6 +243,30 @@ namespace Nz
|
||||
return s_pixelFormatInfos[format].alphaMask.TestAny();
|
||||
}
|
||||
|
||||
inline PixelFormat PixelFormatInfo::IdentifyFormat(const PixelFormatDescription& info)
|
||||
{
|
||||
for (auto&& [format, formatDesc] : s_pixelFormatInfos.iter_kv())
|
||||
{
|
||||
if (info.bitsPerPixel == formatDesc.bitsPerPixel && info.content == formatDesc.content &&
|
||||
info.redMask == formatDesc.redMask && info.greenMask == formatDesc.greenMask && info.blueMask == formatDesc.blueMask && info.alphaMask == formatDesc.alphaMask &&
|
||||
info.redType == formatDesc.redType && info.greenType == formatDesc.greenType && info.blueType == formatDesc.blueType && info.alphaType == formatDesc.alphaType)
|
||||
return format;
|
||||
}
|
||||
|
||||
return PixelFormat::Undefined;
|
||||
}
|
||||
|
||||
inline PixelFormat PixelFormatInfo::IdentifyFormat(std::string_view formatName)
|
||||
{
|
||||
for (auto&& [format, formatDesc] : s_pixelFormatInfos.iter_kv())
|
||||
{
|
||||
if (formatDesc.name == formatName)
|
||||
return format;
|
||||
}
|
||||
|
||||
return PixelFormat::Undefined;
|
||||
}
|
||||
|
||||
inline bool PixelFormatInfo::IsCompressed(PixelFormat format)
|
||||
{
|
||||
return s_pixelFormatInfos[format].IsCompressed();
|
||||
|
||||
Reference in New Issue
Block a user