Hash :
ffd6ec26
Author :
Date :
2023-09-07T15:39:19
Reland "Make egl surface uncurrent when being destroyed" This relands commit 497440cdcb7d2ee59bca612dd07fc13cf09a6a57. This is to workaround errors when app does below behaviors: 1) while there is a context still bound to the current rendering thread and the surface, call eglDestroySurface() 2) create a new surface eglCreateWindowSurface() 3) call eglMakeCurrent() with the surface created in step 2) 4) does work on the new surface The old surface won't be destroyed in step 1) because it was still bound by the context of the current rendering thread. When creating new surface on step 2), some hardware will return error code EGL_BAD_ALLOC, because the old egl surface is still associated with the native window. To workaround, when destroying surface, if the surface is still bound by the context of the current rendering thread, release the context and surface by passing EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). The workaround is controlled by a frontend feature uncurrentEglSurfaceUponSurfaceDestroy. This feature is only enabled on vulkan backends. Bug: b/292285899 Change-Id: Id4c47f1b20e0f90d1013a68893fd70e917c030e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4867066 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_features.py using data from frontend_features.json.
//
// Copyright 2022 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// FrontendFeatures_autogen.h: Features/workarounds for driver bugs and other behaviors seen
// on all platforms.
#ifndef ANGLE_PLATFORM_AUTOGEN_FRONTENDFEATURES_H_
#define ANGLE_PLATFORM_AUTOGEN_FRONTENDFEATURES_H_
#include "platform/Feature.h"
namespace angle
{
struct FrontendFeatures : FeatureSetBase
{
FrontendFeatures();
~FrontendFeatures();
FeatureInfo loseContextOnOutOfMemory = {
"loseContextOnOutOfMemory",
FeatureCategory::FrontendWorkarounds,
"Some users rely on a lost context notification if a GL_OUT_OF_MEMORY error occurs",
&members,
};
FeatureInfo disableProgramCachingForTransformFeedback = {
"disableProgramCachingForTransformFeedback",
FeatureCategory::FrontendWorkarounds,
"On some GPUs, program binaries don't contain transform feedback varyings",
&members,
};
FeatureInfo disableProgramBinary = {
"disableProgramBinary",
FeatureCategory::FrontendFeatures,
"Disable support for GL_OES_get_program_binary",
&members, "http://anglebug.com/5007"
};
FeatureInfo disableDrawBuffersIndexed = {
"disableDrawBuffersIndexed",
FeatureCategory::FrontendFeatures,
"Disable support for OES_draw_buffers_indexed and EXT_draw_buffers_indexed",
&members, "http://anglebug.com/7724"
};
FeatureInfo disableAnisotropicFiltering = {
"disableAnisotropicFiltering",
FeatureCategory::FrontendWorkarounds,
"Disable support for anisotropic filtering",
&members,
};
FeatureInfo allowCompressedFormats = {
"allowCompressedFormats",
FeatureCategory::FrontendWorkarounds,
"Allow compressed formats",
&members,
};
FeatureInfo singleThreadedTextureDecompression = {
"singleThreadedTextureDecompression",
FeatureCategory::FrontendWorkarounds,
"Disables multi-threaded decompression of compressed texture formats",
&members,
};
FeatureInfo forceDepthAttachmentInitOnClear = {
"forceDepthAttachmentInitOnClear",
FeatureCategory::FrontendWorkarounds,
"Force depth attachment initialization on clear ops",
&members, "https://anglebug.com/7246"
};
FeatureInfo enableCaptureLimits = {
"enableCaptureLimits",
FeatureCategory::FrontendFeatures,
"Set the context limits like frame capturing was enabled",
&members, "http://anglebug.com/5750"
};
FeatureInfo forceRobustResourceInit = {
"forceRobustResourceInit",
FeatureCategory::FrontendFeatures,
"Force-enable robust resource init",
&members, "http://anglebug.com/6041"
};
FeatureInfo forceInitShaderVariables = {
"forceInitShaderVariables",
FeatureCategory::FrontendFeatures,
"Force-enable shader variable initialization",
&members,
};
FeatureInfo enableProgramBinaryForCapture = {
"enableProgramBinaryForCapture",
FeatureCategory::FrontendFeatures,
"Even if FrameCapture is enabled, enable GL_OES_get_program_binary",
&members, "http://anglebug.com/5658"
};
FeatureInfo forceGlErrorChecking = {
"forceGlErrorChecking",
FeatureCategory::FrontendFeatures,
"Force GL error checking (i.e. prevent applications from disabling error checking",
&members, "https://issuetracker.google.com/220069903"
};
FeatureInfo emulatePixelLocalStorage = {
"emulatePixelLocalStorage",
FeatureCategory::FrontendFeatures,
"Emulate ANGLE_shader_pixel_local_storage using shader images",
&members, "http://anglebug.com/7279"
};
FeatureInfo cacheCompiledShader = {
"cacheCompiledShader",
FeatureCategory::FrontendFeatures,
"Enable to cache compiled shaders",
&members, "http://anglebug.com/7036"
};
FeatureInfo dumpShaderSource = {
"dumpShaderSource",
FeatureCategory::FrontendFeatures,
"Write shader source to temp directory",
&members, "http://anglebug.com/7760"
};
FeatureInfo enableShaderSubstitution = {
"enableShaderSubstitution",
FeatureCategory::FrontendWorkarounds,
"Check the filesystem for shaders to use instead of those provided through glShaderSource",
&members, "http://anglebug.com/7761"
};
FeatureInfo disableProgramCaching = {
"disableProgramCaching",
FeatureCategory::FrontendFeatures,
"Disables saving programs to the cache",
&members, "http://anglebug.com/1423136"
};
FeatureInfo dumpTranslatedShaders = {
"dumpTranslatedShaders",
FeatureCategory::FrontendFeatures,
"Write translated shaders to temp directory",
&members, "http://anglebug.com/8280"
};
FeatureInfo enableTranslatedShaderSubstitution = {
"enableTranslatedShaderSubstitution",
FeatureCategory::FrontendWorkarounds,
"Check the filesystem for translated shaders to use instead of the shader translator's",
&members, "http://anglebug.com/8280"
};
FeatureInfo linkJobIsNotThreadSafe = {
"linkJobIsNotThreadSafe",
FeatureCategory::FrontendWorkarounds,
"If true, parts of the link job cannot be parallelized",
&members, "http://anglebug.com/8297"
};
FeatureInfo uncurrentEglSurfaceUponSurfaceDestroy = {
"uncurrentEglSurfaceUponSurfaceDestroy",
FeatureCategory::FrontendWorkarounds,
"Make egl surface uncurrent when calling eglDestroySurface(), if the surface is still bound by the context of current render thread",
&members, "https://issuetracker.google.com/292285899"
};
};
inline FrontendFeatures::FrontendFeatures() = default;
inline FrontendFeatures::~FrontendFeatures() = default;
} // namespace angle
#endif // ANGLE_PLATFORM_AUTOGEN_FRONTENDFEATURES_H_