diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp index ba1ac9f00..cb0fb4892 100644 --- a/include/mbgl/platform/gl.hpp +++ b/include/mbgl/platform/gl.hpp @@ -130,9 +130,11 @@ extern PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; extern PFNGLGENVERTEXARRAYSPROC GenVertexArrays; extern PFNGLISVERTEXARRAYPROC IsVertexArray; +// GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil extern bool isPackedDepthStencilSupported; #define GL_DEPTH24_STENCIL8 0x88F0 +// GL_OES_depth24 extern bool isDepth24Supported; #define GL_DEPTH_COMPONENT24 0x81A6 diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 4d7e2c17c..2ac047b8a 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -152,6 +152,10 @@ void GLFWView::initialize(mbgl::Map *map_) { assert(gl::ProgramBinary != nullptr); assert(gl::ProgramParameteri != nullptr); } + + // Require packed depth stencil + gl::isPackedDepthStencilSupported = true; + gl::isDepth24Supported = true; } glfwMakeContextCurrent(nullptr); diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 264fe4da6..0041fb3bb 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -85,6 +85,11 @@ void HeadlessView::loadExtensions() { gl::IsVertexArray = (gl::PFNGLISVERTEXARRAYPROC)glXGetProcAddress((const GLubyte *)"glIsVertexArrayARB"); } #endif + + // HeadlessView requires packed depth stencil + gl::isPackedDepthStencilSupported = true; + gl::isDepth24Supported = true; + make_inactive(); }