Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kiryldz committed Jan 26, 2022
1 parent ebbb22e commit 15ac612
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ internal class EGLConfigChooser constructor(
): IntArray {
val numConfigs = IntArray(1)
val initialSampleCount = antialiasingSampleCount
while (true) {
var suitableConfigsFound = false
while (!suitableConfigsFound) {
val success = egl.eglChooseConfig(display, configAttributes, null, 0, numConfigs)
if (!success || numConfigs[0] < 1) {
Logger.e(
Expand All @@ -105,13 +106,14 @@ internal class EGLConfigChooser constructor(
Logger.w(TAG, "Reducing sample count in 2 times for MSAA as EGL_SAMPLES=$antialiasingSampleCount is not supported")
antialiasingSampleCount /= 2
} else {
// we did all we could, breaking the loop and indicating EGL config was not found
// we did all we could, return error
Logger.e(TAG, "No suitable EGL configs were found.")
numConfigs[0] = 0
eglChooserSuccess = false
break
return numConfigs
}
} else {
break
suitableConfigsFound = true
}
}
if (initialSampleCount != antialiasingSampleCount) {
Expand Down

0 comments on commit 15ac612

Please sign in to comment.