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

[linux] Overdraw debug is broken #6799

Closed
brunoabinader opened this issue Oct 23, 2016 · 7 comments
Closed

[linux] Overdraw debug is broken #6799

brunoabinader opened this issue Oct 23, 2016 · 7 comments
Labels
bug Core The cross-platform C++ core, aka mbgl Linux tests

Comments

@brunoabinader
Copy link
Member

brunoabinader commented Oct 23, 2016

Overdraw debug mode no longer works on Linux;

terminate called after throwing an instance of 'mbgl::gl::Error'
  what():  glEnableVertexAttribArray(binding.location): Error GL_INVALID_VALUE at ../../../src/mbgl/gl/context.cpp:113

Bisection points out this issue started @ e4310aa.

From my comments on the patch that initially fixed overdraw on Linux:

- 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.

Unlike macOS, it seems that Linux mesa GL drivers are more strict into their usage policies. We should probably add an overdraw unit test to make sure both macOS and Linux supports these.

/cc @jfirebaugh

@brunoabinader brunoabinader added bug tests Core The cross-platform C++ core, aka mbgl Linux labels Oct 23, 2016
@brunoabinader brunoabinader mentioned this issue Oct 30, 2016
1 task
@jfirebaugh
Copy link
Contributor

This is what I'm seeing on macOS at a4c82b8 and 39d5cb3 (both pre- and post-#6468). It looks like a bug in #6674 or #6596. cc @kkaefer

image

@kkaefer
Copy link
Contributor

kkaefer commented Oct 31, 2016

@jfirebaugh I cannot reproduce the issue you're seeing on macOS with most recent master (or any of the previous commits)

@jfirebaugh
Copy link
Contributor

@kkaefer I can reproduce it on a retina screen, but not an external 1x monitor.

@kkaefer
Copy link
Contributor

kkaefer commented Oct 31, 2016

Thanks for the hint; I can reproduce with a 2x screen. @jfirebaugh the screenshot you posted displays the depth buffer; were you also able to reproduce the overdraw bug described by @brunoabinader in the initial comment?

@jfirebaugh
Copy link
Contributor

Ah, no, I was mistakenly conflating the overdraw view and the depth buffer view. I'm not able to reproduce the overdraw issue -- but I'm not sure it was ever reproducible on macOS. @brunoabinader can you check if #6468 fixed the issue on Linux?

@brunoabinader
Copy link
Member Author

@jfirebaugh just tested this after #6468 - same crash:

[INFO] {mbgl-glfw}[OpenGL]: Frame time:   3.59ms (278.89 fps)
terminate called after throwing an instance of 'mbgl::gl::Error'
  what():  glEnableVertexAttribArray(binding.location): Error GL_INVALID_VALUE at ../../../src/mbgl/gl/context.cpp:419

Thread 1 "mbgl-glfw" received signal SIGABRT, Aborted.
0x00007ffff5925428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5925428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff592702a in __GI_abort () at abort.c:89
#2  0x00007ffff5f5e84d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff5f5c6b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff5f5b6a9 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff5f5c005 in __gxx_personality_v0 () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff5cc8f83 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7  0x00007ffff5cc9487 in _Unwind_Resume () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#8  0x0000000000cb57ff in mbgl::gl::checkError (cmd=0x12562a8 "glEnableVertexAttribArray(binding.location)", file=0x1255ac0 "../../../src/mbgl/gl/context.cpp", line=419) at ../../../src/mbgl/gl/gl.cpp:57
#9  0x0000000000eb1bdc in mbgl::gl::Context::draw(mbgl::gl::Drawable const&)::{lambda()#3}::operator()() const::__MBGL_C_E::~__MBGL_C_E() (this=0x7fffffffc5b7, __in_chrg=<optimized out>) at ../../../src/mbgl/gl/context.cpp:419
#10 0x0000000000eaf4f1 in mbgl::gl::Context::<lambda()>::operator()(void) const (__closure=0x7fffffffc640) at ../../../src/mbgl/gl/context.cpp:419
#11 0x0000000000eaf9b9 in mbgl::gl::Context::draw (this=0x1722010, drawable=...) at ../../../src/mbgl/gl/context.cpp:419
#12 0x00000000010259c7 in mbgl::Painter::<lambda(auto:3&, auto:4&&, const auto:5&, const mbgl::style::SymbolPropertyValues&)>::operator()<mbgl::SymbolIconShader, std::tuple<mbgl::gl::Uniform<mbgl::uniforms::u_matrix, std::array<double, 16ul> >::Value, mbgl::gl::Uniform<mbgl::uniforms::u_opacity, float>::Value, mbgl::gl::Uniform<mbgl::uniforms::u_extrude_scale, std::array<float, 2ul> >::Value, mbgl::gl::Uniform<mbgl::uniforms::u_texsize, std::array<float, 2ul> >::Value, mbgl::gl::Uniform<mbgl::uniforms::u_zoom, float>::Value, mbgl::gl::Uniform<mbgl::uniforms::u_rotate_with_map, bool>::Value, mbgl::gl::Uniform<mbgl::uniforms::u_texture, unsigned char>::Value, mbgl::gl::Uniform<mbgl::uniforms::u_fadetexture, unsigned char>::Value>, mbgl::SymbolBucket::IconBuffer>(mbgl::SymbolIconShader &, <unknown type in /home/bruno/work/mapbox-gl-native/build/linux-x86_64/Debug/mbgl-glfw, CU 0x1bfbfd8, DIE 0x1c7d692>, const mbgl::SymbolBucket::IconBuffer &, const mbgl::style::SymbolPropertyValues &) const (__closure=0x7fffffffc930, shader=..., uniformValues=<unknown type in /home/bruno/work/mapbox-gl-native/build/linux-x86_64/Debug/mbgl-glfw, CU 0x1bfbfd8, DIE 0x1c7d692>, buffers=..., 
    values_=...) at ../../../src/mbgl/renderer/painter_symbol.cpp:49
#13 0x00000000010261bc in mbgl::Painter::renderSymbol (this=0x183ca40, parameters=..., bucket=..., layer=..., tile=...) at ../../../src/mbgl/renderer/painter_symbol.cpp:95
#14 0x0000000000f030fb in mbgl::SymbolBucket::render (this=0x7fffd400fe40, painter=..., parameters=..., layer=..., tile=...) at ../../../src/mbgl/renderer/symbol_bucket.cpp:41
#15 0x0000000000cd9d04 in mbgl::Painter::renderPass<__gnu_cxx::__normal_iterator<mbgl::RenderItem const*, std::vector<mbgl::RenderItem, std::allocator<mbgl::RenderItem> > > > (this=0x183ca40, parameters=..., 
    pass_=mbgl::RenderPass::Translucent, it=..., end=..., i=12, increment=-1 '\377') at ../../../src/mbgl/renderer/painter.cpp:281
#16 0x0000000000cd6b2b in mbgl::Painter::render (this=0x183ca40, style=..., frame_=..., view=..., annotationSpriteAtlas=...) at ../../../src/mbgl/renderer/painter.cpp:200
#17 0x0000000000cbb7c0 in mbgl::Map::Impl::render (this=0x183a220, view=...) at ../../../src/mbgl/map/map.cpp:301
#18 0x0000000000cbb0bb in mbgl::Map::render (this=0x7fffffffd2e0, view=...) at ../../../src/mbgl/map/map.cpp:201
#19 0x0000000000ca7aaf in GLFWView::<lambda()>::operator()(void) const (__closure=0x1721d78) at ../../../platform/default/glfw_view.cpp:455
#20 0x0000000000ca8c22 in std::_Function_handler<void(), GLFWView::run()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/5/functional:1871
#21 0x0000000000ca9fb8 in std::function<void ()>::operator()() const (this=0x1721d78) at /usr/include/c++/5/functional:2267
#22 0x000000000105c9cb in mbgl::util::Timer::Impl::timerCallback (handle=0x1722610) at ../../../platform/default/timer.cpp:50
#23 0x00000000011f02e8 in uv__run_timers (loop=0x16eef80 <default_loop_struct>) at src/unix/timer.c:165
#24 0x00000000011e8ac0 in uv_run (loop=0x16eef80 <default_loop_struct>, mode=UV_RUN_DEFAULT) at src/unix/core.c:345
#25 0x00000000010535cc in mbgl::util::RunLoop::run (this=0x7fffffffd838) at ../../../platform/default/run_loop.cpp:155
#26 0x0000000000ca7be1 in GLFWView::run (this=0x7fffffffd760) at ../../../platform/default/glfw_view.cpp:472
#27 0x0000000000ca3686 in main (argc=1, argv=0x7fffffffd9e8) at ../../../bin/glfw.cpp:171

@brunoabinader
Copy link
Member Author

Issue is no longer reproducible.

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 tests
Projects
None yet
Development

No branches or pull requests

3 participants