bmi*_*itc 5 .net opengl f# skia skiasharp
I have a test application written in F# on .NET 7 that opens a window using GLFW and draws to it using SkiaSharp. This application works on Windows, and now I am testing support on Linux. Right now, I am testing on a fresh install of Linux Mint, but the same exit code described here also happens on Ubuntu through WSL2.
However, my application crashes, and the only response is an exit code of 139, which apparently means there's a segmentation fault. I whittled my test application down to just GLFW, and I am able to open up a window without error. As soon as I add back in any interaction with SkiaSharp, the crash happens. I have specifically determined this to happen at the line:
let grGlInterface = GRGlInterface.Create(getProcAddress)
Run Code Online (Sandbox Code Playgroud)
If I print out the string passed to getProcAddress
, it prints out the following before the crash:
Name passed into `getProcAddress`: glGetString
Name passed into `getProcAddress`: glGetString
Name passed into `getProcAddress`: glGetStringi
Name passed into `getProcAddress`: glGetIntegerv
Name passed into `getProcAddress`: eglQueryString
Name passed into `getProcAddress`: eglGetCurrentDisplay
Run Code Online (Sandbox Code Playgroud)
However, this works on both Windows and macOS.
So something is either wrong with SkiaSharp on Linux or with my dependencies.
My project file (WindowTest.fsproj
):
let grGlInterface = GRGlInterface.Create(getProcAddress)
Run Code Online (Sandbox Code Playgroud)
我找不到太多关于如何SkiaSharp.NativeAssets.Linux
工作或使用的信息。还有一个SkiaSharp.NativeAssets.Linux.NoDependencies
,我不知道它是什么。我猜它附带了 SkiaSharp 的预构建版本或其他东西?
我的测试应用程序(Program.fs
):
Name passed into `getProcAddress`: glGetString
Name passed into `getProcAddress`: glGetString
Name passed into `getProcAddress`: glGetStringi
Name passed into `getProcAddress`: glGetIntegerv
Name passed into `getProcAddress`: eglQueryString
Name passed into `getProcAddress`: eglGetCurrentDisplay
Run Code Online (Sandbox Code Playgroud)
我用 运行这个应用程序dotnet run --project WindowTest
。除了返回的退出代码 139 之外,除了我的调试打印语句之外,没有任何内容打印到控制台。我不确定如何进一步调试。我希望我应该利用 Linux 上的 SkiaSharp 本机依赖项做更多的事情。Windows 上不需要这些。另一种选择是 Linux 上的 SkiaSharp 存在错误。
运行命令glxinfo | grep "OpenGL"
返回:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GLFW\GLFW.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="6.0.6" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
感谢您的任何帮助!
归档时间: |
|
查看次数: |
736 次 |
最近记录: |