Browse Source

GL: rename PixelType::HalfFloat and Attribute::DataType::HalfFloat to Half.

For consistency with the Half type we use elsewhere. The old enums are
still available, but deprecated and scheduled for removal.
pull/369/head
Vladimír Vondruš 6 years ago
parent
commit
946c3cdac9
  1. 8
      doc/changelog.dox
  2. 2
      src/Magnum/GL/AbstractTexture.cpp
  3. 14
      src/Magnum/GL/Attribute.cpp
  4. 51
      src/Magnum/GL/Attribute.h
  5. 16
      src/Magnum/GL/Implementation/pixelFormatMapping.hpp
  6. 4
      src/Magnum/GL/PixelFormat.cpp
  7. 13
      src/Magnum/GL/PixelFormat.h
  8. 6
      src/Magnum/GL/Test/AttributeTest.cpp
  9. 2
      src/Magnum/GL/Test/FramebufferGLTest.cpp
  10. 10
      src/Magnum/GL/Test/MeshGLTest.cpp
  11. 28
      src/Magnum/GL/TextureFormat.h
  12. 17
      src/Magnum/PixelFormat.h

8
doc/changelog.dox

@ -307,6 +307,12 @@ See also:
@subsection changelog-latest-deprecated Deprecated APIs @subsection changelog-latest-deprecated Deprecated APIs
- @cpp GL::Attribute::DataType::HalfFloat @ce,
@cpp GL::DynamicAttribute::DataType::HalfFloat @ce and
@cpp GL::PixelType::HalfFloat @ce is deprecated in favor of
@ref GL::Attribute::DataType::Half,
@ref GL::DynamicAttribute::DataType::Half and @ref GL::PixelType::Half that
are consistent with the @ref Half type used elsewhere.
- @cpp Platform::GlfwApplication::Configuration::setCursorMode() @ce and - @cpp Platform::GlfwApplication::Configuration::setCursorMode() @ce and
related enum & getter are deprecated in favor of the new extended and more related enum & getter are deprecated in favor of the new extended and more
flexible @ref Platform::GlfwApplication::setCursor(). The setting didn't flexible @ref Platform::GlfwApplication::setCursor(). The setting didn't
@ -2166,7 +2172,7 @@ Released 2018-05-01, tagged as
strings. See the @cpp "emscripten-pthreads-broken-unicode-shader-sources" @ce strings. See the @cpp "emscripten-pthreads-broken-unicode-shader-sources" @ce
workaround description and [mosra/magnum#239](https://github.com/mosra/magnum/issues/239) workaround description and [mosra/magnum#239](https://github.com/mosra/magnum/issues/239)
for details. for details.
- @ref GL::Attribute::DataType::HalfFloat was not available on WebGL 2 by - @cpp GL::Attribute::DataType::HalfFloat @ce was not available on WebGL 2 by
mistake mistake
- A wrong code path for @ref GL::Framebuffer::checkStatus() was selected on - A wrong code path for @ref GL::Framebuffer::checkStatus() was selected on
WebGL 1 by mistake WebGL 1 by mistake

2
src/Magnum/GL/AbstractTexture.cpp

@ -1075,7 +1075,7 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
case TextureFormat::RG16F: case TextureFormat::RG16F:
case TextureFormat::RGB16F: case TextureFormat::RGB16F:
case TextureFormat::RGBA16F: case TextureFormat::RGBA16F:
return PixelType::HalfFloat; return PixelType::Half;
case TextureFormat::R32UI: case TextureFormat::R32UI:
case TextureFormat::RG32UI: case TextureFormat::RG32UI:

14
src/Magnum/GL/Attribute.cpp

@ -84,7 +84,7 @@ Debug& operator<<(Debug& debug, const DynamicAttribute::DataType value) {
_c(UnsignedInt) _c(UnsignedInt)
_c(Int) _c(Int)
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
_c(HalfFloat) _c(Half)
#endif #endif
_c(Float) _c(Float)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -112,7 +112,7 @@ UnsignedInt FloatAttribute::size(GLint components, DataType dataType) {
case DataType::UnsignedShort: case DataType::UnsignedShort:
case DataType::Short: case DataType::Short:
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
case DataType::HalfFloat: case DataType::Half:
#endif #endif
return 2*components; return 2*components;
case DataType::UnsignedInt: case DataType::UnsignedInt:
@ -165,7 +165,7 @@ UnsignedInt Attribute<Math::Vector<3, Float>>::size(GLint components, DataType d
case DataType::UnsignedShort: case DataType::UnsignedShort:
case DataType::Short: case DataType::Short:
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
case DataType::HalfFloat: case DataType::Half:
#endif #endif
return 2*components; return 2*components;
case DataType::UnsignedInt: case DataType::UnsignedInt:
@ -196,7 +196,7 @@ UnsignedInt Attribute<Math::Vector<4, Float>>::size(GLint components, DataType d
case DataType::UnsignedShort: case DataType::UnsignedShort:
case DataType::Short: case DataType::Short:
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
case DataType::HalfFloat: case DataType::Half:
#endif #endif
return 2*components; return 2*components;
case DataType::UnsignedInt: case DataType::UnsignedInt:
@ -358,7 +358,7 @@ Debug& operator<<(Debug& debug, const FloatAttribute::DataType value) {
_c(UnsignedInt) _c(UnsignedInt)
_c(Int) _c(Int)
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
_c(HalfFloat) _c(Half)
#endif #endif
_c(Float) _c(Float)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -421,7 +421,7 @@ Debug& operator<<(Debug& debug, const Attribute<Math::Vector<3, Float>>::DataTyp
_c(UnsignedInt) _c(UnsignedInt)
_c(Int) _c(Int)
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
_c(HalfFloat) _c(Half)
#endif #endif
_c(Float) _c(Float)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -448,7 +448,7 @@ Debug& operator<<(Debug& debug, const Attribute<Math::Vector<4, Float>>::DataTyp
_c(UnsignedInt) _c(UnsignedInt)
_c(Int) _c(Int)
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
_c(HalfFloat) _c(Half)
#endif #endif
_c(Float) _c(Float)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

51
src/Magnum/GL/Attribute.h

@ -36,6 +36,10 @@
#include "Magnum/GL/visibility.h" #include "Magnum/GL/visibility.h"
#include "Magnum/Math/TypeTraits.h" #include "Magnum/Math/TypeTraits.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace GL { namespace Magnum { namespace GL {
namespace Implementation { template<class> struct Attribute; } namespace Implementation { template<class> struct Attribute; }
@ -181,6 +185,7 @@ template<UnsignedInt location, class T> class Attribute {
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* Half float. Only for float attribute types. * Half float. Only for float attribute types.
* @m_since_latest
* @requires_gl30 Extension @gl_extension{ARB,half_float_vertex} * @requires_gl30 Extension @gl_extension{ARB,half_float_vertex}
* @requires_gles30 Extension @gl_extension{OES,vertex_half_float} * @requires_gles30 Extension @gl_extension{OES,vertex_half_float}
* in OpenGL ES 2.0 * in OpenGL ES 2.0
@ -188,9 +193,17 @@ template<UnsignedInt location, class T> class Attribute {
* in WebGL 1.0. * in WebGL 1.0.
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* Half float.
* @m_deprecated_since_latest Use @ref DataType::Half instead.
*/
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
#endif #endif
@ -445,6 +458,7 @@ class DynamicAttribute {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
/** /**
* Half float. Only for float attribute types. * Half float. Only for float attribute types.
* @m_since_latest
* @requires_gl30 Extension @gl_extension{ARB,half_float_vertex} * @requires_gl30 Extension @gl_extension{ARB,half_float_vertex}
* @requires_gles30 Extension @gl_extension{OES,vertex_half_float} * @requires_gles30 Extension @gl_extension{OES,vertex_half_float}
* in OpenGL ES 2.0 * in OpenGL ES 2.0
@ -452,9 +466,17 @@ class DynamicAttribute {
* in WebGL 1.0. * in WebGL 1.0.
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* Half float.
* @m_deprecated_since_latest Use @ref Half instead.
*/
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
#endif #endif
@ -641,9 +663,12 @@ struct FloatAttribute {
Int = GL_INT, Int = GL_INT,
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
#endif #endif
Float = GL_FLOAT Float = GL_FLOAT
@ -741,9 +766,12 @@ template<> struct Attribute<Math::Vector<3, Float>>: SizedAttribute<1, 3> {
Int = GL_INT, Int = GL_INT,
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
#endif #endif
Float = GL_FLOAT Float = GL_FLOAT
@ -789,9 +817,12 @@ template<> struct Attribute<Math::Vector<4, Float>> {
Int = GL_INT, Int = GL_INT,
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
#endif #endif
Float = GL_FLOAT Float = GL_FLOAT

16
src/Magnum/GL/Implementation/pixelFormatMapping.hpp

@ -162,15 +162,15 @@ _s(RGB32I)
_s(RGBA32I) _s(RGBA32I)
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_c(R16F, Red, HalfFloat, R16F) _c(R16F, Red, Half, R16F)
_c(RG16F, RG, HalfFloat, RG16F) _c(RG16F, RG, Half, RG16F)
_c(RGB16F, RGB, HalfFloat, RGB16F) _c(RGB16F, RGB, Half, RGB16F)
_c(RGBA16F, RGBA, HalfFloat, RGBA16F) _c(RGBA16F, RGBA, Half, RGBA16F)
#else #else
_n(R16F, Luminance, HalfFloat) _n(R16F, Luminance, Half)
_n(RG16F, LuminanceAlpha, HalfFloat) _n(RG16F, LuminanceAlpha, Half)
_n(RGB16F, RGB, HalfFloat) _n(RGB16F, RGB, Half)
_n(RGBA16F, RGBA, HalfFloat) _n(RGBA16F, RGBA, Half)
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_c(R32F, Red, Float, R32F) _c(R32F, Red, Float, R32F)

4
src/Magnum/GL/PixelFormat.cpp

@ -138,7 +138,7 @@ UnsignedInt pixelSize(const PixelFormat format, const PixelType type) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case PixelType::Short: case PixelType::Short:
#endif #endif
case PixelType::HalfFloat: case PixelType::Half:
size = 2; break; size = 2; break;
case PixelType::UnsignedInt: case PixelType::UnsignedInt:
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -351,7 +351,7 @@ Debug& operator<<(Debug& debug, const PixelType value) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_c(Int) _c(Int)
#endif #endif
_c(HalfFloat) _c(Half)
_c(Float) _c(Float)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_c(UnsignedByte332) _c(UnsignedByte332)

13
src/Magnum/GL/PixelFormat.h

@ -410,6 +410,7 @@ enum class PixelType: GLenum {
/** /**
* Each component half float. * Each component half float.
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
* @m_since_latest
* @requires_gl30 Extension @gl_extension{ARB,half_float_pixel} * @requires_gl30 Extension @gl_extension{ARB,half_float_pixel}
* @requires_gles30 Extension @gl_extension2{OES,texture_half_float,OES_texture_float} * @requires_gles30 Extension @gl_extension2{OES,texture_half_float,OES_texture_float}
* to use for texture reading in OpenGL ES 2.0. * to use for texture reading in OpenGL ES 2.0.
@ -425,9 +426,17 @@ enum class PixelType: GLenum {
* to use the texture as a render target. * to use the texture as a render target.
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
HalfFloat = GL_HALF_FLOAT, Half = GL_HALF_FLOAT,
#else #else
HalfFloat = GL_HALF_FLOAT_OES, Half = GL_HALF_FLOAT_OES,
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* Half float.
* @m_deprecated_since_latest Use @ref PixelFormat::Half instead.
*/
HalfFloat CORRADE_DEPRECATED_ENUM("use Half instead") = Half,
#endif #endif
/** /**

6
src/Magnum/GL/Test/AttributeTest.cpp

@ -381,7 +381,7 @@ void AttributeTest::attributeVector4() {
CORRADE_COMPARE(da.components(), DynamicAttribute::Components::Four); CORRADE_COMPARE(da.components(), DynamicAttribute::Components::Four);
CORRADE_COMPARE(da.dataType(), DynamicAttribute::DataType::UnsignedInt2101010Rev); CORRADE_COMPARE(da.dataType(), DynamicAttribute::DataType::UnsignedInt2101010Rev);
#elif !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #elif !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
Attribute a(Attribute::DataType::HalfFloat); Attribute a(Attribute::DataType::Half);
CORRADE_COMPARE(a.vectorSize(), 8); CORRADE_COMPARE(a.vectorSize(), 8);
#else #else
Attribute a(Attribute::DataType::Float); Attribute a(Attribute::DataType::Float);
@ -562,8 +562,8 @@ void AttributeTest::debugDataTypeFloat() {
std::ostringstream out; std::ostringstream out;
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
Debug{&out} << Attribute::DataType::HalfFloat << Attribute::DataType(0xdead); Debug{&out} << Attribute::DataType::Half << Attribute::DataType(0xdead);
CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::HalfFloat GL::Attribute::DataType(0xdead)\n"); CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::Half GL::Attribute::DataType(0xdead)\n");
#else #else
Debug{&out} << Attribute::DataType::Float << Attribute::DataType(0xdead); Debug{&out} << Attribute::DataType::Float << Attribute::DataType(0xdead);
CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::Float GL::Attribute::DataType(0xdead)\n"); CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::Float GL::Attribute::DataType(0xdead)\n");

2
src/Magnum/GL/Test/FramebufferGLTest.cpp

@ -195,7 +195,7 @@ constexpr struct {
}, },
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
{"integer", RenderbufferFormat::RG32UI, PixelFormat::RGInteger, PixelType::UnsignedInt}, {"integer", RenderbufferFormat::RG32UI, PixelFormat::RGInteger, PixelType::UnsignedInt},
{"float", RenderbufferFormat::RGBA16F, PixelFormat::RGBA, PixelType::HalfFloat} {"float", RenderbufferFormat::RGBA16F, PixelFormat::RGBA, PixelType::Half}
#endif #endif
}; };

10
src/Magnum/GL/Test/MeshGLTest.cpp

@ -97,7 +97,7 @@ struct MeshGLTest: OpenGLTester {
#endif #endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
/* Other Float types omitted (covered by addVertexBufferNormalized()) */ /* Other Float types omitted (covered by addVertexBufferNormalized()) */
void addVertexBufferFloatWithHalfFloat(); void addVertexBufferFloatWithHalf();
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
void addVertexBufferFloatWithDouble(); void addVertexBufferFloatWithDouble();
@ -214,7 +214,7 @@ MeshGLTest::MeshGLTest() {
&MeshGLTest::addVertexBufferIntWithShort, &MeshGLTest::addVertexBufferIntWithShort,
#endif #endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
&MeshGLTest::addVertexBufferFloatWithHalfFloat, &MeshGLTest::addVertexBufferFloatWithHalf,
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
&MeshGLTest::addVertexBufferFloatWithDouble, &MeshGLTest::addVertexBufferFloatWithDouble,
@ -1339,7 +1339,7 @@ void MeshGLTest::addVertexBufferIntWithShort() {
#endif #endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void MeshGLTest::addVertexBufferFloatWithHalfFloat() { void MeshGLTest::addVertexBufferFloatWithHalf() {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::half_float_vertex>()) if(!Context::current().isExtensionSupported<Extensions::ARB::half_float_vertex>())
CORRADE_SKIP(Extensions::ARB::half_float_vertex::string() + std::string(" is not supported.")); CORRADE_SKIP(Extensions::ARB::half_float_vertex::string() + std::string(" is not supported."));
@ -1357,13 +1357,13 @@ void MeshGLTest::addVertexBufferFloatWithHalfFloat() {
if(testCaseInstanceId() == 0) { if(testCaseInstanceId() == 0) {
setTestCaseDescription("Attribute"); setTestCaseDescription("Attribute");
mesh.addVertexBuffer(buffer, 2, Attribute<0, Float>{Attribute<0, Float>::DataType::HalfFloat}); mesh.addVertexBuffer(buffer, 2, Attribute<0, Float>{Attribute<0, Float>::DataType::Half});
} else if(testCaseInstanceId() == 1) { } else if(testCaseInstanceId() == 1) {
setTestCaseDescription("DynamicAttribute"); setTestCaseDescription("DynamicAttribute");
mesh.addVertexBuffer(buffer, 2, 2, DynamicAttribute{ mesh.addVertexBuffer(buffer, 2, 2, DynamicAttribute{
DynamicAttribute::Kind::Generic, 0, DynamicAttribute::Kind::Generic, 0,
DynamicAttribute::Components::One, DynamicAttribute::Components::One,
DynamicAttribute::DataType::HalfFloat}); DynamicAttribute::DataType::Half});
} else CORRADE_ASSERT_UNREACHABLE(); } else CORRADE_ASSERT_UNREACHABLE();
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

28
src/Magnum/GL/TextureFormat.h

@ -137,7 +137,7 @@ enum class TextureFormat: GLenum {
* @deprecated_gl Prefer to use the exactly specified version of this * @deprecated_gl Prefer to use the exactly specified version of this
* format, e.g. @ref TextureFormat::RGB8. * format, e.g. @ref TextureFormat::RGB8.
* @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear}
* for filtering @ref PixelType::HalfFloat textures using * for filtering @ref PixelType::Half textures using
* @ref SamplerFilter::Linear in WebGL 1.0. * @ref SamplerFilter::Linear in WebGL 1.0.
*/ */
RGB = GL_RGB, RGB = GL_RGB,
@ -170,7 +170,7 @@ enum class TextureFormat: GLenum {
* @deprecated_gl Prefer to use the exactly specified version of this * @deprecated_gl Prefer to use the exactly specified version of this
* format, e.g. @ref TextureFormat::RGBA8. * format, e.g. @ref TextureFormat::RGBA8.
* @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear}
* for filtering @ref PixelType::HalfFloat textures using * for filtering @ref PixelType::Half textures using
* @ref SamplerFilter::Linear in WebGL 1.0. * @ref SamplerFilter::Linear in WebGL 1.0.
*/ */
RGBA = GL_RGBA, RGBA = GL_RGBA,
@ -665,7 +665,7 @@ enum class TextureFormat: GLenum {
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
* @requires_gl30 Extension @gl_extension{ARB,texture_rg} and @gl_extension{ARB,texture_float} * @requires_gl30 Extension @gl_extension{ARB,texture_rg} and @gl_extension{ARB,texture_float}
* @requires_gles30 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance * @requires_gles30 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance
* in combination with @ref PixelType::HalfFloat * in combination with @ref PixelType::Half
* (@gl_extension2{OES,texture_half_float,OES_texture_float}) in OpenGL * (@gl_extension2{OES,texture_half_float,OES_texture_float}) in OpenGL
* ES 2.0 instead. * ES 2.0 instead.
* @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear} * @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear}
@ -674,7 +674,7 @@ enum class TextureFormat: GLenum {
* use as a render target. Use @ref TextureFormat::R16UI or * use as a render target. Use @ref TextureFormat::R16UI or
* @ref TextureFormat::R16I instead if not available. * @ref TextureFormat::R16I instead if not available.
* @requires_webgl20 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance * @requires_webgl20 Use @ref TextureFormat::Red / @ref TextureFormat::Luminance
* in combination with @ref PixelType::HalfFloat (@webgl_extension{OES,texture_half_float}) * in combination with @ref PixelType::Half (@webgl_extension{OES,texture_half_float})
* in WebGL 1.0. * in WebGL 1.0.
* @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear}
* for filtering using @ref SamplerFilter::Linear in WebGL 1.0. * for filtering using @ref SamplerFilter::Linear in WebGL 1.0.
@ -692,7 +692,7 @@ enum class TextureFormat: GLenum {
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
* @requires_gl30 Extension @gl_extension{ARB,texture_rg} and @gl_extension{ARB,texture_float} * @requires_gl30 Extension @gl_extension{ARB,texture_rg} and @gl_extension{ARB,texture_float}
* @requires_gles30 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha * @requires_gles30 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha
* in combination with @ref PixelType::HalfFloat * in combination with @ref PixelType::Half
* (@gl_extension2{OES,texture_half_float,OES_texture_float}) in OpenGL * (@gl_extension2{OES,texture_half_float,OES_texture_float}) in OpenGL
* ES 2.0 instead. * ES 2.0 instead.
* @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear} * @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear}
@ -701,7 +701,7 @@ enum class TextureFormat: GLenum {
* use as a render target in OpenGL ES. Use @ref TextureFormat::RG16UI * use as a render target in OpenGL ES. Use @ref TextureFormat::RG16UI
* or @ref TextureFormat::RG16I instead if not available. * or @ref TextureFormat::RG16I instead if not available.
* @requires_webgl20 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha * @requires_webgl20 Use @ref TextureFormat::RG / @ref TextureFormat::LuminanceAlpha
* in combination with @ref PixelType::HalfFloat (@webgl_extension{OES,texture_half_float}) * in combination with @ref PixelType::Half (@webgl_extension{OES,texture_half_float})
* in WebGL 1.0 instead. * in WebGL 1.0 instead.
* @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear}
* for filtering using @ref SamplerFilter::Linear in WebGL 1.0. * for filtering using @ref SamplerFilter::Linear in WebGL 1.0.
@ -719,16 +719,16 @@ enum class TextureFormat: GLenum {
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
* @requires_gl30 Extension @gl_extension{ARB,texture_float} * @requires_gl30 Extension @gl_extension{ARB,texture_float}
* @requires_gles30 Use @ref TextureFormat::RGB in combination with * @requires_gles30 Use @ref TextureFormat::RGB in combination with
* @ref PixelType::HalfFloat (@gl_extension2{OES,texture_half_float,OES_texture_float}) * @ref PixelType::Half (@gl_extension2{OES,texture_half_float,OES_texture_float})
* in OpenGL ES 2.0 instead. * in OpenGL ES 2.0 instead.
* @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear} * @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear}
* for filtering using @ref SamplerFilter::Linear in OpenGL ES 2.0. * for filtering using @ref SamplerFilter::Linear in OpenGL ES 2.0.
* @requires_webgl20 Use @ref TextureFormat::RGB in combination with * @requires_webgl20 Use @ref TextureFormat::RGB in combination with
* @ref PixelType::HalfFloat (@webgl_extension{OES,texture_half_float}) * @ref PixelType::Half (@webgl_extension{OES,texture_half_float}) in
* in WebGL 1.0 instead. * WebGL 1.0 instead.
* @requires_gl Can't be used as a render target in OpenGL ES or WebGL 2.0. * @requires_gl Can't be used as a render target in OpenGL ES or WebGL 2.0.
* Use @ref TextureFormat::RGBA16F instead. Use @ref TextureFormat::RGB * Use @ref TextureFormat::RGBA16F instead. Use @ref TextureFormat::RGB
* in combination with @ref PixelType::HalfFloat * in combination with @ref PixelType::Half
* (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0
* instead. * instead.
*/ */
@ -739,7 +739,7 @@ enum class TextureFormat: GLenum {
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
* @requires_gl30 Extension @gl_extension{ARB,texture_float} * @requires_gl30 Extension @gl_extension{ARB,texture_float}
* @requires_gles30 Use @ref TextureFormat::RGBA in combination with * @requires_gles30 Use @ref TextureFormat::RGBA in combination with
* @ref PixelType::HalfFloat (@gl_extension2{OES,texture_half_float,OES_texture_float}) * @ref PixelType::Half (@gl_extension2{OES,texture_half_float,OES_texture_float})
* in OpenGL ES 2.0 instead. * in OpenGL ES 2.0 instead.
* @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear} * @requires_gles30 Extension @gl_extension2{OES,texture_half_float_linear,OES_texture_float_linear}
* for filtering using @ref SamplerFilter::Linear. * for filtering using @ref SamplerFilter::Linear.
@ -747,12 +747,12 @@ enum class TextureFormat: GLenum {
* use as a render target in OpenGL ES. Use @ref TextureFormat::RGBA16UI * use as a render target in OpenGL ES. Use @ref TextureFormat::RGBA16UI
* or @ref TextureFormat::RGBA16I instead if not available. * or @ref TextureFormat::RGBA16I instead if not available.
* @requires_webgl20 Use @ref TextureFormat::RGBA in combination with * @requires_webgl20 Use @ref TextureFormat::RGBA in combination with
* @ref PixelType::HalfFloat (@webgl_extension{OES,texture_half_float}) * @ref PixelType::Half (@webgl_extension{OES,texture_half_float}) in
* in WebGL 1.0 instead. * WebGL 1.0 instead.
* @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float}
* to use as a render target in WebGL 2.0. Use @ref TextureFormat::RGBA16UI * to use as a render target in WebGL 2.0. Use @ref TextureFormat::RGBA16UI
* or @ref TextureFormat::RGBA16I instead if not available. Use * or @ref TextureFormat::RGBA16I instead if not available. Use
* @ref TextureFormat::RGBA in combination with @ref PixelType::HalfFloat * @ref TextureFormat::RGBA in combination with @ref PixelType::Half
* (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 instead. * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 instead.
*/ */
RGBA16F = GL_RGBA16F, RGBA16F = GL_RGBA16F,

17
src/Magnum/PixelFormat.h

@ -581,9 +581,8 @@ enum class PixelFormat: UnsignedInt {
/** /**
* Red component, half float. * Red component, half float.
* *
* Corresponds to @ref GL::PixelFormat::Red and * Corresponds to @ref GL::PixelFormat::Red and @ref GL::PixelType::Half,
* @ref GL::PixelType::HalfFloat, @ref GL::TextureFormat::R16F; * @ref GL::TextureFormat::R16F; @def_vk_keyword{FORMAT_R16_SFLOAT,Format};
* @def_vk_keyword{FORMAT_R16_SFLOAT,Format};
* @m_class{m-doc-external} [DXGI_FORMAT_R16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) * @m_class{m-doc-external} [DXGI_FORMAT_R16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format)
* or @m_class{m-doc-external} [MTLPixelFormatR16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatr16float?language=objc). * or @m_class{m-doc-external} [MTLPixelFormatR16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatr16float?language=objc).
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
@ -594,8 +593,8 @@ enum class PixelFormat: UnsignedInt {
/** /**
* Red and green component, half float. * Red and green component, half float.
* *
* Corresponds to @ref GL::PixelFormat::RG and * Corresponds to @ref GL::PixelFormat::RG and @ref GL::PixelType::Half,
* @ref GL::PixelType::HalfFloat, @ref GL::TextureFormat::RG16F; * @ref GL::TextureFormat::RG16F;
* @def_vk_keyword{FORMAT_R16G16_SFLOAT,Format}; * @def_vk_keyword{FORMAT_R16G16_SFLOAT,Format};
* @m_class{m-doc-external} [DXGI_FORMAT_R16G16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) * @m_class{m-doc-external} [DXGI_FORMAT_R16G16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format)
* or @m_class{m-doc-external} [MTLPixelFormatRG16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatrg16float?language=objc). * or @m_class{m-doc-external} [MTLPixelFormatRG16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatrg16float?language=objc).
@ -607,8 +606,8 @@ enum class PixelFormat: UnsignedInt {
/** /**
* RGB, half float. * RGB, half float.
* *
* Corresponds to @ref GL::PixelFormat::RGB and * Corresponds to @ref GL::PixelFormat::RGB and @ref GL::PixelType::Half,
* @ref GL::PixelType::HalfFloat, @ref GL::TextureFormat::RGB16F; * @ref GL::TextureFormat::RGB16F;
* @def_vk_keyword{FORMAT_R16G16B16_SFLOAT,Format}. No 48-bit D3D or Metal * @def_vk_keyword{FORMAT_R16G16B16_SFLOAT,Format}. No 48-bit D3D or Metal
* equivalent. * equivalent.
* @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf() * @see @ref Half, @ref Math::packHalf(), @ref Math::unpackHalf()
@ -618,8 +617,8 @@ enum class PixelFormat: UnsignedInt {
/** /**
* RGBA, half float. * RGBA, half float.
* *
* Corresponds to @ref GL::PixelFormat::RGBA and * Corresponds to @ref GL::PixelFormat::RGBA and @ref GL::PixelType::Half,
* @ref GL::PixelType::HalfFloat, @ref GL::TextureFormat::RGBA16F; * @ref GL::TextureFormat::RGBA16F;
* @def_vk_keyword{FORMAT_R16G16B16A16_SFLOAT,Format}; * @def_vk_keyword{FORMAT_R16G16B16A16_SFLOAT,Format};
* @m_class{m-doc-external} [DXGI_FORMAT_R16G16B16A16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) * @m_class{m-doc-external} [DXGI_FORMAT_R16G16B16A16_FLOAT](https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format)
* or @m_class{m-doc-external} [MTLPixelFormatRGBA16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatrgba16float?language=objc). * or @m_class{m-doc-external} [MTLPixelFormatRGBA16Float](https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatrgba16float?language=objc).

Loading…
Cancel
Save