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

Add Windows IDCompositionVisual and its HANDLE? #172

Open
MarijnS95 opened this issue Aug 24, 2024 · 0 comments
Open

Add Windows IDCompositionVisual and its HANDLE? #172

MarijnS95 opened this issue Aug 24, 2024 · 0 comments

Comments

@MarijnS95
Copy link
Member

After working on wgpu's Dx12 backend some, two new "drawble" handle types showed up in https://docs.rs/wgpu/latest/x86_64-pc-windows-msvc/wgpu/enum.SurfaceTargetUnsafe.html: IDCompositionVisual and the (badly named and badly documented) SurfaceHandle which really is a HANDLE created from DCompositionCreateSurfaceHandle() (and represents an IDCompositionSurface via CreateSurfaceFromHandle()). The HANDLE allows this surface to be shared and rendered to across process boundaries.

Should we add some enum variants to wrap these types?

Note that in wgpu, IDCompositionVisual is used to set a swapchain to be its content via visual.SetContent(swap_chain).
For the HANDLE IDXGIFactoryMedia::CreateSwapChainForCompositionSurfaceHandle() is used which is documented to create a YUV swapchain as if it is specifically designed for media, but it seems to work fine to raster triangles into using an RGB format?

Finally, the https://learn.microsoft.com/en-us/windows/win32/api/presentation/nn-presentation-ipresentationsurface API also seems to support receiving composition surface HANDLEs.

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

No branches or pull requests

1 participant