Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow creating a SurfaceTexture from a D3D11 texture #187
Conversation
| &mut self, | ||
| context: &mut Context, | ||
| size: &Size2D<i32>, | ||
| texture: *mut d3d11::ID3D11Texture2D |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
pcwalton
Jun 24, 2020
Contributor
If not, document the reference counting semantics in the documentation.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Jun 25, 2020
Author
Member
Looks like I can't make it a COM pointer, since the use case is openxr, and https://docs.rs/openxr/0.12.2/x86_64-pc-windows-msvc/openxr/d3d/enum.D3D11.html exposes type SwapchainImage = *mut ID3D11Texture2D. I'll add a comment saying that it is up to the caller to ensure that texture is kept live.
This comment has been minimized.
This comment has been minimized.
pcwalton
Jun 25, 2020
Contributor
You could still have made it a COM pointer, because you can wrap raw pointers in COM pointers.
I don't think it's a good idea to subvert the COM IUnknown reference counting semantics by requiring the caller to ensure liveness. surfman should be maintaining reference counts itself.
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=jdm |
|
|
|
|
asajeffrey commentedJun 15, 2020
For webxr layer management on UWP, life is simpler if we can get surfman to create a
SurfaceTexturedirectly from a D3D11 texture. We can't go via a surface annoyingly, since we want theSurfaceTextureto be created directly from the EGL pbuffer, not going viaeglCreatePbufferFromClientBuffer.