aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2021-08-06 21:08:08 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-06 21:08:08 +0000
commit6a3aaa931ce4bff3b50d9e60a92837c325a63f77 (patch)
treeab0055c6eccdd5de2bfbeb47188e2e99b45ebd7b
parent678da9fbc2705ed29cd02731c3f404c879370fea (diff)
parent7575ebccf276ae6afdad7a0b589678cb59a1398e (diff)
downloadgoldfish-opengl-6a3aaa931ce4bff3b50d9e60a92837c325a63f77.tar.gz
Add feature flag for rcReadColorBufferDma am: 7575ebccf2
Original change: https://googleplex-android-review.googlesource.com/c/device/generic/goldfish-opengl/+/15474866 Change-Id: Iaa44fcc29de955f415c10abdae5056b5dd07b321
-rw-r--r--system/OpenglSystemCommon/EmulatorFeatureInfo.h7
-rw-r--r--system/OpenglSystemCommon/HostConnection.cpp8
-rw-r--r--system/OpenglSystemCommon/HostConnection.h1
3 files changed, 15 insertions, 1 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..6d087148 100644
--- a/system/OpenglSystemCommon/HostConnection.h
+++ b/system/OpenglSystemCommon/HostConnection.h
@@ -242,6 +242,7 @@ private:
void queryAndSetVulkanQueueSubmitWithCommandsSupport(ExtendedRCEncoderContext *rcEnc);
void queryAndSetVulkanBatchedDescriptorSetUpdateSupport(ExtendedRCEncoderContext *rcEnc);
void queryAndSetSyncBufferData(ExtendedRCEncoderContext *rcEnc);
+ void queryAndSetReadColorBufferDma(ExtendedRCEncoderContext *rcEnc);
GLint queryVersion(ExtendedRCEncoderContext* rcEnc);
private: