Skip to content

Commit

Permalink
R16 Texture format support (temporary fix) (#1391)
Browse files Browse the repository at this point in the history
Temporary fix for a user until this is done and replaces this change:
#1392
  • Loading branch information
CedricGuillemet authored Jun 24, 2024
1 parent f255831 commit 6cfd949
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Plugins/NativeEngine/Source/NativeEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ namespace Babylon
bimg::ImageContainer* PrepareImage(bx::AllocatorI& allocator, bimg::ImageContainer* image, bool invertY, bool srgb, bool generateMips)
{
assert(
image->m_format == bimg::TextureFormat::R16 ||
image->m_format == bimg::TextureFormat::RGB8 ||
image->m_format == bimg::TextureFormat::RGBA8 ||
image->m_format == bimg::TextureFormat::RGBA16 ||
Expand Down Expand Up @@ -266,7 +267,7 @@ namespace Babylon
image = bimg::imageConvert(&allocator, bimg::TextureFormat::RGBA8, *image, false);
bimg::imageFree(oldImage);
}
else if (image->m_format == bimg::TextureFormat::RGBA16)
else if (image->m_format == bimg::TextureFormat::RGBA16 || image->m_format == bimg::TextureFormat::R16)
{
bimg::ImageContainer* oldImage{image};
image = bimg::imageConvert(&allocator, bimg::TextureFormat::RGBA32F, *image, false);
Expand Down

0 comments on commit 6cfd949

Please sign in to comment.