-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix map not rendering on emulators when MSAA is enabled #1077
Conversation
sdk/src/main/java/com/mapbox/maps/renderer/egl/EGLConfigChooser.kt
Outdated
Show resolved
Hide resolved
@kiryldz could we add some tests to this function? unit test would be useful to cover logic for |
15ac612
to
461861f
Compare
461861f
to
79a3e27
Compare
eglChooserSuccess = false | ||
if (antialiasingSampleCount > 1) { | ||
Logger.w(TAG, "Reducing sample count in 2 times for MSAA as EGL_SAMPLES=$antialiasingSampleCount is not supported") | ||
antialiasingSampleCount /= 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the device's supported sample count is like 4, 8 etc, while the user defined 5? would this algorithm end up picking 0 in the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pengdev 5 / 2 = 2, 2 / 2 = 1 => config with MSAA disabled will be chosen. Dividing any number (> 1) by 2 will end up with 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if user defined 5, while device supports 4 or 8 - it depends on the driver, from what I've seen it EGL will select sample count rounded up so in this case it will select 8.
We will write a warning in this case though, this logic is not changed in this PR
Summary of changes
At least Google simulators seem not to support MSAA option when configuring EGL. This will result in map not being rendered at all. Now logic is introduced to try double down
EGL_SAMPLE
value in a loop until either supported MSAA config will be found (fixing an issue of map not being rendered even on physical device when setting huge MSAA value) or EGL will be configured without MSAA (fixing an issue with emulators).User impact (optional)
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).mapbox-maps-android
changelog:<changelog>Fix map not rendering on emulators when MSAA is enabled.</changelog>
.v10.[version]
release branch fix / enhancement, merge it tomain
firstly and then port tov10.[version]
release branch.Fixes: #1076
PRs must be submitted under the terms of our Contributor License Agreement CLA.