From 7cf2a1d5ca6c6b4cba30691d1f61e85258b2f813 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 15 Dec 2020 09:45:41 +0300 Subject: [PATCH] Add 10-10-10-2 pixel type --- libs/gfx/include/psemek/gfx/pixel.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libs/gfx/include/psemek/gfx/pixel.hpp b/libs/gfx/include/psemek/gfx/pixel.hpp index 560538f6..c174a4c1 100644 --- a/libs/gfx/include/psemek/gfx/pixel.hpp +++ b/libs/gfx/include/psemek/gfx/pixel.hpp @@ -25,6 +25,11 @@ namespace psemek::gfx struct uint10; struct uint12; + struct uint10_10_10_2 + { + std::uint32_t value; + }; + template struct integer; @@ -127,6 +132,16 @@ namespace psemek::gfx static constexpr GLenum type = gl::UNSIGNED_BYTE; }; + // Normalized 10-10-10-2 + + template <> + struct pixel_traits + { + static constexpr GLenum internal_format = gl::RGB10_A2; + static constexpr GLenum format = gl::RGBA; + static constexpr GLenum type = gl::UNSIGNED_BYTE; + }; + // Unsigned 8-bit template <>