Add GLES specific setting for layers
This allows loading layers for GLES and Vulkan at the
same time by adding a GLES specific setting:
GPU_DEBUG_LAYERS_GLES
which mirrors the existing setting:
GPU_DEBUG_LAYERS
The Vulkan and GLES loaders now scan distinct layer
lists, correcting an issue that would prevent Vulkan
from loading when it failed to find GLES layers.
Bug: 110883880
Test: Load a GLES layer when running ANGLE with Vulkan backend
Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Change-Id: I9902fe7921a171cd779fd7dd957dd51e00b4ef02
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index 8661401..97b4828 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -153,10 +153,18 @@
return mDebugLayers;
}
+const std::string& GraphicsEnv::getDebugLayersGLES() {
+ return mDebugLayersGLES;
+}
+
void GraphicsEnv::setDebugLayers(const std::string layers) {
mDebugLayers = layers;
}
+void GraphicsEnv::setDebugLayersGLES(const std::string layers) {
+ mDebugLayersGLES = layers;
+}
+
android_namespace_t* GraphicsEnv::getDriverNamespace() {
static std::once_flag once;
std::call_once(once, [this]() {
diff --git a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
index 10c2549..528c260 100644
--- a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
+++ b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
@@ -61,7 +61,9 @@
const std::string& getLayerPaths();
void setDebugLayers(const std::string layers);
+ void setDebugLayersGLES(const std::string layers);
const std::string& getDebugLayers();
+ const std::string& getDebugLayersGLES();
private:
GraphicsEnv() = default;
@@ -74,6 +76,7 @@
long mAngleRulesOffset;
long mAngleRulesLength;
std::string mDebugLayers;
+ std::string mDebugLayersGLES;
std::string mLayerPaths;
android_namespace_t* mDriverNamespace = nullptr;
android_namespace_t* mAngleNamespace = nullptr;
diff --git a/opengl/libs/EGL/egl_layers.cpp b/opengl/libs/EGL/egl_layers.cpp
index e4906e0..dd8fbfc 100644
--- a/opengl/libs/EGL/egl_layers.cpp
+++ b/opengl/libs/EGL/egl_layers.cpp
@@ -144,8 +144,8 @@
std::string LayerLoader::GetDebugLayers() {
// Layers can be specified at the Java level in GraphicsEnvironemnt
- // gpu_debug_layers = layer1:layer2:layerN
- std::string debug_layers = android::GraphicsEnv::getInstance().getDebugLayers();
+ // gpu_debug_layers_gles = layer1:layer2:layerN
+ std::string debug_layers = android::GraphicsEnv::getInstance().getDebugLayersGLES();
if (debug_layers.empty()) {
// Only check system properties if Java settings are empty