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

[linux] Overdraw mode crashes with GL_INVALID_OPERATION #5435

Closed
brunoabinader opened this issue Jun 22, 2016 · 2 comments
Closed

[linux] Overdraw mode crashes with GL_INVALID_OPERATION #5435

brunoabinader opened this issue Jun 22, 2016 · 2 comments
Labels
bug Core The cross-platform C++ core, aka mbgl Linux

Comments

@brunoabinader
Copy link
Member

brunoabinader commented Jun 22, 2016

Console output:

[ERROR] {mapbox-glfw}[OpenGL]: GL_DEBUG_SOURCE_API GL_DEBUG_TYPE_ERROR 1282 GL_DEBUG_SEVERITY_HIGH - GL_INVALID_OPERATION error generated. <location> is invalid.
terminate called after throwing an instance of 'mbgl::gl::Error'
  what():  glUniformMatrix4fv(location, 1, GL_FALSE, t.data()): Error GL_INVALID_OPERATION - ../../src/mbgl/shader/uniform.cpp:49
Aborted (core dumped)

Problem seems related to the location of uniforms from a shader using two quasi-identical programs. In macOS, it looks like those uniforms locations are the same, but it doesn't seem to be the case on Linux.

@brunoabinader brunoabinader added bug Core The cross-platform C++ core, aka mbgl Linux labels Jun 22, 2016
@brunoabinader brunoabinader changed the title Overdraw is crashing on Linux [linux] Overdraw mode crashes with GL_INVALID_OPERATION Jun 22, 2016
brunoabinader added a commit that referenced this issue Jun 22, 2016
@mikemorris
Copy link
Contributor

FWIW I was only seeing this error on BUILDTYPE=Debug Linux builds, and not on OS X at all.

@brunoabinader
Copy link
Member Author

@mikemorris yep - macOS GL drivers appears to behave differently from others in that sense.

brunoabinader added a commit that referenced this issue Jul 1, 2016
- Use glBindAttribLocation for GLSL attributes.
- Create a separate shader for each shader that supports overdraw.
  Needed because each uniform location must be known for every program.
- Create a separate VAO for each shader inside buckets.
  Needed because we can only bind a VAO to a specific shader.

Fixes #5435.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl Linux
Projects
None yet
Development

No branches or pull requests

2 participants