diff --git a/libs/gfx/include/psemek/gfx/pixel.hpp b/libs/gfx/include/psemek/gfx/pixel.hpp index 1557aea1..588b6d8f 100644 --- a/libs/gfx/include/psemek/gfx/pixel.hpp +++ b/libs/gfx/include/psemek/gfx/pixel.hpp @@ -17,6 +17,14 @@ namespace psemek::gfx std::uint8_t stencil; }; + struct float16 + { + std::uint16_t value; + }; + + struct uint10; + struct uint12; + template struct pixel_traits; @@ -53,35 +61,59 @@ namespace psemek::gfx }; template <> - struct pixel_traits + struct pixel_traits { - static constexpr GLenum internal_format = gl::R8; + static constexpr GLenum internal_format = gl::R16; static constexpr GLenum format = gl::RED; - static constexpr GLenum type = gl::BYTE; + static constexpr GLenum type = gl::UNSIGNED_BYTE; }; template <> - struct pixel_traits> + struct pixel_traits> { - static constexpr GLenum internal_format = gl::RG8; + static constexpr GLenum internal_format = gl::RG16; static constexpr GLenum format = gl::RG; - static constexpr GLenum type = gl::BYTE; + static constexpr GLenum type = gl::UNSIGNED_BYTE; }; template <> - struct pixel_traits> + struct pixel_traits> { - static constexpr GLenum internal_format = gl::RGB8; + static constexpr GLenum internal_format = gl::RGB16; static constexpr GLenum format = gl::RGB; - static constexpr GLenum type = gl::BYTE; + static constexpr GLenum type = gl::UNSIGNED_BYTE; }; template <> - struct pixel_traits> + struct pixel_traits> { - static constexpr GLenum internal_format = gl::RGBA8; + static constexpr GLenum internal_format = gl::RGBA16; static constexpr GLenum format = gl::RGBA; - static constexpr GLenum type = gl::BYTE; + static constexpr GLenum type = gl::UNSIGNED_BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGB10; + static constexpr GLenum format = gl::RGB; + static constexpr GLenum type = gl::UNSIGNED_BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGB12; + static constexpr GLenum format = gl::RGB; + static constexpr GLenum type = gl::UNSIGNED_BYTE; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGBA12; + static constexpr GLenum format = gl::RGBA; + static constexpr GLenum type = gl::UNSIGNED_BYTE; }; template <> @@ -92,6 +124,62 @@ namespace psemek::gfx static constexpr GLenum type = gl::FLOAT; }; + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RG32F; + static constexpr GLenum format = gl::RG; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGB32F; + static constexpr GLenum format = gl::RGB; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGBA32F; + static constexpr GLenum format = gl::RGBA; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits + { + static constexpr GLenum internal_format = gl::R16F; + static constexpr GLenum format = gl::RED; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RG16F; + static constexpr GLenum format = gl::RG; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGB16F; + static constexpr GLenum format = gl::RGB; + static constexpr GLenum type = gl::FLOAT; + }; + + template <> + struct pixel_traits> + { + static constexpr GLenum internal_format = gl::RGBA16F; + static constexpr GLenum format = gl::RGBA; + static constexpr GLenum type = gl::FLOAT; + }; + template <> struct pixel_traits {