aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2021-08-05 19:48:49 -0700
committerLingfeng Yang <lfy@google.com>2021-08-06 11:25:07 -0700
commit7575ebccf276ae6afdad7a0b589678cb59a1398e (patch)
treeab0055c6eccdd5de2bfbeb47188e2e99b45ebd7b
parentf0d3efea3eb607b83268277c587879e821c80fc8 (diff)
downloadgoldfish-opengl-7575ebccf276ae6afdad7a0b589678cb59a1398e.tar.gz
Add feature flag for rcReadColorBufferDma
Bug: 189960317 Change-Id: Iad24faadf5487280eeac3f49f257474ce114cad0 Merged-In: Iad24faadf5487280eeac3f49f257474ce114cad0
-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: