aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Hu <bohu@google.com>2021-05-12 18:24:19 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-05-12 18:24:19 +0000
commit980ea215e36aac0cda10dfa6e7adf2f1aac4f3cd (patch)
tree1707b4b0e66678c11e72c7c5e55708a05770fd6a
parent3d8edd862db86174ac0e06b3cce85b49d711ce4e (diff)
parentf3cfae6c8a3d9f43ddf0258029eb5366e2a788cb (diff)
downloadgoldfish-opengl-980ea215e36aac0cda10dfa6e7adf2f1aac4f3cd.tar.gz
Merge "c2-codecs: do not create host color buffer for cpu read write only usage"
-rw-r--r--system/hals/allocator3.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/system/hals/allocator3.cpp b/system/hals/allocator3.cpp
index c91bafd6..5c103a53 100644
--- a/system/hals/allocator3.cpp
+++ b/system/hals/allocator3.cpp
@@ -323,6 +323,12 @@ private:
return false;
}
+ // b/186585177
+ if ((usage & (BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK)) &&
+ (0 == (usage & ~(BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK)))) {
+ return false;
+ }
+
return ((usage & BufferUsage::GPU_DATA_BUFFER)
|| (format != PixelFormat::BLOB &&
format != PixelFormat::RAW16 &&