Browse Source

doc: discourage using MeshIndexType::UnsignedByte.

pull/495/head
Vladimír Vondruš 5 years ago
parent
commit
755d97121c
  1. 15
      src/Magnum/GL/Mesh.h
  2. 13
      src/Magnum/Mesh.h
  3. 9
      src/Magnum/Vk/Mesh.h

15
src/Magnum/GL/Mesh.h

@ -172,11 +172,20 @@ MAGNUM_GL_EXPORT MeshPrimitive meshPrimitive(Magnum::MeshPrimitive primitive);
@m_enum_values_as_keywords @m_enum_values_as_keywords
*/ */
enum class MeshIndexType: GLenum { enum class MeshIndexType: GLenum {
UnsignedByte = GL_UNSIGNED_BYTE, /**< Unsigned byte */ /**
UnsignedShort = GL_UNSIGNED_SHORT, /**< Unsigned short */ * @relativeref{Magnum,UnsignedByte}.
*
* Even though OpenGL historically supports 8-bit indices, using this type
* is discouraged on contemporary GPU architectures. Prefer using 16-bit
* indices instead.
*/
UnsignedByte = GL_UNSIGNED_BYTE,
/** @relativeref{Magnum,UnsignedShort} */
UnsignedShort = GL_UNSIGNED_SHORT,
/** /**
* Unsigned int * @relativeref{Magnum,UnsignedInt}
* @requires_gles30 Extension @gl_extension{OES,element_index_uint} * @requires_gles30 Extension @gl_extension{OES,element_index_uint}
* in OpenGL ES 2.0. * in OpenGL ES 2.0.
* @requires_webgl20 Extension @webgl_extension{OES,element_index_uint} * @requires_webgl20 Extension @webgl_extension{OES,element_index_uint}

13
src/Magnum/Mesh.h

@ -249,17 +249,18 @@ enum class MeshIndexType: UnsignedByte {
/* Zero reserved for an invalid type (but not being a named value) */ /* Zero reserved for an invalid type (but not being a named value) */
/** /**
* Unsigned byte * @relativeref{Magnum,UnsignedByte}.
* *
* Corresponds to @ref GL::MeshIndexType::UnsignedByte / * Corresponds to @ref GL::MeshIndexType::UnsignedByte /
* @ref Vk::MeshIndexTyúe::UnsignedByte. Note that using this * @ref Vk::MeshIndexType::UnsignedByte. Even though OpenGL supports this
* type is discouraged, at least AMD GPUs are known to suggest (via debug * type and Vulkan can as well via an extension, using this type is
* output) using 16-byte types instead for better efficiency. * discouraged on contemporary GPU architectures. Prefer using 16-bit
* indices instead.
*/ */
UnsignedByte = 1, UnsignedByte = 1,
/** /**
* Unsigned short * @relativeref{Magnum,UnsignedShort}.
* *
* Corresponds to @ref GL::MeshIndexType::UnsignedShort / * Corresponds to @ref GL::MeshIndexType::UnsignedShort /
* @ref Vk::MeshIndexType::UnsignedShort. * @ref Vk::MeshIndexType::UnsignedShort.
@ -267,7 +268,7 @@ enum class MeshIndexType: UnsignedByte {
UnsignedShort, UnsignedShort,
/** /**
* Unsigned int * @relativeref{Magnum,UnsignedInt}.
* *
* Corresponds to @ref GL::MeshIndexType::UnsignedInt / * Corresponds to @ref GL::MeshIndexType::UnsignedInt /
* @ref Vk::MeshIndexType::UnsignedInt. * @ref Vk::MeshIndexType::UnsignedInt.

9
src/Magnum/Vk/Mesh.h

@ -44,7 +44,14 @@ Wraps a @type_vk_keyword{IndexType}.
*/ */
enum class MeshIndexType: Int { enum class MeshIndexType: Int {
/** /**
* @ref Magnum::UnsignedByte "UnsignedByte" * @ref Magnum::UnsignedByte "UnsignedByte".
*
* @m_class{m-note m-success}
*
* @par
* Discouraged on contemporary GPU architectures, prefer to use 16-bit
* indices instead.
*
* @requires_vk_feature @ref DeviceFeature::IndexTypeUnsignedByte * @requires_vk_feature @ref DeviceFeature::IndexTypeUnsignedByte
*/ */
UnsignedByte = VK_INDEX_TYPE_UINT8_EXT, UnsignedByte = VK_INDEX_TYPE_UINT8_EXT,

Loading…
Cancel
Save