Backend-uniform fence interface. Per-vendor adapters hold one instance, signal it after the per-frame compute dispatch, wait on it from CUDA before peer DMA.
More...
Backend-uniform fence interface. Per-vendor adapters hold one instance, signal it after the per-frame compute dispatch, wait on it from CUDA before peer DMA.
|
| virtual bool | valid () const noexcept=0 |
| |
| virtual bool | init (QRhi &rhi, CudaInteropContextHandle cudaCtx)=0 |
| |
| virtual void | release ()=0 |
| |
| virtual void | signalAfterEncode (QRhiCommandBuffer &cb, std::uint64_t value)=0 |
| |
| virtual bool | waitOnCuda (std::uint64_t value)=0 |
| |
◆ init()
| virtual bool score::gfx::interop::InteropFence::init |
( |
QRhi & |
rhi, |
|
|
CudaInteropContextHandle |
cudaCtx |
|
) |
| |
|
pure virtual |
One-time setup. Allocates the underlying fence/semaphore and imports it into the provided CUDA context. Returns false on any failure (no init partial state).
◆ release()
| virtual void score::gfx::interop::InteropFence::release |
( |
| ) |
|
|
pure virtual |
One-time teardown. Releases the CUDA semaphore + the underlying fence/semaphore. Safe to call multiple times.
◆ signalAfterEncode()
| virtual void score::gfx::interop::InteropFence::signalAfterEncode |
( |
QRhiCommandBuffer & |
cb, |
|
|
std::uint64_t |
value |
|
) |
| |
|
pure virtual |
Inside the offscreen frame, after the compute dispatch: signal the fence with value. Caller increments value monotonically. On D3D11/GL this is a no-op (the implicit per-frame fence suffices).
◆ valid()
| virtual bool score::gfx::interop::InteropFence::valid |
( |
| ) |
const |
|
pure virtualnoexcept |
True if init() succeeded. Stub backends return false here so vendor adapters can detect them and route around.
◆ waitOnCuda()
| virtual bool score::gfx::interop::InteropFence::waitOnCuda |
( |
std::uint64_t |
value | ) |
|
|
pure virtual |
After endOffscreenFrame, before handing the buffer to the peer: schedule a CUDA-side wait on value. Returns false on bridge error. On D3D11 this is a no-op (immediate-context flush already ran). On GL this issues glFinish once per frame.
The documentation for this struct was generated from the following file: