-
Notifications
You must be signed in to change notification settings - Fork 105
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 crash on Windows machines without OpenGL #811
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some Windows CI machines don't contain OpenGL, so Skiko/Compose will crash on them. It shouldn't crash, it should fallback to Software rendering To properly fallback, we need to load opengl32.dll dynamically in runtime. Fixes JetBrains/compose-multiplatform#3243 # Test 1 - `gradlew publishToMavenLocal` is successful (if we use functions directly, it fails with "error LNK2019: unresolved external symbol") - `SkiaLayerTest` is successful (it tests OpenGL as well) # Test 2 1. Remove `C:\Windows\System32\opengl32.dll` 2. `SkiaLayerTest` still should be successful, but logs should contain that it fallbacks to Software rendering. # Test 3 1. Compile local skiko 2. Run Compose run1 and tests
MatkovIvan
reviewed
Oct 4, 2023
MatkovIvan
reviewed
Oct 4, 2023
MatkovIvan
reviewed
Oct 5, 2023
It isn't valid to use FormatMessage for code from GetLastError
MatkovIvan
reviewed
Oct 7, 2023
MatkovIvan
approved these changes
Oct 9, 2023
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
igordmn
added a commit
that referenced
this pull request
Feb 9, 2024
It is a regression after #811 After that PR, OpenGL functions are linked in runtime via function `loadOpenGLLibrary`. We didn't call it in `makeGL` functions. Now we call. Adding also `isLoaded` to avoid loading it multiple times Fixes https://youtrack.jetbrains.com/issue/COMPOSE-642/Fix-Skiko-API-regression-for-creating-OpenGL-context
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some Windows CI machines don't contain OpenGL, so Skiko/Compose will crash on them. It shouldn't crash, it should fallback to Software rendering
To properly fallback, we need to load opengl32.dll dynamically in runtime.
Fixes JetBrains/compose-multiplatform#3243
Test 1
gradlew publishToMavenLocal
is successful (if we use functions directly, it fails with "error LNK2019: unresolved external symbol")SkiaLayerTest
is successful (it tests OpenGL as well)Test 2
C:\Windows\System32\opengl32.dll
SkiaLayerTest
still should be successful, but logs should contain that it fallbacks to Software rendering.Test 3