1 // 2 // Copyright 2016 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // FrontendFeatures.h: Features/workarounds for driver bugs and other behaviors seen 8 // on all platforms. 9 10 #ifndef ANGLE_PLATFORM_FRONTENDFEATURES_H_ 11 #define ANGLE_PLATFORM_FRONTENDFEATURES_H_ 12 13 #include "platform/Feature.h" 14 15 namespace angle 16 { 17 18 struct FrontendFeatures : angle::FeatureSetBase 19 { 20 FrontendFeatures(); 21 ~FrontendFeatures(); 22 23 // Force the context to be lost (via KHR_robustness) if a GL_OUT_OF_MEMORY error occurs. The 24 // driver may be in an inconsistent state if this happens, and some users of ANGLE rely on this 25 // notification to prevent further execution. 26 angle::Feature loseContextOnOutOfMemory = { 27 "lose_context_on_out_of_memory", angle::FeatureCategory::FrontendWorkarounds, 28 "Some users rely on a lost context notification if a GL_OUT_OF_MEMORY " 29 "error occurs", 30 &members}; 31 32 // Program binaries don't contain transform feedback varyings on Qualcomm GPUs. 33 // Work around this by disabling the program cache for programs with transform feedback. 34 angle::Feature disableProgramCachingForTransformFeedback = { 35 "disable_program_caching_for_transform_feedback", 36 angle::FeatureCategory::FrontendWorkarounds, 37 "On some GPUs, program binaries don't contain transform feedback varyings", &members}; 38 39 angle::Feature scalarizeVecAndMatConstructorArgs = { 40 "scalarize_vec_and_mat_constructor_args", angle::FeatureCategory::FrontendWorkarounds, 41 "Always rewrite vec/mat constructors to be consistent", &members, 42 "http://crbug.com/1165751"}; 43 44 // Disable support for GL_OES_get_program_binary 45 angle::Feature disableProgramBinary = { 46 "disable_program_binary", angle::FeatureCategory::FrontendFeatures, 47 "Disable support for GL_OES_get_program_binary", &members, "http://anglebug.com/5007"}; 48 49 // Allow disabling of GL_EXT_texture_filter_anisotropic through a runtime feature for 50 // performance comparisons. 51 angle::Feature disableAnisotropicFiltering = { 52 "disable_anisotropic_filtering", angle::FeatureCategory::FrontendWorkarounds, 53 "Disable support for anisotropic filtering", &members}; 54 55 // We can use this feature to override compressed format support for portability. 56 angle::Feature allowCompressedFormats = {"allow_compressed_formats", 57 angle::FeatureCategory::FrontendWorkarounds, 58 "Allow compressed formats", &members}; 59 60 angle::Feature captureLimits = {"enable_capture_limits", 61 angle::FeatureCategory::FrontendFeatures, 62 "Set the context limits like frame capturing was enabled", 63 &members, "http://anglebug.com/5750"}; 64 65 // Whether we should compress pipeline cache in thread pool before it's stored in blob cache. 66 // http://anglebug.com/4722 67 angle::Feature enableCompressingPipelineCacheInThreadPool = { 68 "enableCompressingPipelineCacheInThreadPool", angle::FeatureCategory::FrontendWorkarounds, 69 "Enable compressing pipeline cache in thread pool.", &members, "http://anglebug.com/4722"}; 70 71 // Forces on robust resource init. Useful for some tests to avoid undefined values. 72 angle::Feature forceRobustResourceInit = { 73 "forceRobustResourceInit", angle::FeatureCategory::FrontendFeatures, 74 "Force-enable robust resource init", &members, "http://anglebug.com/6041"}; 75 76 // Forces on shader variable init to avoid undefined values in tests. This feature is enabled 77 // for WebGL and frame capture, which both require deterministic results. 78 angle::Feature forceInitShaderVariables = { 79 "forceInitShaderVariables", angle::FeatureCategory::FrontendFeatures, 80 "Force-enable shader variable initialization", &members}; 81 82 angle::Feature enableProgramBinaryForCapture = { 83 "enableProgramBinaryForCapture", angle::FeatureCategory::FrontendFeatures, 84 "Even if FrameCapture is enabled, enable GL_OES_get_program_binary", &members, 85 "http://anglebug.com/5658"}; 86 }; 87 88 inline FrontendFeatures::FrontendFeatures() = default; 89 inline FrontendFeatures::~FrontendFeatures() = default; 90 91 } // namespace angle 92 93 #endif // ANGLE_PLATFORM_FRONTENDFEATURES_H_ 94