summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp69
1 files changed, 0 insertions, 69 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index da72bad41d..436e1f6a61 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -9,7 +9,6 @@
#include <mbgl/gl/command_encoder.hpp>
#include <mbgl/gl/debugging_extension.hpp>
#include <mbgl/gl/vertex_array_extension.hpp>
-#include <mbgl/gl/program_binary_extension.hpp>
#include <mbgl/util/traits.hpp>
#include <mbgl/util/std.hpp>
#include <mbgl/util/logging.hpp>
@@ -50,8 +49,6 @@ static_assert(underlying_type(UniformDataType::FloatMat4) == GL_FLOAT_MAT4, "Ope
static_assert(underlying_type(UniformDataType::Sampler2D) == GL_SAMPLER_2D, "OpenGL type mismatch");
static_assert(underlying_type(UniformDataType::SamplerCube) == GL_SAMPLER_CUBE, "OpenGL type mismatch");
-static_assert(std::is_same<BinaryProgramFormat, GLenum>::value, "OpenGL type mismatch");
-
Context::Context(RendererBackend& backend_)
: gfx::Context(gfx::ContextType::OpenGL, [] {
GLint value;
@@ -107,10 +104,6 @@ void Context::initializeExtensions(const std::function<gl::ProcAddress(const cha
vertexArray = std::make_unique<extension::VertexArray>(fn);
}
-#if MBGL_HAS_BINARY_PROGRAMS
- programBinary = std::make_unique<extension::ProgramBinary>(fn);
-#endif
-
#if MBGL_USE_GLES2
constexpr const char* halfFloatExtensionName = "OES_texture_half_float";
constexpr const char* halfFloatColorBufferExtensionName = "EXT_color_buffer_half_float";
@@ -186,23 +179,6 @@ UniqueProgram Context::createProgram(ShaderID vertexShader, ShaderID fragmentSha
return result;
}
-#if MBGL_HAS_BINARY_PROGRAMS
-UniqueProgram Context::createProgram(BinaryProgramFormat binaryFormat,
- const std::string& binaryProgram) {
- assert(supportsProgramBinaries());
- UniqueProgram result{ MBGL_CHECK_ERROR(glCreateProgram()), { this } };
- MBGL_CHECK_ERROR(programBinary->programBinary(result, static_cast<GLenum>(binaryFormat),
- binaryProgram.data(),
- static_cast<GLint>(binaryProgram.size())));
- verifyProgramLinkage(result);
- return result;
-}
-#else
-UniqueProgram Context::createProgram(BinaryProgramFormat, const std::string&) {
- throw std::runtime_error("binary programs are not supported");
-}
-#endif
-
void Context::linkProgram(ProgramID program_) {
MBGL_CHECK_ERROR(glLinkProgram(program_));
verifyProgramLinkage(program_);
@@ -244,51 +220,6 @@ bool Context::supportsVertexArrays() const {
vertexArray->deleteVertexArrays;
}
-#if MBGL_HAS_BINARY_PROGRAMS
-bool Context::supportsProgramBinaries() const {
- if (!programBinary || !programBinary->programBinary || !programBinary->getProgramBinary) {
- return false;
- }
-
- // Blacklist Adreno 3xx, 4xx, and 5xx GPUs due to known bugs:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=510637
- // https://chromium.googlesource.com/chromium/src/gpu/+/master/config/gpu_driver_bug_list.json#2316
- // Blacklist Vivante GC4000 due to bugs when linking loaded programs:
- // https://github.com/mapbox/mapbox-gl-native/issues/10704
- const std::string renderer = reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(GL_RENDERER)));
- if (renderer.find("Adreno (TM) 3") != std::string::npos
- || renderer.find("Adreno (TM) 4") != std::string::npos
- || renderer.find("Adreno (TM) 5") != std::string::npos
- || renderer.find("Vivante GC4000") != std::string::npos) {
- return false;
- }
-
- return true;
-}
-
-optional<std::pair<BinaryProgramFormat, std::string>>
-Context::getBinaryProgram(ProgramID program_) const {
- if (!supportsProgramBinaries()) {
- return {};
- }
- GLint binaryLength;
- MBGL_CHECK_ERROR(glGetProgramiv(program_, GL_PROGRAM_BINARY_LENGTH, &binaryLength));
- std::string binary;
- binary.resize(binaryLength);
- GLenum binaryFormat;
- MBGL_CHECK_ERROR(programBinary->getProgramBinary(
- program_, binaryLength, &binaryLength, &binaryFormat, const_cast<char*>(binary.data())));
- if (size_t(binaryLength) != binary.size()) {
- return {};
- }
- return { { binaryFormat, std::move(binary) } };
-}
-#else
-optional<std::pair<BinaryProgramFormat, std::string>> Context::getBinaryProgram(ProgramID) const {
- return {};
-}
-#endif
-
VertexArray Context::createVertexArray() {
if (supportsVertexArrays()) {
VertexArrayID id = 0;