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 methods to get raw d3d12::ComPtr<dxgi1_4::IDXGISwapChain3> from DX12 Surface #5772

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

marcpabst
Copy link

Description
This PR allows retrieving the d3d12::ComPtr<dxgi1_4::IDXGISwapChain3> from a DX12 Surface by cloning the pointer. I'm not sure if there are any conventions around exposing this kind of low-level API, so feel free to comment. I might amend this PR with methods to expose other low-level types if appropriate.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@marcpabst marcpabst requested a review from a team as a code owner June 3, 2024 16:16
@marcpabst marcpabst marked this pull request as draft June 3, 2024 17:06
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - this PR needs to be updated to use windows-rs instead of winapi, but then can go in.

@@ -177,6 +177,12 @@ pub struct Surface {
unsafe impl Send for Surface {}
unsafe impl Sync for Surface {}

impl Surface {
pub unsafe fn swap_chain(&self) -> Option<d3d12::ComPtr<dxgi1_4::IDXGISwapChain3>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub unsafe fn swap_chain(&self) -> Option<d3d12::ComPtr<dxgi1_4::IDXGISwapChain3>> {
pub unsafe fn swapchain(&self) -> Option<d3d12::ComPtr<dxgi1_4::IDXGISwapChain3>> {

Nit for consistency

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

Successfully merging this pull request may close these issues.

2 participants