diff options
Diffstat (limited to 'system/OpenglSystemCommon')
-rw-r--r-- | system/OpenglSystemCommon/EmulatorFeatureInfo.h | 7 | ||||
-rw-r--r-- | system/OpenglSystemCommon/HostConnection.cpp | 8 | ||||
-rw-r--r-- | system/OpenglSystemCommon/HostConnection.h | 5 |
3 files changed, 18 insertions, 2 deletions
diff --git a/system/OpenglSystemCommon/EmulatorFeatureInfo.h b/system/OpenglSystemCommon/EmulatorFeatureInfo.h index f6d8ce59..a21b2576 100644 --- a/system/OpenglSystemCommon/EmulatorFeatureInfo.h +++ b/system/OpenglSystemCommon/EmulatorFeatureInfo.h @@ -133,6 +133,9 @@ static const char kSyncBufferData[] = "ANDROID_EMU_sync_buffer_data"; // Batched descriptor set update static const char kVulkanBatchedDescriptorSetUpdate[] = "ANDROID_EMU_vulkan_batched_descriptor_set_update"; +// DMA for readback +static const char kReadColorBufferDma[] = "ANDROID_EMU_read_color_buffer_dma"; + // Struct describing available emulator features struct EmulatorFeatureInfo { @@ -159,7 +162,8 @@ struct EmulatorFeatureInfo { hasAsyncFrameCommands(false), hasVulkanQueueSubmitWithCommands(false), hasVulkanBatchedDescriptorSetUpdate(false), - hasSyncBufferData(false) + hasSyncBufferData(false), + hasReadColorBufferDma(false) { } SyncImpl syncImpl; @@ -185,6 +189,7 @@ struct EmulatorFeatureInfo { bool hasVulkanQueueSubmitWithCommands; bool hasVulkanBatchedDescriptorSetUpdate; bool hasSyncBufferData; + bool hasReadColorBufferDma; }; enum HostConnectionType { diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp index 4afa20e7..8d15d086 100644 --- a/system/OpenglSystemCommon/HostConnection.cpp +++ b/system/OpenglSystemCommon/HostConnection.cpp @@ -672,6 +672,7 @@ ExtendedRCEncoderContext *HostConnection::rcEncoder() queryAndSetVulkanQueueSubmitWithCommandsSupport(rcEnc); queryAndSetVulkanBatchedDescriptorSetUpdateSupport(rcEnc); queryAndSetSyncBufferData(rcEnc); + queryAndSetReadColorBufferDma(rcEnc); queryVersion(rcEnc); if (m_processPipe) { m_processPipe->processPipeInit(m_connectionType, rcEnc); @@ -971,6 +972,13 @@ void HostConnection::queryAndSetSyncBufferData(ExtendedRCEncoderContext* rcEnc) } } +void HostConnection::queryAndSetReadColorBufferDma(ExtendedRCEncoderContext* rcEnc) { + std::string glExtensions = queryGLExtensions(rcEnc); + if (glExtensions.find(kReadColorBufferDma) != std::string::npos) { + rcEnc->featureInfo()->hasReadColorBufferDma = true; + } +} + GLint HostConnection::queryVersion(ExtendedRCEncoderContext* rcEnc) { GLint version = m_rcEnc->rcGetRendererVersion(m_rcEnc.get()); return version; diff --git a/system/OpenglSystemCommon/HostConnection.h b/system/OpenglSystemCommon/HostConnection.h index 7c556290..31ca84cf 100644 --- a/system/OpenglSystemCommon/HostConnection.h +++ b/system/OpenglSystemCommon/HostConnection.h @@ -85,7 +85,9 @@ public: } virtual uint64_t lockAndWriteDma(void* data, uint32_t size) { if (m_dmaPtr && m_dmaPhysAddr) { - memcpy(m_dmaPtr, data, size); + if (data != m_dmaPtr) { + memcpy(m_dmaPtr, data, size); + } return m_dmaPhysAddr; } else if (m_dmaCxt) { return writeGoldfishDma(data, size, m_dmaCxt); @@ -242,6 +244,7 @@ private: void queryAndSetVulkanQueueSubmitWithCommandsSupport(ExtendedRCEncoderContext *rcEnc); void queryAndSetVulkanBatchedDescriptorSetUpdateSupport(ExtendedRCEncoderContext *rcEnc); void queryAndSetSyncBufferData(ExtendedRCEncoderContext *rcEnc); + void queryAndSetReadColorBufferDma(ExtendedRCEncoderContext *rcEnc); GLint queryVersion(ExtendedRCEncoderContext* rcEnc); private: |