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

Bring win2d to WPF #97

Open
lindexi opened this Issue Dec 6, 2018 · 7 comments

Comments

Projects
None yet
6 participants
@lindexi
Contributor

lindexi commented Dec 6, 2018

Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration.

Can we bring win2d to WPF?

@fabiant3 fabiant3 added this to the Future milestone Dec 6, 2018

@petroemil

This comment has been minimized.

petroemil commented Dec 6, 2018

I think this could only be an option once the Extensible rendering pipeline ( #85 ) is implemented

@legistek

This comment has been minimized.

legistek commented Dec 6, 2018

Maybe even DirectComposition (although it would kill Win7 support).

@dotMorten

This comment has been minimized.

Collaborator

dotMorten commented Dec 6, 2018

although it would kill Win7 support
Could be an opt-in feature - ie if you want to use it, Win7 is explicitly dropped, And Win7 support only have about a year left. DirectComposition support / SwapChainPanel has been my biggest ask for WPF for years. D3DImage is absolutely horrendous for high DX rendering performance.

@legistek

This comment has been minimized.

legistek commented Dec 6, 2018

See that's another great reason to go with #85 because then moving between D3D, D2D, DirectComposition, whatever, would be really easy.

Oh and hear hear on D3DImage being pretty awful. We have a custom video player that uses it and I can almost never get a reliable 30fps out of it. Close but never totally smooth.

@lhak

This comment has been minimized.

lhak commented Dec 7, 2018

Win2d can be used today with XAML islands. Only the CanvasSwapChainPanel controls works at the moment, but the other controls (e.g. CanvasControl) will probably only need minor modifications (their draw event is currently not called)

@lindexi

This comment has been minimized.

Contributor

lindexi commented Dec 9, 2018

@lhak XAML islands are windows hosts like that can not add in the WPF level. See WPF and Win32 Interoperation

@lindexi

This comment has been minimized.

Contributor

lindexi commented Dec 9, 2018

The WPF should use D3DImage to use D3D but Direct3D9 content hosted in a D3DImage instance does not render as fast as in a pure Direct3D application. Copying the surface and flushing the command buffer can be costly operations.

See https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/performance-considerations-for-direct3d9-and-wpf-interoperability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment