From 4e65763bc126b48cd70470d25c3a3efd2e32bed5 Mon Sep 17 00:00:00 2001 From: Alex Cristici Date: Mon, 2 Oct 2023 21:20:30 +0300 Subject: [PATCH] OpenGL float support (#1717) --- src/mbgl/gl/enum.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mbgl/gl/enum.cpp b/src/mbgl/gl/enum.cpp index 060435e28..58dc1e656 100644 --- a/src/mbgl/gl/enum.cpp +++ b/src/mbgl/gl/enum.cpp @@ -398,6 +398,14 @@ platform::GLenum Enum::sizedFor<>(const gfx::TexturePixel break; } } + case gfx::TextureChannelDataType::Float: { + switch (value) { + case gfx::TexturePixelType::RGBA: + return GL_RGBA32F; + default: + break; + } + } } return GL_INVALID_ENUM; @@ -410,6 +418,8 @@ gfx::TextureChannelDataType Enum::from(const platfo return gfx::TextureChannelDataType::UnsignedByte; case GL_HALF_FLOAT: return gfx::TextureChannelDataType::HalfFloat; + case GL_FLOAT: + return gfx::TextureChannelDataType::Float; } return {}; } @@ -421,6 +431,8 @@ platform::GLenum Enum::to(const gfx::TextureChannel return GL_UNSIGNED_BYTE; case gfx::TextureChannelDataType::HalfFloat: return GL_HALF_FLOAT; + case gfx::TextureChannelDataType::Float: + return GL_FLOAT; } return GL_INVALID_ENUM; }