diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-04-04 18:10:41 -0700 |
---|---|---|
committer | Lauren Budorick <lauren@mapbox.com> | 2017-04-24 17:09:08 -0700 |
commit | fe75af550ae55d3a1f51331acbc84d876be1c73c (patch) | |
tree | 0f16d875843b45bef114502ca4fee1c63bd76dd5 | |
parent | 40ea524ba575779416980c003a62d3223f82aab6 (diff) | |
download | qtlocation-mapboxgl-fe75af550ae55d3a1f51331acbc84d876be1c73c.tar.gz |
Define DepthComponent as GL/GLES-dependent
* GLES ES2 supports only GL_DEPTH_COMPONENT16 as a valid RenderbufferStorage internalformat (though GLES ES3 will support 16, 24 and 32F)
* OpenGL supports GL_DEPTH_COMPONENT, which determines its own size as needed. This is necessary as 16 bits seems to not be high enough resolution for desktop implementations
-rw-r--r-- | src/mbgl/gl/types.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/gl/types.hpp b/src/mbgl/gl/types.hpp index acd0e016be..e3dc8589fc 100644 --- a/src/mbgl/gl/types.hpp +++ b/src/mbgl/gl/types.hpp @@ -35,12 +35,14 @@ enum class DataType : uint32_t { }; enum class RenderbufferType : uint32_t { - // TODO note: this is RGBA8 (can be found in gl.h: RGBA8 is 0x8058, RGBA4 is 0x8056); gl-js FillExtrusionTexture uses RGBA4 -- this likely doesn't matter, but confirm RGBA = 0x8058, RGBA4 = 0x8056, DepthStencil = 0x88F0, -// DepthComponent = 0x1902, // GL_DEPTH_COMPONENT - DepthComponent = 0x81A5, // GL_DEPTH_COMPONENT16 +#if not MBGL_USE_GLES2 + DepthComponent = 0x1902, // GL_DEPTH_COMPONENT +#else + DepthComponent = 0x81A5, //GL_DEPTH_COMPONENT16 +#endif // MBGL_USE_GLES2 }; enum class TextureMipMap : bool { No = false, Yes = true }; |