[host] Added SMID BGRAToRGB support and implemented it in DXGI

This commit is contained in:
Geoffrey McRae
2017-11-16 22:43:29 +11:00
parent 6eb40a1897
commit 534e9425f1
3 changed files with 62 additions and 12 deletions

View File

@@ -114,8 +114,12 @@ bool Service::Process()
if (!m_initialized)
return false;
KVMGFXHeader * header = reinterpret_cast<KVMGFXHeader *>(m_memory);
const uint64_t dataOffset = sizeof(KVMGFXHeader) + m_frameIndex * m_capture->GetMaxFrameSize();
KVMGFXHeader * header = reinterpret_cast<KVMGFXHeader *>(m_memory);
// calculate the current offset and ensure it is 16-byte aligned for SMID performance
uint64_t dataOffset = sizeof(KVMGFXHeader) + m_frameIndex * m_capture->GetMaxFrameSize();
dataOffset = (dataOffset + 0xF) & ~0xF;
uint8_t * data = m_memory + dataOffset;
const size_t available = m_ivshmem->GetSize() - sizeof(KVMGFXHeader);