OpenGL float support (#1717)

This commit is contained in:
Alex Cristici
2023-10-02 21:20:30 +03:00
committed by GitHub
parent 44b5af7c4a
commit 4e65763bc1

View File

@@ -398,6 +398,14 @@ platform::GLenum Enum<gfx::TexturePixelType>::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<gfx::TextureChannelDataType>::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<gfx::TextureChannelDataType>::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;
}