Graphics: Add PipelinePassList loader (able to load from a file)

Fix compilation
This commit is contained in:
SirLynix
2023-11-05 17:33:16 +01:00
committed by Jérôme Leclercq
parent ef0a34b7b1
commit 886991f86d
16 changed files with 737 additions and 39 deletions

View File

@@ -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);

View File

@@ -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();