Browse Source

GL: make Buffer::TargetHint just 16-bit.

Which, thanks to a 3-byte padding being now just 1 byte, makes the
Buffer class 8 bytes large instead of 12. And in turn, the internal
Mesh::AttributeLayout struct is now 40 bytes instead of 48 as there's no
longer an extra 4 bytes of padding to satisfy 8-byte alignment of the
offset member. Still can go lower than that.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
2904c247aa
  1. 6
      src/Magnum/GL/Buffer.h

6
src/Magnum/GL/Buffer.h

@ -256,7 +256,11 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
* @see @ref Buffer(), @ref setTargetHint()
* @m_enum_values_as_keywords
*/
enum class TargetHint: GLenum {
/* The type is a (32bit) GLenum, but all values fit into 16 bits, I
suppose thanks to backwards compatibility with systems where int is
just 16 bit. Restricting the type size makes the class 8 instead of
12 bytes. */
enum class TargetHint: UnsignedShort {
/** Used for storing vertex attributes. */
Array = GL_ARRAY_BUFFER,

Loading…
Cancel
Save