ES 3: Use sized internal formats for half float textures (#1015)

Co-authored-by: Alex Cristici <alex.cristici@gmail.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
mwilsnd
2023-04-15 06:14:42 -05:00
committed by GitHub
parent 12fcba89bf
commit 2e4e963d89
3 changed files with 24 additions and 1 deletions

View File

@@ -265,6 +265,26 @@ platform::GLenum Enum<gfx::TexturePixelType>::to(const gfx::TexturePixelType val
return GL_INVALID_ENUM;
}
template <> template<>
platform::GLenum Enum<gfx::TexturePixelType>::sizedFor<>(const gfx::TexturePixelType value,
gfx::TextureChannelDataType type)
{
switch (type) {
case gfx::TextureChannelDataType::UnsignedByte: {
return Enum<gfx::TexturePixelType>::to(value);
}
case gfx::TextureChannelDataType::HalfFloat: {
switch (value) {
case gfx::TexturePixelType::RGBA:
return GL_RGBA16F;
default: break;
}
}
}
return GL_INVALID_ENUM;
}
template <>
gfx::TextureChannelDataType Enum<gfx::TextureChannelDataType>::from(const platform::GLint value) {
switch (value) {