Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] wrap glGetString in MBGL_CHECK_ERROR too
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed May 24, 2018
1 parent 0212fd3 commit 7ff62fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mbgl/gl/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ UniqueTexture Context::createTexture() {

bool Context::supportsVertexArrays() const {
static bool blacklisted = []() {
const std::string renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
const std::string renderer = reinterpret_cast<const char*>(MBGL_CHECK_ERROR(glGetString(GL_RENDERER)));

Log::Info(Event::General, "GPU Identifier: %s", renderer.c_str());

Expand Down Expand Up @@ -318,7 +318,7 @@ bool Context::supportsProgramBinaries() const {
// 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*>(glGetString(GL_RENDERER));
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
Expand Down
2 changes: 1 addition & 1 deletion test/api/custom_layer.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TestLayer : public mbgl::style::CustomLayerHost {
MBGL_CHECK_ERROR(glCompileShader(fragmentShader));
MBGL_CHECK_ERROR(glAttachShader(program, fragmentShader));
MBGL_CHECK_ERROR(glLinkProgram(program));
a_pos = glGetAttribLocation(program, "a_pos");
a_pos = MBGL_CHECK_ERROR(glGetAttribLocation(program, "a_pos"));

GLfloat triangle[] = { 0, 0.5, 0.5, -0.5, -0.5, -0.5 };
MBGL_CHECK_ERROR(glGenBuffers(1, &buffer));
Expand Down

0 comments on commit 7ff62fa

Please sign in to comment.