From 139322be404b94113440d0a07ff45bcbc16d145d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 23 Nov 2023 12:22:26 +0100 Subject: [PATCH] GL: make the DynamicAttribute::Kind enum just 1 byte. It's four values, 2 bits of information. No need to waste another 30. --- src/Magnum/GL/Attribute.h | 2 +- src/Magnum/GL/Test/AttributeTest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Magnum/GL/Attribute.h b/src/Magnum/GL/Attribute.h index f4bb942c2..4a65335b2 100644 --- a/src/Magnum/GL/Attribute.h +++ b/src/Magnum/GL/Attribute.h @@ -421,7 +421,7 @@ class MAGNUM_GL_EXPORT DynamicAttribute { * Specifies what kind of shader type matches the attribute. * @see @ref DynamicAttribute() */ - enum class Kind { + enum class Kind: UnsignedByte { /** Generic, matches single-precision floating-point shader type */ Generic, diff --git a/src/Magnum/GL/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp index b2107458e..cb22c88d8 100644 --- a/src/Magnum/GL/Test/AttributeTest.cpp +++ b/src/Magnum/GL/Test/AttributeTest.cpp @@ -1002,8 +1002,8 @@ void AttributeTest::debugDataTypeVector4() { void AttributeTest::debugDynamicKind() { std::ostringstream out; - Debug{&out} << DynamicAttribute::Kind::GenericNormalized << DynamicAttribute::Kind(0xdead); - CORRADE_COMPARE(out.str(), "GL::DynamicAttribute::Kind::GenericNormalized GL::DynamicAttribute::Kind(0xdead)\n"); + Debug{&out} << DynamicAttribute::Kind::GenericNormalized << DynamicAttribute::Kind(0xfe); + CORRADE_COMPARE(out.str(), "GL::DynamicAttribute::Kind::GenericNormalized GL::DynamicAttribute::Kind(0xfe)\n"); } void AttributeTest::debugDynamicComponents() {