dcomp needs a special swapchain implementation that we don't currently have. If there's a way to make this work with current wine then I'll look into it, but it's possible that we need some sort of interop interface with wine to be able to support this.
Can you share your test app somewhere?
dcomp needs a special swapchain implementation that we don't currently have. If there's a way to make this work with current wine then I'll look into it, but it's possible that we need some sort of interop interface with wine to be able to support this.
Thanks for the reminder — I suddenly realized I haven't actually looked closely at the implementation of CreateSwapchainForComposition.
Can you share your test app somewhere?
Sure, I implemented a minimal test example, but the DirectComposition-related code is all unofficial.
https://gitlab.winehq.org/baikaishiuc/wine-dcomp/-/tree/zxw/dcomp/dxvk4?ref_type=heads
It comes from:
https://gitlab.winehq.org/zhiyi/wine/-/tree/bug-23698-react-native?ref_type=heads
dcomp needs a special swapchain implementation that we don't currently have. If there's a way to make this work with current wine then I'll look into it, but it's possible that we need some sort of interop interface with wine to be able to support this.
Can you share your test app somewhere?
I found the reason — the hwnd passed to CreateSwapChainForComposition was 0, which caused Present not to be executed.
I need to think about how to fix it.
Can I just comment out this line?
Composition swap chains inherently don't have a window.
FWIW, our current implementation is to create a dummy window, but is hidden behind a config option, DXVK_CONFIG="dxgi.enableDummyCompositionSwapchain = True". Maybe that works as-is?
I'll check out your tests later.
Composition swap chains inherently don't have a window.
FWIW, our current implementation is to create a dummy window, but is hidden behind a config option,
DXVK_CONFIG="dxgi.enableDummyCompositionSwapchain = True". Maybe that works as-is?I'll check out your tests later.
I've already forced this option to be set to true.
I also need to comment out the line above as well.
Just commenting out this line will do.
Got your test to work with the PR above.
I think it's best to keep it locked behind a config option for now since some (notably CEF) apps are notoriously allergic to us not failing on CreateSwapchainForComposition; we can revisit this once the wine dcomp code ships in an official wine development release and/or Proton Experimental.
Got your test to work with the PR above.
I think it's best to keep it locked behind a config option for now since some (notably CEF) apps are notoriously allergic to us not failing on
CreateSwapchainForComposition; we can revisit this once the wine dcomp code ships in an official wine development release and/or Proton Experimental.
Cool, Thanks.
I'm not sure whether this issue should be posted on the wine forum or here. If I've posted it in the wrong place, I apologize.
I wrote a test program called dcomp_test.exe, which is already working under Wine. Its main function is to render circles, and the effect looks like this:
https://list.winehq.org/mailman3/hyperkitty/list/[email protected]/message/QVJ5EIE2GJCGVD5RHO5T7MNMTSIBVZAV/attachment/4/image.png
The actual operation is...: surface content = gdi * backgroup_alpha + swapchain[0] * foreground_alpha
However, after replacing Wine's built-in DLLs with the ones I built from DXVK
specifically dxgi, d3d8, d3d9, d3d10core, d3d11, and d3d12
I found that the circle was no longer rendered.
The image extracted from the swapchain contained all zeros.
https://list.winehq.org/mailman3/hyperkitty/list/[email protected]/message/QVJ5EIE2GJCGVD5RHO5T7MNMTSIBVZAV/attachment/5/image.png
I did a quick trace and confirmed that it reached:
https://github.com/wine-mirror/wine/blob/80bc1338bea7d9dac78ab449b4505e5bb91e7ba3/dlls/d2d1/device.c#L187
So I feel that the circle is indeed being rendered onto the DXVK D3D11 swapchain,
but I'm not sure at which step the content fails to be retrieved correctly.
Any suggestions are welcome