1 // GENERATED FILE - DO NOT EDIT. 2 // Generated by gen_features.py using data from gl_features.json. 3 // 4 // Copyright 2022 The ANGLE Project Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style license that can be 6 // found in the LICENSE file. 7 // 8 // FeaturesGL.h: angle::Features and workarounds for GL driver bugs and other issues. 9 10 #ifndef ANGLE_PLATFORM_FEATURESGL_H_ 11 #define ANGLE_PLATFORM_FEATURESGL_H_ 12 13 #include "platform/Feature.h" 14 15 namespace angle 16 { 17 18 struct FeaturesGL : FeatureSetBase 19 { 20 FeaturesGL(); 21 ~FeaturesGL(); 22 23 FeatureInfo avoid1BitAlphaTextureFormats = { 24 "avoid1BitAlphaTextureFormats", 25 FeatureCategory::OpenGLWorkarounds, 26 "Issue with 1-bit alpha framebuffer formats", 27 &members, 28 }; 29 30 FeatureInfo RGBA4IsNotSupportedForColorRendering = { 31 "RGBA4IsNotSupportedForColorRendering", 32 FeatureCategory::OpenGLWorkarounds, 33 "GL_RGBA4 is not color renderable", 34 &members, 35 }; 36 37 FeatureInfo allowETCFormats = { 38 "allowETCFormats", 39 FeatureCategory::OpenGLWorkarounds, 40 "Enable ETC2/EAC on desktop OpenGL", 41 &members, 42 }; 43 44 FeatureInfo doesSRGBClearsOnLinearFramebufferAttachments = { 45 "doesSRGBClearsOnLinearFramebufferAttachments", 46 FeatureCategory::OpenGLWorkarounds, 47 "Issue clearing framebuffers with linear attachments when GL_FRAMEBUFFER_SRGB is enabled", 48 &members, 49 }; 50 51 FeatureInfo doWhileGLSLCausesGPUHang = { 52 "doWhileGLSLCausesGPUHang", FeatureCategory::OpenGLWorkarounds, 53 "Some GLSL constructs involving do-while loops cause GPU hangs", &members, 54 "http://crbug.com/644669"}; 55 56 FeatureInfo vertexIDDoesNotIncludeBaseVertex = { 57 "vertexIDDoesNotIncludeBaseVertex", 58 FeatureCategory::OpenGLWorkarounds, 59 "gl_VertexID in GLSL vertex shader doesn't include base vertex value", 60 &members, 61 }; 62 63 FeatureInfo finishDoesNotCauseQueriesToBeAvailable = { 64 "finishDoesNotCauseQueriesToBeAvailable", 65 FeatureCategory::OpenGLWorkarounds, 66 "glFinish doesn't cause all queries to report available result", 67 &members, 68 }; 69 70 FeatureInfo alwaysCallUseProgramAfterLink = { 71 "alwaysCallUseProgramAfterLink", FeatureCategory::OpenGLWorkarounds, 72 "Always call useProgram after a successful link to avoid a driver bug", &members, 73 "http://crbug.com/110263"}; 74 75 FeatureInfo unpackOverlappingRowsSeparatelyUnpackBuffer = { 76 "unpackOverlappingRowsSeparatelyUnpackBuffer", 77 FeatureCategory::OpenGLWorkarounds, 78 "In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row", 79 &members, 80 }; 81 82 FeatureInfo packOverlappingRowsSeparatelyPackBuffer = { 83 "packOverlappingRowsSeparatelyPackBuffer", 84 FeatureCategory::OpenGLWorkarounds, 85 "In the case of packing to a pixel pack buffer, pack overlapping rows row by row", 86 &members, 87 }; 88 89 FeatureInfo initializeCurrentVertexAttributes = { 90 "initializeCurrentVertexAttributes", 91 FeatureCategory::OpenGLWorkarounds, 92 "During initialization, assign the current vertex attributes to the spec-mandated defaults", 93 &members, 94 }; 95 96 FeatureInfo emulateAbsIntFunction = {"emulateAbsIntFunction", 97 FeatureCategory::OpenGLWorkarounds, 98 "abs(i) where i is an integer returns unexpected result", 99 &members, "http://crbug.com/642227"}; 100 101 FeatureInfo addAndTrueToLoopCondition = { 102 "addAndTrueToLoopCondition", 103 FeatureCategory::OpenGLWorkarounds, 104 "Calculation of loop conditions in for and while loop has bug", 105 &members, 106 }; 107 108 FeatureInfo unpackLastRowSeparatelyForPaddingInclusion = { 109 "unpackLastRowSeparatelyForPaddingInclusion", FeatureCategory::OpenGLWorkarounds, 110 "When uploading textures from an unpack buffer, some drivers count an extra row padding", 111 &members, "http://anglebug.com/1512"}; 112 113 FeatureInfo packLastRowSeparatelyForPaddingInclusion = { 114 "packLastRowSeparatelyForPaddingInclusion", FeatureCategory::OpenGLWorkarounds, 115 "When uploading textures from an pack buffer, some drivers count an extra row padding", 116 &members, "http://anglebug.com/1512"}; 117 118 FeatureInfo emulateIsnanFloat = {"emulateIsnanFloat", FeatureCategory::OpenGLWorkarounds, 119 "Using isnan() on highp float will get wrong answer", &members, 120 "http://crbug.com/650547"}; 121 122 FeatureInfo useUnusedBlocksWithStandardOrSharedLayout = { 123 "useUnusedBlocksWithStandardOrSharedLayout", 124 FeatureCategory::OpenGLWorkarounds, 125 "Unused std140 or shared uniform blocks will be treated as inactive", 126 &members, 127 }; 128 129 FeatureInfo removeInvariantAndCentroidForESSL3 = { 130 "removeInvariantAndCentroidForESSL3", 131 FeatureCategory::OpenGLWorkarounds, 132 "Fix spec difference between GLSL 4.1 or lower and ESSL3", 133 &members, 134 }; 135 136 FeatureInfo rewriteFloatUnaryMinusOperator = { 137 "rewriteFloatUnaryMinusOperator", FeatureCategory::OpenGLWorkarounds, 138 "Using '-<float>' will get wrong answer", &members, "http://crbug.com/308366"}; 139 140 FeatureInfo emulateAtan2Float = {"emulateAtan2Float", FeatureCategory::OpenGLWorkarounds, 141 "atan(y, x) may return a wrong answer", &members, 142 "http://crbug.com/672380"}; 143 144 FeatureInfo reapplyUBOBindingsAfterUsingBinaryProgram = { 145 "reapplyUBOBindingsAfterUsingBinaryProgram", FeatureCategory::OpenGLWorkarounds, 146 "Some drivers forget about UBO bindings when using program binaries", &members, 147 "http://anglebug.com/1637"}; 148 149 FeatureInfo emulateMaxVertexAttribStride = { 150 "emulateMaxVertexAttribStride", FeatureCategory::OpenGLWorkarounds, 151 "Some drivers return 0 when MAX_VERTEX_ATTRIB_STRIED queried", &members, 152 "http://anglebug.com/1936"}; 153 154 FeatureInfo dontInitializeUninitializedLocals = { 155 "dontInitializeUninitializedLocals", FeatureCategory::OpenGLWorkarounds, 156 "Initializing uninitialized locals caused odd behavior in a few WebGL 2 tests", &members, 157 "http://anglebug.com/2046"}; 158 159 FeatureInfo clampPointSize = { 160 "clampPointSize", 161 FeatureCategory::OpenGLWorkarounds, 162 "The point size range reported from the API is inconsistent with the actual behavior", 163 &members, 164 }; 165 166 FeatureInfo dontUseLoopsToInitializeVariables = { 167 "dontUseLoopsToInitializeVariables", FeatureCategory::OpenGLWorkarounds, 168 "For loops used to initialize variables hit native GLSL compiler bugs", &members, 169 "http://crbug.com/809422"}; 170 171 FeatureInfo clampFragDepth = { 172 "clampFragDepth", 173 FeatureCategory::OpenGLWorkarounds, 174 "gl_FragDepth is not clamped correctly when rendering to a floating point depth buffer", 175 &members, 176 }; 177 178 FeatureInfo rewriteRepeatedAssignToSwizzled = { 179 "rewriteRepeatedAssignToSwizzled", 180 FeatureCategory::OpenGLWorkarounds, 181 "Repeated assignment to swizzled values inside a " 182 "GLSL user-defined function have incorrect results", 183 &members, 184 }; 185 186 FeatureInfo disableBlendFuncExtended = { 187 "disableBlendFuncExtended", FeatureCategory::OpenGLWorkarounds, 188 "ARB_blend_func_extended does not pass the tests", &members, "http://anglebug.com/1085"}; 189 190 FeatureInfo unsizedSRGBReadPixelsDoesntTransform = { 191 "unsizedSRGBReadPixelsDoesntTransform", FeatureCategory::OpenGLWorkarounds, 192 "Drivers returning raw sRGB values instead of linearized values when calling glReadPixels " 193 "on unsized sRGB texture formats", 194 &members, "http://crbug.com/550292 http://crbug.com/565179"}; 195 196 FeatureInfo queryCounterBitsGeneratesErrors = { 197 "queryCounterBitsGeneratesErrors", FeatureCategory::OpenGLWorkarounds, 198 "Drivers generate errors when querying the number of bits in timer queries", &members, 199 "http://anglebug.com/3027"}; 200 201 FeatureInfo dontRelinkProgramsInParallel = { 202 "dontRelinkProgramsInParallel", FeatureCategory::OpenGLWorkarounds, 203 "Relinking a program in parallel is buggy", &members, "http://anglebug.com/3045"}; 204 205 FeatureInfo disableWorkerContexts = {"disableWorkerContexts", 206 FeatureCategory::OpenGLWorkarounds, 207 "Some tests have been seen to fail using worker contexts", 208 &members, "http://crbug.com/849576"}; 209 210 FeatureInfo limitMaxTextureSizeTo4096 = {"limitMaxTextureSizeTo4096", 211 FeatureCategory::OpenGLWorkarounds, 212 "Limit max texture size to 4096 to avoid frequent " 213 "out-of-memory errors", 214 &members, "http://crbug.com/927470"}; 215 216 FeatureInfo limitMaxMSAASamplesTo4 = { 217 "limitMaxMSAASamplesTo4", FeatureCategory::OpenGLWorkarounds, 218 "Various rendering bugs have been observed when using higher MSAA counts", &members, 219 "http://crbug.com/797243"}; 220 221 FeatureInfo allowClearForRobustResourceInit = { 222 "allowClearForRobustResourceInit", FeatureCategory::OpenGLWorkarounds, 223 "Using glClear for robust resource initialization is buggy on some drivers and leads to " 224 "texture corruption. Default to data uploads except on MacOS where it is very slow.", 225 &members, "https://crbug.com/848952 http://crbug.com/883276"}; 226 227 FeatureInfo clampArrayAccess = {"clampArrayAccess", FeatureCategory::OpenGLWorkarounds, 228 "Clamp uniform array access to avoid reading invalid memory.", 229 &members, "http://anglebug.com/2978"}; 230 231 FeatureInfo resetTexImage2DBaseLevel = { 232 "resetTexImage2DBaseLevel", FeatureCategory::OpenGLWorkarounds, 233 "Reset texture base level before calling glTexImage2D to " 234 "work around pixel comparison failure.", 235 &members, "https://crbug.com/705865"}; 236 237 FeatureInfo clearToZeroOrOneBroken = { 238 "clearToZeroOrOneBroken", FeatureCategory::OpenGLWorkarounds, 239 "Clears when the clear color is all zeros or ones do not work.", &members, 240 "https://crbug.com/710443"}; 241 242 FeatureInfo limitMax3dArrayTextureSizeTo1024 = { 243 "limitMax3dArrayTextureSizeTo1024", FeatureCategory::OpenGLWorkarounds, 244 "Limit max 3d texture size and max array texture layers to 1024 to avoid system hang", 245 &members, "http://crbug.com/927470"}; 246 247 FeatureInfo adjustSrcDstRegionForBlitFramebuffer = { 248 "adjustSrcDstRegionForBlitFramebuffer", FeatureCategory::OpenGLWorkarounds, 249 "Many platforms have issues with blitFramebuffer when the parameters are large.", &members, 250 "http://crbug.com/830046"}; 251 252 FeatureInfo clipSrcRegionForBlitFramebuffer = { 253 "clipSrcRegionForBlitFramebuffer", FeatureCategory::OpenGLWorkarounds, 254 "Issues with blitFramebuffer when the parameters don't match the framebuffer size.", 255 &members, "http://crbug.com/830046"}; 256 257 FeatureInfo RGBDXT1TexturesSampleZeroAlpha = { 258 "RGBDXT1TexturesSampleZeroAlpha", FeatureCategory::OpenGLWorkarounds, 259 "Sampling BLACK texels from RGB DXT1 textures returns transparent black on Mac.", &members, 260 "http://anglebug.com/3729"}; 261 262 FeatureInfo unfoldShortCircuits = { 263 "unfoldShortCircuits", FeatureCategory::OpenGLWorkarounds, 264 "Mac incorrectly executes both sides of && and || expressions when they should " 265 "short-circuit.", 266 &members, "http://anglebug.com/482"}; 267 268 FeatureInfo emulatePrimitiveRestartFixedIndex = { 269 "emulatePrimitiveRestartFixedIndex", FeatureCategory::OpenGLWorkarounds, 270 "When GL_PRIMITIVE_RESTART_FIXED_INDEX is not available, emulate it with " 271 "GL_PRIMITIVE_RESTART and glPrimitiveRestartIndex.", 272 &members, "http://anglebug.com/3997"}; 273 274 FeatureInfo setPrimitiveRestartFixedIndexForDrawArrays = { 275 "setPrimitiveRestartFixedIndexForDrawArrays", FeatureCategory::OpenGLWorkarounds, 276 "Some drivers discard vertex data in DrawArrays calls when the fixed primitive restart " 277 "index is within the number of primitives being drawn.", 278 &members, "http://anglebug.com/3997"}; 279 280 FeatureInfo removeDynamicIndexingOfSwizzledVector = { 281 "removeDynamicIndexingOfSwizzledVector", FeatureCategory::OpenGLWorkarounds, 282 "Dynamic indexing of swizzled l-values doesn't work correctly on various platforms.", 283 &members, "http://crbug.com/709351"}; 284 285 FeatureInfo preAddTexelFetchOffsets = { 286 "preAddTexelFetchOffsets", FeatureCategory::OpenGLWorkarounds, 287 "Intel Mac drivers mistakenly consider the parameter position of nagative vaule as invalid " 288 "even if the sum of position and offset is in range, so we need to add workarounds by " 289 "rewriting texelFetchOffset(sampler, position, lod, offset) into texelFetch(sampler, " 290 "position + offset, lod).", 291 &members, "http://crbug.com/642605"}; 292 293 FeatureInfo regenerateStructNames = { 294 "regenerateStructNames", FeatureCategory::OpenGLWorkarounds, 295 "All Mac drivers do not handle struct scopes correctly. This workaround overwrites a struct" 296 "name with a unique prefix.", 297 &members, "http://crbug.com/403957"}; 298 299 FeatureInfo readPixelsUsingImplementationColorReadFormatForNorm16 = { 300 "readPixelsUsingImplementationColorReadFormatForNorm16", FeatureCategory::OpenGLWorkarounds, 301 "Quite some OpenGL ES drivers don't implement readPixels for RGBA/UNSIGNED_SHORT from " 302 "EXT_texture_norm16 correctly", 303 &members, "http://anglebug.com/4214"}; 304 305 FeatureInfo flushBeforeDeleteTextureIfCopiedTo = { 306 "flushBeforeDeleteTextureIfCopiedTo", FeatureCategory::OpenGLWorkarounds, 307 "Some drivers track CopyTex{Sub}Image texture dependencies incorrectly. Flush" 308 " before glDeleteTextures in this case", 309 &members, "http://anglebug.com/4267"}; 310 311 FeatureInfo rewriteRowMajorMatrices = { 312 "rewriteRowMajorMatrices", FeatureCategory::OpenGLWorkarounds, 313 "Rewrite row major matrices in shaders as column major as a driver bug workaround", 314 &members, "http://anglebug.com/2273"}; 315 316 FeatureInfo disableDrawBuffersIndexed = { 317 "disableDrawBuffersIndexed", 318 FeatureCategory::OpenGLWorkarounds, 319 "Disable OES_draw_buffers_indexed extension.", 320 &members, 321 }; 322 323 FeatureInfo disableSemaphoreFd = {"disableSemaphoreFd", FeatureCategory::OpenGLWorkarounds, 324 "Disable GL_EXT_semaphore_fd extension", &members, 325 "https://crbug.com/1046462"}; 326 327 FeatureInfo disableTimestampQueries = { 328 "disableTimestampQueries", FeatureCategory::OpenGLWorkarounds, 329 "Disable GL_EXT_disjoint_timer_query extension", &members, "https://crbug.com/811661"}; 330 331 FeatureInfo decodeEncodeSRGBForGenerateMipmap = { 332 "decodeEncodeSRGBForGenerateMipmap", FeatureCategory::OpenGLWorkarounds, 333 "Decode and encode before generateMipmap for srgb format textures.", &members, 334 "http://anglebug.com/4646"}; 335 336 FeatureInfo emulateCopyTexImage2DFromRenderbuffers = { 337 "emulateCopyTexImage2DFromRenderbuffers", FeatureCategory::OpenGLWorkarounds, 338 "CopyTexImage2D spuriously returns errors on iOS when copying from renderbuffers.", 339 &members, "https://anglebug.com/4674"}; 340 341 FeatureInfo disableGPUSwitchingSupport = { 342 "disableGPUSwitchingSupport", FeatureCategory::OpenGLWorkarounds, 343 "Disable GPU switching support (use only the low-power GPU) on older MacBook Pros.", 344 &members, "https://crbug.com/1091824"}; 345 346 FeatureInfo disableNativeParallelCompile = { 347 "disableNativeParallelCompile", FeatureCategory::OpenGLWorkarounds, 348 "Do not use native KHR_parallel_shader_compile even when available.", &members, 349 "http://crbug.com/1094869"}; 350 351 FeatureInfo emulatePackSkipRowsAndPackSkipPixels = { 352 "emulatePackSkipRowsAndPackSkipPixels", FeatureCategory::OpenGLWorkarounds, 353 "GL_PACK_SKIP_ROWS and GL_PACK_SKIP_PIXELS are ignored in Apple's OpenGL driver.", &members, 354 "https://anglebug.com/4849"}; 355 356 FeatureInfo clampMscRate = { 357 "clampMscRate", FeatureCategory::OpenGLWorkarounds, 358 "Some drivers return bogus values for GetMscRate, so we clamp it to 30Hz", &members, 359 "https://crbug.com/1042393"}; 360 361 FeatureInfo bindTransformFeedbackBufferBeforeBindBufferRange = { 362 "bindTransformFeedbackBufferBeforeBindBufferRange", FeatureCategory::OpenGLWorkarounds, 363 "Bind transform feedback buffers to the generic binding point before calling " 364 "glBindBufferBase or glBindBufferRange.", 365 &members, "https://anglebug.com/5140"}; 366 367 FeatureInfo disableSyncControlSupport = { 368 "disableSyncControlSupport", FeatureCategory::OpenGLWorkarounds, 369 "Speculative fix for issues on Linux/Wayland where exposing GLX_OML_sync_control renders " 370 "Chrome unusable", 371 &members, "https://crbug.com/1137851"}; 372 373 FeatureInfo keepBufferShadowCopy = { 374 "keepBufferShadowCopy", 375 FeatureCategory::OpenGLWorkarounds, 376 "Maintain a shadow copy of buffer data when the GL API does not permit reading data back.", 377 &members, 378 }; 379 380 FeatureInfo setZeroLevelBeforeGenerateMipmap = { 381 "setZeroLevelBeforeGenerateMipmap", 382 FeatureCategory::OpenGLWorkarounds, 383 "glGenerateMipmap fails if the zero texture level is not set on some Mac drivers.", 384 &members, 385 }; 386 387 FeatureInfo promotePackedFormatsTo8BitPerChannel = { 388 "promotePackedFormatsTo8BitPerChannel", FeatureCategory::OpenGLWorkarounds, 389 "Packed color formats are buggy on Macs with AMD GPUs", &members, 390 "http://anglebug.com/5469"}; 391 392 FeatureInfo initFragmentOutputVariables = { 393 "initFragmentOutputVariables", FeatureCategory::OpenGLWorkarounds, 394 "No init gl_FragColor causes context lost", &members, "http://crbug.com/1171371"}; 395 396 FeatureInfo shiftInstancedArrayDataWithOffset = { 397 "shiftInstancedArrayDataWithOffset", FeatureCategory::OpenGLWorkarounds, 398 "glDrawArraysInstanced is buggy on certain new Mac Intel GPUs", &members, 399 "http://crbug.com/1144207"}; 400 401 FeatureInfo syncVertexArraysToDefault = { 402 "syncVertexArraysToDefault", FeatureCategory::OpenGLWorkarounds, 403 "Only use the default VAO because of missing support or driver bugs", &members, 404 "http://anglebug.com/5577"}; 405 406 FeatureInfo sanitizeAMDGPURendererString = { 407 "sanitizeAMDGPURendererString", FeatureCategory::OpenGLWorkarounds, 408 "Strip precise kernel and DRM version information from amdgpu renderer strings.", &members, 409 "http://crbug.com/1181193"}; 410 411 FeatureInfo unbindFBOBeforeSwitchingContext = { 412 "unbindFBOBeforeSwitchingContext", FeatureCategory::OpenGLWorkarounds, 413 "Imagination GL drivers are buggy with context switching.", &members, 414 "http://crbug.com/1181193"}; 415 416 FeatureInfo flushOnFramebufferChange = {"flushOnFramebufferChange", 417 FeatureCategory::OpenGLWorkarounds, 418 "Switching framebuffers without a flush can lead to " 419 "crashes on Intel 9th Generation GPU Macs.", 420 &members, "http://crbug.com/1181068"}; 421 422 FeatureInfo disableMultisampledRenderToTexture = { 423 "disableMultisampledRenderToTexture", FeatureCategory::OpenGLWorkarounds, 424 "Many drivers have bugs when using GL_EXT_multisampled_render_to_texture", &members, 425 "http://anglebug.com/2894"}; 426 427 FeatureInfo uploadTextureDataInChunks = { 428 "uploadTextureDataInChunks", FeatureCategory::OpenGLWorkarounds, 429 "Upload texture data in <120kb chunks to work around Mac driver hangs and crashes.", 430 &members, "http://crbug.com/1181068"}; 431 432 FeatureInfo emulateImmutableCompressedTexture3D = { 433 "emulateImmutableCompressedTexture3D", FeatureCategory::OpenGLWorkarounds, 434 "Use non-immutable texture allocation to work around a driver bug.", &members, 435 "https://crbug.com/1060012"}; 436 437 FeatureInfo emulateRGB10 = {"emulateRGB10", FeatureCategory::OpenGLWorkarounds, 438 "Emulate RGB10 support using RGB10_A2.", &members, 439 "https://crbug.com/1300575"}; 440 441 FeatureInfo alwaysUnbindFramebufferTexture2D = { 442 "alwaysUnbindFramebufferTexture2D", FeatureCategory::OpenGLWorkarounds, 443 "Force unbind framebufferTexture2D before binding renderbuffer to work around driver bug.", 444 &members, "https://anglebug.com/5536"}; 445 }; 446 447 inline FeaturesGL::FeaturesGL() = default; 448 inline FeaturesGL::~FeaturesGL() = default; 449 450 } // namespace angle 451 452 #endif // ANGLE_PLATFORM_FEATURESGL_H_ 453