Skip to content

mullion: keep shared fence MTLSharedEvent alive while shared handle is open - #364

Open
cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/shared-fence-keepalive
Open

cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/shared-fence-keepalive

Conversation

@cyyever

@cyyever cyyever commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Retain a WMT::Reference<WMT::SharedEvent> in src/mullion/mullion_fence.cpp whenever shareHandle() creates a shared fence handle, and pass the WMT::SharedEvent from MTLD3D11FenceImpl::CreateSharedHandle and MTLD3D12FenceImpl::CreateSharedHandle.
  • Previously, if the original ID3D11Fence / ID3D12Fence was released after CreateSharedHandle() but before OpenSharedHandle() / OpenSharedFence() was called on the handle, releasing the MTLSharedEvent tore down its bootstrap mach port registration and caused the subsequent open to fail.
  • Sweep retained entries whose shared file-mapping handles have been closed on subsequent shareHandle() calls so closed handles do not leak events.

Verification

  • Syntax-checked src/mullion/mullion_fence.cpp, src/d3d11/d3d11_fence.cpp, and src/d3d12/d3d12_fence.cpp with x86_64-w64-mingw32-g++ -std=c++20 -Wall -Wextra.

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.

1 participant