aardvark.rendering icon indicating copy to clipboard operation
aardvark.rendering copied to clipboard

Improve error reporting when library function cannot be loaded

Open luithefirst opened this issue 5 years ago • 1 comments

I received a Hilite log with the following error:

 0:   initializing OpenGL runtime ................................................................
 0:     WARNING: System.Exception: could not get native function (maybe some opengl-driver problem?)
   at [email protected](Object[] _arg1) in C:\- Data\aardvark-base\src\Aardvark.Base.FSharp\Reflection\UnmanagedFunctions.fs:line 78
   at <StartupCode$FSharp-Core>[email protected](T1 inp)
   at <StartupCode$Aardvark-Application-WinForms-GL>[email protected](IDisposable _arg1) in C:\Users\Schorsch\Development\aardvark.rendering\src\Application\Aardvark.Application.WinForms.GL\Application.fs:line 55
   at Microsoft.FSharp.Core.Operators.Using[T,TResult](T resource, FSharpFunc`2 action)
   at HiliteRender.HiliteCore..ctor(Settings settings, String shaderCachePath, ISplashScreen splash) in C:\GitLab-Runner\builds\ykmHiqGX\0\lds\Hilite.Render\src\Project HILITE\HiliteRender\HiliteCore.cs:line 147
   at HiliteApp.Viewer..ctor(ISplashScreen splash) in C:\GitLab-Runner\builds\ykmHiqGX\0\lds\Hilite.Render\src\Project HILITE\HiliteApp\Viewer.cs:line 442
   at HiliteViewer.Program.Init(String[] args) in C:\GitLab-Runner\builds\ykmHiqGX\0\lds\Hilite.Render\src\Project HILITE\HiliteViewer\Program.cs:line 116
 0:   initializing OpenGL runtimeInitialization finished ................................. 6.279 s
 0:   WARNING: Hilite not initialized properly!

It was generated with Aardvark.Rendering 4.8.11. At the moment there is no need to change this old version, but as the current master still uses the same code and error handling the error reporting should be improved and at least include the function name. As UnmanagedFunctions.wrap only gets a function pointer, this needs to be handled earlier, maybe in getProcAddress, but I assume some functions are allowed to fail and maybe do not need to log an error. Please review for possible improvements.

luithefirst avatar Jul 07 '20 09:07 luithefirst

Module Unsafe https://github.com/aardvark-platform/aardvark.rendering/blob/bb0a5f01a0753474733f2835e9f408063ce1a8c9/src/Aardvark.Rendering.GL/Instructions/OpenGL.fs#L829 only seems to be used during the initialization -> remove/replace call during init? remove module?

luithefirst avatar Apr 19 '22 13:04 luithefirst