Browse Source

GL: make the DynamicAttribute::Kind enum just 1 byte.

It's four values, 2 bits of information. No need to waste another 30.
pull/168/head
Vladimír Vondruš 2 years ago
parent
commit
139322be40
  1. 2
      src/Magnum/GL/Attribute.h
  2. 4
      src/Magnum/GL/Test/AttributeTest.cpp

2
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,

4
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() {

Loading…
Cancel
Save