Add missing support for some formats in TextureTool

This commit is contained in:
Wojtek Figat
2021-10-11 14:02:41 +02:00
parent bcbfaa347a
commit 7880bbe7ec
3 changed files with 38 additions and 4 deletions

View File

@@ -610,7 +610,20 @@ TextureTool::PixelFormatSampler PixelFormatSamplers[] =
},
[](const void* ptr, const Color& color)
{
*(FloatR11G11B10*)ptr = Float1010102(color.R, color.G, color.B, color.A);
*(FloatR11G11B10*)ptr = FloatR11G11B10(color.R, color.G, color.B);
},
},
{
PixelFormat::R10G10B10A2_UNorm,
sizeof(Float1010102),
[](const void* ptr)
{
const Vector3 rgb = ((Float1010102*)ptr)->ToVector3();
return Color(rgb.X, rgb.Y, rgb.Z);
},
[](const void* ptr, const Color& color)
{
*(Float1010102*)ptr = Float1010102(color.R, color.G, color.B, color.A);
},
},
};