Particles/Particles.cpp
//-----------------------------------------------------------------------------
// share handles between render and compute
// optionally, copy particle state from render to compute (usually compute creates particle state)
//-----------------------------------------------------------------------------
share handles between render and compute
optionally, copy particle state from render to compute (usually compute creates particle state)
share handles between render and compute optionally copy particle state from render to compute ( usually compute creates particle state )
void Particles::ShareHandles()
{
    assert(m_pRender != nullptr);
    assert(m_pCompute != nullptr);
    m_pCompute->ResetFromAsyncHelper();
    const HANDLE renderFenceHandle = m_pRender->GetSharedFenceHandle();
    assert(renderFenceHandle != nullptr);
    m_pRender->SetShared(m_pCompute->GetSharedHandles(renderFenceHandle));
    bool asyncMode = (m_renderAdapterIndex == m_computeAdapterIndex);
    if (asyncMode)
    {
        m_pCompute->SetAsync(m_pRender->GetFence(), m_pRender->GetBuffers(), m_pRender->GetBufferIndex());
    }
    m_pRender->SetAsyncMode(asyncMode);
}
void Particles :: ShareHandles ( ) { assert ( m_pRender != nullptr ) ; assert ( m_pCompute != nullptr ) ; m_pCompute -> ResetFromAsyncHelper ( ) ; const HANDLE renderFenceHandle = m_pRender -> GetSharedFenceHandle ( ) ; assert ( renderFenceHandle != nullptr ) ; m_pRender -> SetShared ( m_pCompute -> GetSharedHandles ( renderFenceHandle ) ) ; bool asyncMode = ( m_renderAdapterIndex == m_computeAdapterIndex ) ; if ( asyncMode ) { m_pCompute -> SetAsync ( m_pRender -> GetFence ( ) , m_pRender -> GetBuffers ( ) , m_pRender -> GetBufferIndex ( ) ) ; } m_pRender -> SetAsyncMode ( asyncMode ) ; }
share handles between render and compute
optionally, copy particle state from render to compute (usually compute creates particle state)
share handles between render and compute optionally copy particle state from render to compute ( usually compute creates particle state )