mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 08:41:31 +00:00
[idd] capture: copy software frames directly to IVSHMEM
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 / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
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 / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Bypass cadence retention when the software render adapter is active. Publish each available source frame immediately with one damage-aware D3D copy into its final IVSHMEM resource. Keep only one software copy in flight so newer frames are dropped instead of queued behind stale work. Retain accumulated damage for the next frame and skip static re-encodes when no image update is pending. Use a row-major IVSHMEM texture when the shared heap supports it and fall back to a direct IVSHMEM buffer copy otherwise. In indirect mode, copy only damaged rows from readback memory into IVSHMEM.
This commit is contained in:
@@ -1804,7 +1804,8 @@ int CIndirectDeviceContext::FindNewestCompletedFrame(
|
||||
}
|
||||
|
||||
bool CIndirectDeviceContext::FrameBufferAvailable(
|
||||
const CFrameScheduler::Schedule& schedule)
|
||||
const CFrameScheduler::Schedule& schedule,
|
||||
bool allowReadyReplacement)
|
||||
{
|
||||
if (!m_lgmp || !m_frameQueue)
|
||||
return false;
|
||||
@@ -1823,7 +1824,8 @@ bool CIndirectDeviceContext::FrameBufferAvailable(
|
||||
const bool ownerBlocked =
|
||||
CountOwnerDeliveries(schedule.clientID) >= LGMP_Q_FRAME_LEN;
|
||||
const bool ownerQueuesBlocked = FindAvailableOwnerQueue(0) < 0;
|
||||
allowReady = ownerBlocked || ownerQueuesBlocked;
|
||||
allowReady = allowReadyReplacement &&
|
||||
(ownerBlocked || ownerQueuesBlocked);
|
||||
}
|
||||
else if (lgmpHostQueuePending(m_frameQueue) != 0)
|
||||
{
|
||||
@@ -1911,7 +1913,8 @@ bool CIndirectDeviceContext::ReplaySharedFrame(uint64_t now, bool& retry)
|
||||
CIndirectDeviceContext::PreparedFrameBuffer CIndirectDeviceContext::PrepareFrameBuffer(
|
||||
unsigned pitch, const D12FrameFormat& srcFormat,
|
||||
const D12FrameFormat& dstFormat, const RECT * dirtyRects,
|
||||
unsigned nbDirtyRects, const CFrameScheduler::Schedule& schedule)
|
||||
unsigned nbDirtyRects, const CFrameScheduler::Schedule& schedule,
|
||||
bool allowReadyReplacement)
|
||||
{
|
||||
PreparedFrameBuffer result = {};
|
||||
|
||||
@@ -1929,8 +1932,9 @@ CIndirectDeviceContext::PreparedFrameBuffer CIndirectDeviceContext::PrepareFrame
|
||||
AcquireSRWLockExclusive(&m_framePublishLock);
|
||||
const bool ownerBlocked = schedule.clientID &&
|
||||
CountOwnerDeliveries(schedule.clientID) >= LGMP_Q_FRAME_LEN;
|
||||
const bool allowReady = ownerBlocked ||
|
||||
(schedule.clientID && FindAvailableOwnerQueue(0) < 0);
|
||||
const bool allowReady = allowReadyReplacement &&
|
||||
(ownerBlocked ||
|
||||
(schedule.clientID && FindAvailableOwnerQueue(0) < 0));
|
||||
const int availableFrameIndex =
|
||||
FindAvailableFrameBuffer(allowReady);
|
||||
bool expected = false;
|
||||
@@ -2450,6 +2454,21 @@ void CIndirectDeviceContext::WriteFrameBuffer(unsigned frameIndex, void* src, si
|
||||
fb->wp = (uint32_t)(offset + len);
|
||||
}
|
||||
|
||||
void CIndirectDeviceContext::WriteFrameBufferRows(unsigned frameIndex,
|
||||
void * src, size_t offset, size_t rowBytes, size_t pitch,
|
||||
unsigned rows) const
|
||||
{
|
||||
FrameBuffer * fb = m_frameBuffer[frameIndex];
|
||||
uint8_t * dst = fb->data + offset;
|
||||
uint8_t * source = static_cast<uint8_t *>(src) + offset;
|
||||
for (unsigned row = 0; row < rows; ++row)
|
||||
{
|
||||
memcpy(dst, source, rowBytes);
|
||||
dst += pitch;
|
||||
source += pitch;
|
||||
}
|
||||
}
|
||||
|
||||
void CIndirectDeviceContext::FinalizeFrameBuffer(unsigned frameIndex) const
|
||||
{
|
||||
const KVMFRFrame * frame = m_frame[frameIndex];
|
||||
|
||||
Reference in New Issue
Block a user