You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
I believe I found a way to fix our anti-aliasing issues (#1555) by using OSMesa + post processing.
Replacing GLX with EGL
My efforts towards EGL usage (based on #5843) were unsuccessful - the EGL swrast driver works in non-VM environments, but not otherwise - it fails to find a suitable display, and EGL_DEFAULT_DISPLAY cannot be used in those cases.
Using mesa 12.0.3 or 13.0.0 with GLX (LLVMpipe) also produces the very same render test results as previous mesa versions, and I think I understood why: The software renderer must explicitly enable post-processing effects such as MLAA. However, post-processing is only available when using Gallium drivers. Gallium support for GLX library only comes with gallium-xlib, which involves using X and thus not desirable for headless support.
I took liberty of rebasing/updating @mikemorris PR in #4638. I've also re-arranged the mason scripts for mesa 13.0.0 to produce a minimal binary, enabling Gallium implementation of the OSMesa library. Being OSMesa a headless, simple layer on top of OpenGL and by using Gallium to provide post-processing effects such as MLAA, I was then able to obtain 42 passing render tests that are currently ignored (same number as in macOS).
Post-processing can be enabled by calling e.g. OSMesaPostprocess(glContext, "pp_jimenezmlaa", 8); right after creating the context - this enables Jimenez' MLAA filter to be applied.
In sum:
OSMesa is truly headless - no extra dependencies besides LLVM 3.8 (available via apt-get on Travis)
Enabling morphological anti-aliasing filter and floating point textures enables us to obtain the same results as in Bitrise macOS
However, there are still a few drawbacks I must deal with:
debug/overdraw is failing: that is either related to [linux] Overdraw debug is broken #6799 or a faulty implementation from OSMesa. In any case, I think it is forgivable to skip this test in favor of antialias support
OSMesa is very rudimentary - I'm obtaining a few runtime throws via MBGL_CHECK_ERROR when running the render tests. Though results are passing, we might need to skip running this in debug mode. I'm still investigating whether we have an actual issue or if it is just OSMesa being faulty.
Interesting that OSMesa+llvmpipe gives different (correct) results compared to GLX+llvmpipe. I would have expected the rendering issues we have been seeing in the test-suite to be entirely due to the software renderer, rather than the interface. Any theories as to why that's not the case?
Is there a performance delta between test-suite on GLX+llvmpipe and on OSMesa+llvmpipe?
Interesting that OSMesa+llvmpipe gives different (correct) results compared to GLX+llvmpipe. I would have expected the rendering issues we have been seeing in the test-suite to be entirely due to the software renderer, rather than the interface. Any theories as to why that's not the case?
I agree - though I couldn't properly find a reason why GLX produces rendering artifacts, besides the fact its rendering pipeline is more complex due to X indirections than OSMesa.
Is there a performance delta between test-suite on GLX+llvmpipe and on OSMesa+llvmpipe?
Both implementations eventually uses LLVMpipe, so it seems unlikely e.g. duration for node4-clang35-debug is ~8min for both.
Activity
[-]Add Linux Wayland/EGL support to HeadlessView[/-][+]Add Linux OSMesa support to HeadlessView[/+]mikemorris commentedon Mar 29, 2016
No, this was a red herring related to the
linuxappbuild.mikemorris commentedon Apr 7, 2016
OMG I think I'm hitting https://bugs.chromium.org/p/chromium/issues/detail?id=482787, I can't get
OSMesaMakeCurrentto release a context successfully...mikemorris commentedon Apr 7, 2016
This is fun.
brunoabinader commentedon Nov 3, 2016
I believe I found a way to fix our anti-aliasing issues (#1555) by using OSMesa + post processing.
Replacing GLX with EGL
My efforts towards EGL usage (based on #5843) were unsuccessful - the EGL swrast driver works in non-VM environments, but not otherwise - it fails to find a suitable display, and
EGL_DEFAULT_DISPLAYcannot be used in those cases.Using mesa 12.0.3 or 13.0.0 with GLX (LLVMpipe) also produces the very same render test results as previous mesa versions, and I think I understood why: The software renderer must explicitly enable post-processing effects such as MLAA. However, post-processing is only available when using Gallium drivers. Gallium support for GLX library only comes with
gallium-xlib, which involves using X and thus not desirable for headless support.Enter OSMesa
I took liberty of rebasing/updating @mikemorris PR in #4638. I've also re-arranged the mason scripts for mesa 13.0.0 to produce a minimal binary, enabling Gallium implementation of the OSMesa library. Being OSMesa a headless, simple layer on top of OpenGL and by using Gallium to provide post-processing effects such as MLAA, I was then able to obtain 42 passing render tests that are currently ignored (same number as in macOS).
Post-processing can be enabled by calling e.g.
OSMesaPostprocess(glContext, "pp_jimenezmlaa", 8);right after creating the context - this enables Jimenez' MLAA filter to be applied.In sum:
However, there are still a few drawbacks I must deal with:
debug/overdrawis failing: that is either related to [linux] Overdraw debug is broken #6799 or a faulty implementation from OSMesa. In any case, I think it is forgivable to skip this test in favor of antialias supportMBGL_CHECK_ERRORwhen running the render tests. Though results are passing, we might need to skip running this in debug mode. I'm still investigating whether we have an actual issue or if it is just OSMesa being faulty.Related branches:
/cc @mikemorris @kkaefer
brunoabinader commentedon Nov 3, 2016
Errata:
debug/overdrawjfirebaugh commentedon Nov 3, 2016
Great work, this seems really promising!
Interesting that OSMesa+llvmpipe gives different (correct) results compared to GLX+llvmpipe. I would have expected the rendering issues we have been seeing in the test-suite to be entirely due to the software renderer, rather than the interface. Any theories as to why that's not the case?
Is there a performance delta between test-suite on GLX+llvmpipe and on OSMesa+llvmpipe?
brunoabinader commentedon Nov 3, 2016
I agree - though I couldn't properly find a reason why GLX produces rendering artifacts, besides the fact its rendering pipeline is more complex due to X indirections than OSMesa.
Both implementations eventually uses LLVMpipe, so it seems unlikely e.g. duration for
node4-clang35-debugis ~8min for both.brunoabinader commentedon Nov 4, 2016
Fixed in #6899.