Skip to content
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

GPU surfaces on Windows 7? #213

Closed
tdenniston opened this issue Dec 20, 2016 · 5 comments
Closed

GPU surfaces on Windows 7? #213

tdenniston opened this issue Dec 20, 2016 · 5 comments

Comments

@tdenniston
Copy link
Contributor

Is it possible to create a GPU-backed SKSurface on Windows 7? I'm currently getting a DllNotFoundException thrown when calling GRGlInterface.CreateDefaultInterface(): "Unable to load libEGL.dll".

I think libEGL.dll is a part of the Microsoft ANGLE package, which only seems to be available for Windows 10 and beyond?

@prepare
Copy link

prepare commented Dec 20, 2016

yes, you can use GPU-backed SKSurface on Windows 7
I've test it :)

I use libEGL from this ...
https://github.com/google/angle

SKIA sample (4,5) here
PaintLab/PixelFarm#1

@mattleibow
Copy link
Contributor

@tdenniston This can be done in two ways. CreateDefaultInterface uses the preferred platform engine - on Windows it is DirectX. I haven't yet got the targets in place for it to work out the box.

CreateDefaultInterface is basically a wrapper: CreateNativeAngleInterface() ?? CreateNativeGlInterface(). On non-Windows platforms CreateNativeAngleInterface just returns null, so automatically falls back to OpenGL[ES].

However, OpenGL is working fine: GRGlInterface.CreateNativeGlInterface(). This will work on Windows 7 out the box and is what I use for the GL controls. I need to get the ANGLE bits for Windows Classic and then hook up the DirectX/OpenGL context to WinForms. This is a bit of work, so I haven't had a chance to do it yet.

@tdenniston
Copy link
Contributor Author

@mattleibow When I try calling GRGlInterface.CreateNativeGlInterface() it is returning null.

@mattleibow
Copy link
Contributor

@tdenniston That might be because you don't have an OpenGL context set up?

SkiaSharp does not create an OpenGL context, the "interface" here is basically a set of function pointers to the OpenGL functions (glDrawXXX). In my SkiaSharp.Views, I first set up a context to draw to the control/memory and then in the draw loop, I get the interface.

For the Windows Desktop, I use OpenTK and GLControl (I will be switching eventually to DirectX): https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.Views/SkiaSharp.Views.Desktop/SKGLControl.cs

For UWP, I set up my ANGLE/DX context:
https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SKSwapChainPanel.cs

@mattleibow
Copy link
Contributor

Closing this as this is a combination of a duplicate issue and is also not really the right issue to solve:

  • GPU is supported for Windows 7
  • Only OpenGL views are currently implemented (via OpenTK.GLControl)
  • ANGLE views are not currently implemented (or distributed) Include ANGLE for win7-* runtimes #243

To use OpenGL GPU on Windows 7, either use the OpenGL-based view, or you will have to set up your own context. For DirectX GPU, you will have to make use of the AssembleAngleInterface:
https://github.com/mono/SkiaSharp/blob/v1.56.2/binding/Binding/GRGlInterface.cs#L89

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants