[idd] handle frame re-send for when a new client connects
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae 2025-03-16 19:37:03 +00:00
parent ce23cff12e
commit 7a88a49f1c
5 changed files with 10 additions and 34 deletions

View File

@ -339,6 +339,8 @@ bool CIndirectDeviceContext::SetupLGMP(size_t alignSize)
void CIndirectDeviceContext::DeInitLGMP() void CIndirectDeviceContext::DeInitLGMP()
{ {
m_hasFrame = false;
if (m_lgmp == nullptr) if (m_lgmp == nullptr)
return; return;
@ -394,9 +396,8 @@ void CIndirectDeviceContext::LGMPTimer()
if (lgmpHostQueueNewSubs(m_frameQueue) && m_monitor) if (lgmpHostQueueNewSubs(m_frameQueue) && m_monitor)
{ {
auto* wrapper = WdfObjectGet_CIndirectMonitorContextWrapper(m_monitor); if (m_hasFrame)
if (wrapper) lgmpHostQueuePost(m_frameQueue, 0, m_frameMemory[m_frameIndex]);
wrapper->context->ResendLastFrame();
} }
if (lgmpHostQueueNewSubs(m_pointerQueue)) if (lgmpHostQueueNewSubs(m_pointerQueue))
@ -478,6 +479,7 @@ CIndirectDeviceContext::PreparedFrameBuffer CIndirectDeviceContext::PrepareFrame
result.frameIndex = m_frameIndex; result.frameIndex = m_frameIndex;
result.mem = fb->data; result.mem = fb->data;
m_hasFrame = true;
return result; return result;
} }

View File

@ -67,6 +67,7 @@ private:
int m_height = 0; int m_height = 0;
int m_pitch = 0; int m_pitch = 0;
DXGI_FORMAT m_format = DXGI_FORMAT_UNKNOWN; DXGI_FORMAT m_format = DXGI_FORMAT_UNKNOWN;
bool m_hasFrame = false;
void DeInitLGMP(); void DeInitLGMP();
void LGMPTimer(); void LGMPTimer();

View File

@ -58,12 +58,6 @@ public:
void AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID renderAdapter, HANDLE newFrameEvent); void AssignSwapChain(IDDCX_SWAPCHAIN swapChain, LUID renderAdapter, HANDLE newFrameEvent);
void UnassignSwapChain(); void UnassignSwapChain();
inline void ResendLastFrame()
{
if (m_swapChain)
m_swapChain->ResendLastFrame();
}
}; };
struct CIndirectMonitorContextWrapper struct CIndirectMonitorContextWrapper

View File

@ -218,22 +218,3 @@ void CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
m_devContext->FinalizeFrameBuffer(); m_devContext->FinalizeFrameBuffer();
} }
void CSwapChainProcessor::ResendLastFrame()
{
/*
LOCK_CONTEXT()
StagingTexture & st = m_cpuTex[m_lastIndex];
LOCK_ST(st);
UNLOCK_CONTEXT();
if (!st.map.pData)
{
UNLOCK_ST(st);
return;
}
m_devContext->SendFrame(st.width, st.height, st.map.RowPitch, st.format, st.map.pData);
UNLOCK_ST(st);
*/
}

View File

@ -63,6 +63,4 @@ public:
CIndirectDeviceContext * GetDevice() { return m_devContext; } CIndirectDeviceContext * GetDevice() { return m_devContext; }
std::shared_ptr<CD3D12Device> GetD3D12Device() { return m_dx12Device; } std::shared_ptr<CD3D12Device> GetD3D12Device() { return m_dx12Device; }
void ResendLastFrame();
}; };