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

Discussion: Vulkan embedding #3291

Closed
tomzorz opened this issue Sep 16, 2020 · 11 comments
Closed

Discussion: Vulkan embedding #3291

tomzorz opened this issue Sep 16, 2020 · 11 comments
Labels
discussion General discussion needs-author-feedback Asked author to supply more information. needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) no-recent-activity

Comments

@tomzorz
Copy link

tomzorz commented Sep 16, 2020

Discussion: Vulkan embedding

Hi folks,

Our company is currently shipping a WPF application with a Vulkan renderer embedded in it for a 3D LOB application. While this solution works, we have several issues:

  • we'd love to use Fluent Design components, and get all the new design/HiDPI goodness;
  • there are a few WPF bugs that make our designers sad, e.g. applying drop shadows kills both perf and makes text blurry;
  • there are many airspace issues with rendering on top of the Vulkan render area - we have to resort to using windows/dialogs for many things that wouldn't require them.

Are there any plans for better integration paths, maybe solving some of these airspace issues? We'd love to work together on this - we can definitely provide real life feedback/data on how things currently are.

Thanks,
Tamás

@tomzorz tomzorz added the discussion General discussion label Sep 16, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Sep 16, 2020
@StephenLPeters StephenLPeters added the needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) label Sep 17, 2020
@StephenLPeters
Copy link
Contributor

@tomzorz are you asking for Winui support for Vulkan renderer?

@Austin-Lamb @ryandemopoulos @MikeHillberg @codendone FYI

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Sep 17, 2020
@tomzorz
Copy link
Author

tomzorz commented Sep 20, 2020

@StephenLPeters No (although that could be cool as well...). More like a Vulkan variant of SwapChainPanel - I guess that might necessitate the rest of the application to render using Vulkan as well?

@tomzorz
Copy link
Author

tomzorz commented Sep 20, 2020

But essentially today we just use a HwndHost to embed our Vulkan renderer - if there'd be any improvement over this process that'd be awesome.

@tomzorz
Copy link
Author

tomzorz commented Nov 17, 2020

Any updates to this, now that we've got to the preview 3 release?

I tried asking @ryandemopoulos during the community standup, but we didn't got to this question.

@GeorgeS2019
Copy link

@tomzorz do consider Godot 4 with Vulkan renderer. Godot already support export to UWP. It just need to export UWP XAML app instead of UWP console app.

@drewcrawford
Copy link

Have this issue as well.

On the vulkan side, the API appears to accept any HWND, in which case, a plausible implementation is merely “a control with an HWND”

unfortunately, the only way I know of to get an hwnd is via IWindowNative (only supported on a window).

this issue looks related, as I assume you could put any win32 control in that and get its hwnd, although it seems not a priority

if anyone knows a cheap back door to get an HWND out of some winui control, that might work for now…

@alex-aparin
Copy link

Yes, support of vulkan would be very nice. I am also looking the way to integrate WinUi with vulkan renderer. I found out that winui uses custom drawing for wide range of controls (without exposing Win32 controls). At the same time vulkan requires HWND to work.

@sylveon
Copy link
Contributor

sylveon commented Oct 19, 2021

Is there not a Vulkan extension that allows it to render to a DXGI swapchain? If yes, you could use the existing SwapChainPanel with your Vulkan code.

@drewcrawford
Copy link

I believe the answer is no, spec (large page warning)

30.8... A native window cannot be associated with more than one non-retired swapchain at a time. Further, swapchains cannot be created for native windows that have a non-Vulkan graphics API surface associated with them.

While we're enumerating workarounds. The one I'm aware of is to define two separate vulkan / directx pipelines that share a texture (VkImportMemoryWin32HandleInfoKHR). The vulkan pipeline renders into the texture and the directx copies from the texture to the SwapChainPanel.

We tried that, and it does work. But it has many downsides: memory for the texture, IO bandwidth in and out, extra pipeline stage and the general complexity of maintaining two pipelines. For some usecases these are fine but when you set that next to a solution like HwndHost (which solves many other problems besides this one) the difference is clear.

@abenedik
Copy link

If you do not want to write your own rendering engine, then you can use the new Ab4d.SharpEngine that uses Vulkan and also supports WinUI 3.0 applications. See the WinUI sample on GitHub. The engine is currently in beta (April 2023).
Disclaimer: I am the author of the engine.

@bpulliam bpulliam added the needs-author-feedback Asked author to supply more information. label May 2, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General discussion needs-author-feedback Asked author to supply more information. needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) no-recent-activity
Projects
None yet
Development

No branches or pull requests

9 participants