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

Support SwapChainPanel on Windows #4187

Closed
DDRBoxman opened this issue Sep 29, 2023 · 1 comment · Fixed by #4191
Closed

Support SwapChainPanel on Windows #4187

DDRBoxman opened this issue Sep 29, 2023 · 1 comment · Fixed by #4191
Labels
backend: dx12 Issues with DX12 or DXGI type: enhancement New feature or request

Comments

@DDRBoxman
Copy link
Contributor

DDRBoxman commented Sep 29, 2023

Is your feature request related to a problem? Please describe.

I've been exploring how to render to a view in a WinUI3 application and after some investigation there doesn't seem to be a good way to do that currently.

Describe the solution you'd like

Ideally Instance would have an additional function that could take in a SwapChainPanel and set the swap chain on it.

Describe alternatives you've considered

I tried using Microsoft.UI.Content.ContentExternalOutputLink.PlacementVisual but not only is that only experimental it also requires building a hwind outside the application and then you have to hide that window somehow.

I also tried passing a null Visual to Instance with instance.create_surface_from_surface_handle on windows and that let me build the rendering context without a surface. The plan was to pass the dx12 swap chain back up to C# but the fields in dx12 are private.

Additional context

https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.swapchainpanel.-ctor?view=windows-app-sdk-1.4

@DDRBoxman
Copy link
Contributor Author

I got a proof of concept working this afternoon, it ended up being a little backwards to test the feasibility but I’ll look into cleaning it up properly and submitting a PR

@teoxoy teoxoy added type: enhancement New feature or request backend: dx12 Issues with DX12 or DXGI labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: dx12 Issues with DX12 or DXGI type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants