Commit 7dd03446 by Jonah Ryan-Davis Committed by Commit Bot

Ensure Features* descriptions stay up to date

Created a macro to help keep Features' descriptions up to date. This will avoid confusion in the future when conditions change. Also update all descriptions to match current state. Bug: angleproject:3947 Change-Id: Ifc65e7789c916fab79f1323798dfb59d7a4efad2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829584 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 514d5e28
...@@ -74,6 +74,7 @@ New Tokens ...@@ -74,6 +74,7 @@ New Tokens
EGL_FEATURE_DESCRIPTION_ANGLE 0x3462 EGL_FEATURE_DESCRIPTION_ANGLE 0x3462
EGL_FEATURE_BUG_ANGLE 0x3463 EGL_FEATURE_BUG_ANGLE 0x3463
EGL_FEATURE_STATUS_ANGLE 0x3464 EGL_FEATURE_STATUS_ANGLE 0x3464
EGL_FEATURE_CONDITION_ANGLE 0x3468
Accepted as a queried <attribute> in eglQueryDisplayAttribANGLE Accepted as a queried <attribute> in eglQueryDisplayAttribANGLE
...@@ -122,6 +123,9 @@ Add the following to the end of section 3.3 "EGL Queries": ...@@ -122,6 +123,9 @@ Add the following to the end of section 3.3 "EGL Queries":
with corresponding indices to the array of names. Each string has with corresponding indices to the array of names. Each string has
the value "enabled" if the feature is currently enabled, or the value "enabled" if the feature is currently enabled, or
"disabled" if the feature is currently disabled. "disabled" if the feature is currently disabled.
The EGL_FEATURE_CONDITION_ANGLE array contains strings that
describe to the condition that sets the corresponding value in
the EGL_FEATURE_STATUS_ANGLE array.
Errors Errors
......
...@@ -224,6 +224,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy, ...@@ -224,6 +224,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
#define EGL_FEATURE_COUNT_ANGLE 0x3465 #define EGL_FEATURE_COUNT_ANGLE 0x3465
#define EGL_FEATURE_OVERRIDES_ENABLED_ANGLE 0x3466 #define EGL_FEATURE_OVERRIDES_ENABLED_ANGLE 0x3466
#define EGL_FEATURE_OVERRIDES_DISABLED_ANGLE 0x3467 #define EGL_FEATURE_OVERRIDES_DISABLED_ANGLE 0x3467
#define EGL_FEATURE_CONDITION_ANGLE 0x3468
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index); typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#define ANGLE_FEATURE_CONDITION(set, feature, cond) \
set->feature.enabled = cond; \
set->feature.condition = ANGLE_STRINGIFY(cond);
namespace angle namespace angle
{ {
...@@ -110,6 +114,9 @@ struct Feature ...@@ -110,6 +114,9 @@ struct Feature
// Whether the workaround is enabled or not. Determined by heuristics like vendor ID and // Whether the workaround is enabled or not. Determined by heuristics like vendor ID and
// version, but may be overriden to any value. // version, but may be overriden to any value.
bool enabled = false; bool enabled = false;
// A stingified version of the condition used to set 'enabled'. ie "IsNvidia() && IsApple()"
const char *condition;
}; };
inline Feature::Feature(const Feature &other) = default; inline Feature::Feature(const Feature &other) = default;
...@@ -118,7 +125,12 @@ inline Feature::Feature(const char *name, ...@@ -118,7 +125,12 @@ inline Feature::Feature(const char *name,
const char *description, const char *description,
FeatureMap *const mapPtr, FeatureMap *const mapPtr,
const char *bug = "") const char *bug = "")
: name(name), category(category), description(description), bug(bug), enabled(false) : name(name),
category(category),
description(description),
bug(bug),
enabled(false),
condition(nullptr)
{ {
if (mapPtr != nullptr) if (mapPtr != nullptr)
{ {
......
...@@ -35,9 +35,9 @@ struct FeaturesD3D : FeatureSetBase ...@@ -35,9 +35,9 @@ struct FeaturesD3D : FeatureSetBase
// We can fix this by optimizing those out of the shader. At the same time, we can // We can fix this by optimizing those out of the shader. At the same time, we can
// work around a bug on some nVidia drivers that they ignore "null" render targets // work around a bug on some nVidia drivers that they ignore "null" render targets
// in D3D11, by compacting the active color attachments list to omit null entries. // in D3D11, by compacting the active color attachments list to omit null entries.
Feature mrtPerfWorkaround = { Feature mrtPerfWorkaround = {"mrt_perf_workaround", FeatureCategory::D3DWorkarounds,
"mrt_perf_workaround", FeatureCategory::D3DWorkarounds, "Some drivers have a bug where they ignore null render targets",
"Some NVIDIA D3D11 drivers have a bug where they ignore null render targets", &members}; &members};
Feature setDataFasterThanImageUpload = {"set_data_faster_than_image_upload", Feature setDataFasterThanImageUpload = {"set_data_faster_than_image_upload",
FeatureCategory::D3DWorkarounds, FeatureCategory::D3DWorkarounds,
...@@ -50,9 +50,9 @@ struct FeaturesD3D : FeatureSetBase ...@@ -50,9 +50,9 @@ struct FeaturesD3D : FeatureSetBase
// application creates a mipmapped texture2D, but sets GL_TEXTURE_MIN_FILTER to GL_NEAREST // application creates a mipmapped texture2D, but sets GL_TEXTURE_MIN_FILTER to GL_NEAREST
// (i.e disables mipmaps). To work around this, D3D11 FL9_3 has to create two copies of the // (i.e disables mipmaps). To work around this, D3D11 FL9_3 has to create two copies of the
// texture. The textures' level zeros are identical, but only one texture has mips. // texture. The textures' level zeros are identical, but only one texture has mips.
Feature zeroMaxLodWorkaround = { Feature zeroMaxLodWorkaround = {"zero_max_lod", FeatureCategory::D3DWorkarounds,
"zero_max_lod", FeatureCategory::D3DWorkarounds, "Missing an option to disable mipmaps on a mipmapped texture",
"D3D11 is missing an option to disable mipmaps on a mipmapped texture", &members}; &members};
// Some renderers do not support Geometry Shaders so the Geometry Shader-based PointSprite // Some renderers do not support Geometry Shaders so the Geometry Shader-based PointSprite
// emulation will not work. To work around this, D3D11 FL9_3 has to use a different pointsprite // emulation will not work. To work around this, D3D11 FL9_3 has to use a different pointsprite
...@@ -68,8 +68,8 @@ struct FeaturesD3D : FeatureSetBase ...@@ -68,8 +68,8 @@ struct FeaturesD3D : FeatureSetBase
// (See: http://anglebug.com/1452) // (See: http://anglebug.com/1452)
Feature depthStencilBlitExtraCopy = { Feature depthStencilBlitExtraCopy = {
"depth_stencil_blit_extra_copy", FeatureCategory::D3DWorkarounds, "depth_stencil_blit_extra_copy", FeatureCategory::D3DWorkarounds,
"Bug in NVIDIA D3D11 Driver version <=347.88 and >368.81 triggers a TDR when using " "Bug in some drivers triggers a TDR when using CopySubresourceRegion from a staging "
"CopySubresourceRegion from a staging texture to a depth/stencil", "texture to a depth/stencil",
&members, "http://anglebug.com/1452"}; &members, "http://anglebug.com/1452"};
// The HLSL optimizer has a bug with optimizing "pow" in certain integer-valued expressions. // The HLSL optimizer has a bug with optimizing "pow" in certain integer-valued expressions.
...@@ -84,7 +84,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -84,7 +84,7 @@ struct FeaturesD3D : FeatureSetBase
// feedback is used to repeatedly write to the same buffer positions. // feedback is used to repeatedly write to the same buffer positions.
Feature flushAfterEndingTransformFeedback = { Feature flushAfterEndingTransformFeedback = {
"flush_after_ending_transform_feedback", FeatureCategory::D3DWorkarounds, "flush_after_ending_transform_feedback", FeatureCategory::D3DWorkarounds,
"NVIDIA drivers sometimes write out-of-order results to StreamOut buffers when transform " "Some drivers sometimes write out-of-order results to StreamOut buffers when transform "
"feedback is used to repeatedly write to the same buffer positions", "feedback is used to repeatedly write to the same buffer positions",
&members}; &members};
...@@ -92,7 +92,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -92,7 +92,7 @@ struct FeaturesD3D : FeatureSetBase
// of the HLSL GetDimensions builtin. // of the HLSL GetDimensions builtin.
Feature getDimensionsIgnoresBaseLevel = { Feature getDimensionsIgnoresBaseLevel = {
"get_dimensions_ignores_base_level", FeatureCategory::D3DWorkarounds, "get_dimensions_ignores_base_level", FeatureCategory::D3DWorkarounds,
"Some NVIDIA drivers do not take into account the base level of the " "Some drivers do not take into account the base level of the "
"texture in the results of the HLSL GetDimensions builtin", "texture in the results of the HLSL GetDimensions builtin",
&members}; &members};
...@@ -104,8 +104,8 @@ struct FeaturesD3D : FeatureSetBase ...@@ -104,8 +104,8 @@ struct FeaturesD3D : FeatureSetBase
// by adding Offset directly to Location before reading the texture. // by adding Offset directly to Location before reading the texture.
Feature preAddTexelFetchOffsets = { Feature preAddTexelFetchOffsets = {
"pre_add_texel_fetch_offsets", FeatureCategory::D3DWorkarounds, "pre_add_texel_fetch_offsets", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, HLSL's function texture.Load returns 0 when the parameter Location " "HLSL's function texture.Load returns 0 when the parameter Location is negative, even if "
"is negative, even if the sum of Offset and Location is in range", "the sum of Offset and Location is in range",
&members}; &members};
// On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly. // On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly.
...@@ -113,8 +113,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -113,8 +113,7 @@ struct FeaturesD3D : FeatureSetBase
// before we sample. // before we sample.
Feature emulateTinyStencilTextures = { Feature emulateTinyStencilTextures = {
"emulate_tiny_stencil_textures", FeatureCategory::D3DWorkarounds, "emulate_tiny_stencil_textures", FeatureCategory::D3DWorkarounds,
"On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly", "1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly", &members};
&members};
// In Intel driver, the data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly. // In Intel driver, the data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly.
// This workaroud will disable B5G6R5 support when it's Intel driver. By default, it will use // This workaroud will disable B5G6R5 support when it's Intel driver. By default, it will use
...@@ -122,7 +121,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -122,7 +121,7 @@ struct FeaturesD3D : FeatureSetBase
// On older AMD drivers, the data in DXGI_FORMAT_B5G6R5_UNORM becomes corrupted for unknown // On older AMD drivers, the data in DXGI_FORMAT_B5G6R5_UNORM becomes corrupted for unknown
// reasons. // reasons.
Feature disableB5G6R5Support = {"disable_b5g6r5_support", FeatureCategory::D3DWorkarounds, Feature disableB5G6R5Support = {"disable_b5g6r5_support", FeatureCategory::D3DWorkarounds,
"On Intel and AMD drivers, textures with the format " "Textures with the format "
"DXGI_FORMAT_B5G6R5_UNORM have incorrect data", "DXGI_FORMAT_B5G6R5_UNORM have incorrect data",
&members}; &members};
...@@ -131,33 +130,31 @@ struct FeaturesD3D : FeatureSetBase ...@@ -131,33 +130,31 @@ struct FeaturesD3D : FeatureSetBase
// This driver bug is fixed in 20.19.15.4624. // This driver bug is fixed in 20.19.15.4624.
Feature rewriteUnaryMinusOperator = { Feature rewriteUnaryMinusOperator = {
"rewrite_unary_minus_operator", FeatureCategory::D3DWorkarounds, "rewrite_unary_minus_operator", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, evaluating unary minus operator on integer may " "Evaluating unary minus operator on integer may get wrong answer in vertex shaders",
"get wrong answer in vertex shaders",
&members}; &members};
// On some Intel drivers, using isnan() on highp float will get wrong answer. To work around // On some Intel drivers, using isnan() on highp float will get wrong answer. To work around
// this bug, we use an expression to emulate function isnan(). // this bug, we use an expression to emulate function isnan().
// Tracking bug: https://crbug.com/650547 // Tracking bug: https://crbug.com/650547
// This driver bug is fixed in 21.20.16.4542. // This driver bug is fixed in 21.20.16.4542.
Feature emulateIsnanFloat = { Feature emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::D3DWorkarounds,
"emulate_isnan_float", FeatureCategory::D3DWorkarounds, "Using isnan() on highp float will get wrong answer", &members,
"On some Intel drivers, using isnan() on highp float will get wrong answer", &members,
"https://crbug.com/650547"}; "https://crbug.com/650547"};
// On some Intel drivers, using clear() may not take effect. To work around this bug, we call // On some Intel drivers, using clear() may not take effect. To work around this bug, we call
// clear() twice on these platforms. // clear() twice on these platforms.
// Tracking bug: https://crbug.com/655534 // Tracking bug: https://crbug.com/655534
Feature callClearTwice = {"call_clear_twice", FeatureCategory::D3DWorkarounds, Feature callClearTwice = {"call_clear_twice", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, using clear() may not take effect", &members, "Using clear() may not take effect", &members,
"https://crbug.com/655534"}; "https://crbug.com/655534"};
// On some Intel drivers, copying from staging storage to constant buffer storage does not // On some Intel drivers, copying from staging storage to constant buffer storage does not
// seem to work. Work around this by keeping system memory storage as a canonical reference // seem to work. Work around this by keeping system memory storage as a canonical reference
// for buffer data. // for buffer data.
// D3D11-only workaround. See http://crbug.com/593024. // D3D11-only workaround. See http://crbug.com/593024.
Feature useSystemMemoryForConstantBuffers = { Feature useSystemMemoryForConstantBuffers = {"use_system_memory_for_constant_buffers",
"use_system_memory_for_constant_buffers", FeatureCategory::D3DWorkarounds, FeatureCategory::D3DWorkarounds,
"On some Intel drivers, copying from staging storage to constant buffer " "Copying from staging storage to constant buffer "
"storage does not work", "storage does not work",
&members, "https://crbug.com/593024"}; &members, "https://crbug.com/593024"};
...@@ -181,8 +178,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -181,8 +178,7 @@ struct FeaturesD3D : FeatureSetBase
// So we add a dummy texture as render target in such case. See http://anglebug.com/2152 // So we add a dummy texture as render target in such case. See http://anglebug.com/2152
Feature addDummyTextureNoRenderTarget = { Feature addDummyTextureNoRenderTarget = {
"add_dummy_texture_no_render_target", FeatureCategory::D3DWorkarounds, "add_dummy_texture_no_render_target", FeatureCategory::D3DWorkarounds,
"On D3D ntel drivers <4815 when rendering with no render target, two " "On some drivers when rendering with no render target, two bugs lead to incorrect behavior",
"bugs lead to incorrect behavior",
&members, "http://anglebug.com/2152"}; &members, "http://anglebug.com/2152"};
// Don't use D3D constant register zero when allocating space for uniforms in the vertex shader. // Don't use D3D constant register zero when allocating space for uniforms in the vertex shader.
...@@ -190,9 +186,7 @@ struct FeaturesD3D : FeatureSetBase ...@@ -190,9 +186,7 @@ struct FeaturesD3D : FeatureSetBase
// specific cases the driver would not handle constant register zero correctly. // specific cases the driver would not handle constant register zero correctly.
Feature skipVSConstantRegisterZero = { Feature skipVSConstantRegisterZero = {
"skip_vs_constant_register_zero", FeatureCategory::D3DWorkarounds, "skip_vs_constant_register_zero", FeatureCategory::D3DWorkarounds,
"On NVIDIA D3D driver v388.59 in specific cases the driver doesn't " "In specific cases the driver doesn't handle constant register zero correctly", &members};
"handle constant register zero correctly",
&members};
// Forces the value returned from an atomic operations to be always be resolved. This is // Forces the value returned from an atomic operations to be always be resolved. This is
// targeted to workaround a bug in NVIDIA D3D driver where the return value from // targeted to workaround a bug in NVIDIA D3D driver where the return value from
...@@ -201,8 +195,8 @@ struct FeaturesD3D : FeatureSetBase ...@@ -201,8 +195,8 @@ struct FeaturesD3D : FeatureSetBase
// http://anglebug.com/3246 // http://anglebug.com/3246
Feature forceAtomicValueResolution = { Feature forceAtomicValueResolution = {
"force_atomic_value_resolution", FeatureCategory::D3DWorkarounds, "force_atomic_value_resolution", FeatureCategory::D3DWorkarounds,
"On an NVIDIA D3D driver, the return value from RWByteAddressBuffer.InterlockedAdd does " "On some drivers the return value from RWByteAddressBuffer.InterlockedAdd does not resolve "
"not resolve when used in the .yzw components of a RWByteAddressBuffer.Store operation", "when used in the .yzw components of a RWByteAddressBuffer.Store operation",
&members, "http://anglebug.com/3246"}; &members, "http://anglebug.com/3246"};
// Match chromium's robust resource init behaviour by always prefering to upload texture data // Match chromium's robust resource init behaviour by always prefering to upload texture data
......
...@@ -23,19 +23,19 @@ struct FeaturesGL : FeatureSetBase ...@@ -23,19 +23,19 @@ struct FeaturesGL : FeatureSetBase
// one of the two closest normalized integer representations (although round to nearest is // one of the two closest normalized integer representations (although round to nearest is
// preferred) (see section 2.3.5.2 of the GL 4.5 core specification). OpenGL ES requires that // preferred) (see section 2.3.5.2 of the GL 4.5 core specification). OpenGL ES requires that
// round-to-nearest is used (see "Conversion from Floating-Point to Framebuffer Fixed-Point" in // round-to-nearest is used (see "Conversion from Floating-Point to Framebuffer Fixed-Point" in
// section 2.1.2 of the OpenGL ES 2.0.25 spec). This issue only shows up on Intel and AMD // section 2.1.2 of the OpenGL ES 2.0.25 spec). This issue only shows up on AMD drivers on
// drivers on framebuffer formats that have 1-bit alpha, work around this by using higher // framebuffer formats that have 1-bit alpha, work around this by using higher precision formats
// precision formats instead. // instead.
Feature avoid1BitAlphaTextureFormats = { Feature avoid1BitAlphaTextureFormats = {"avoid_1_bit_alpha_texture_formats",
"avoid_1_bit_alpha_texture_formats", FeatureCategory::OpenGLWorkarounds, FeatureCategory::OpenGLWorkarounds,
"Issue on Intel and AMD drivers with 1-bit alpha framebuffer formats", &members}; "Issue with 1-bit alpha framebuffer formats", &members};
// On some older Intel drivers, GL_RGBA4 is not color renderable, glCheckFramebufferStatus // On some older Intel drivers, GL_RGBA4 is not color renderable, glCheckFramebufferStatus
// returns GL_FRAMEBUFFER_UNSUPPORTED. Work around this by using a known color-renderable // returns GL_FRAMEBUFFER_UNSUPPORTED. Work around this by using a known color-renderable
// format. // format.
Feature rgba4IsNotSupportedForColorRendering = { Feature rgba4IsNotSupportedForColorRendering = {"rgba4_is_not_supported_for_color_rendering",
"rgba4_is_not_supported_for_color_rendering", FeatureCategory::OpenGLWorkarounds, FeatureCategory::OpenGLWorkarounds,
"Issue on older Intel drivers, GL_RGBA4 is not color renderable", &members}; "GL_RGBA4 is not color renderable", &members};
// When clearing a framebuffer on Intel or AMD drivers, when GL_FRAMEBUFFER_SRGB is enabled, the // When clearing a framebuffer on Intel or AMD drivers, when GL_FRAMEBUFFER_SRGB is enabled, the
// driver clears to the linearized clear color despite the framebuffer not supporting SRGB // driver clears to the linearized clear color despite the framebuffer not supporting SRGB
...@@ -43,8 +43,7 @@ struct FeaturesGL : FeatureSetBase ...@@ -43,8 +43,7 @@ struct FeaturesGL : FeatureSetBase
// attachments appear to get the correct clear color. // attachments appear to get the correct clear color.
Feature doesSRGBClearsOnLinearFramebufferAttachments = { Feature doesSRGBClearsOnLinearFramebufferAttachments = {
"does_srgb_clears_on_linear_framebuffer_attachments", FeatureCategory::OpenGLWorkarounds, "does_srgb_clears_on_linear_framebuffer_attachments", FeatureCategory::OpenGLWorkarounds,
"Issue clearing framebuffers with linear attachments on Intel or AMD " "Issue clearing framebuffers with linear attachments when GL_FRAMEBUFFER_SRGB is enabled",
"drivers when GL_FRAMEBUFFER_SRGB is enabled",
&members}; &members};
// On Mac some GLSL constructs involving do-while loops cause GPU hangs, such as the following: // On Mac some GLSL constructs involving do-while loops cause GPU hangs, such as the following:
...@@ -56,23 +55,21 @@ struct FeaturesGL : FeatureSetBase ...@@ -56,23 +55,21 @@ struct FeaturesGL : FeatureSetBase
// Work around this by rewriting the do-while to use another GLSL construct (block + while) // Work around this by rewriting the do-while to use another GLSL construct (block + while)
Feature doWhileGLSLCausesGPUHang = { Feature doWhileGLSLCausesGPUHang = {
"do_while_glsl_causes_gpu_hang", FeatureCategory::OpenGLWorkarounds, "do_while_glsl_causes_gpu_hang", FeatureCategory::OpenGLWorkarounds,
"On Mac, some GLSL constructs involving do-while loops cause GPU hangs", &members}; "Some GLSL constructs involving do-while loops cause GPU hangs", &members};
// On Mac AMD GPU gl_VertexID in GLSL vertex shader doesn't include base vertex value, // On Mac AMD GPU gl_VertexID in GLSL vertex shader doesn't include base vertex value,
// Work aronud this by replace gl_VertexID with (gl_VertexID - angle_BaseVertex) when // Work aronud this by replace gl_VertexID with (gl_VertexID - angle_BaseVertex) when
// angle_BaseVertex is present. // angle_BaseVertex is present.
Feature addBaseVertexToVertexID = { Feature addBaseVertexToVertexID = {
"vertex_id_does_not_include_base_vertex", FeatureCategory::OpenGLWorkarounds, "vertex_id_does_not_include_base_vertex", FeatureCategory::OpenGLWorkarounds,
"On Mac AMD GPU gl_VertexID in GLSL vertex shader doesn't include base vertex value", "gl_VertexID in GLSL vertex shader doesn't include base vertex value", &members};
&members};
// Calling glFinish doesn't cause all queries to report that the result is available on some // Calling glFinish doesn't cause all queries to report that the result is available on some
// (NVIDIA) drivers. It was found that enabling GL_DEBUG_OUTPUT_SYNCHRONOUS before the finish // (NVIDIA) drivers. It was found that enabling GL_DEBUG_OUTPUT_SYNCHRONOUS before the finish
// causes it to fully finish. // causes it to fully finish.
Feature finishDoesNotCauseQueriesToBeAvailable = { Feature finishDoesNotCauseQueriesToBeAvailable = {
"finish_does_not_cause_queries_to_be_available", FeatureCategory::OpenGLWorkarounds, "finish_does_not_cause_queries_to_be_available", FeatureCategory::OpenGLWorkarounds,
"On some NVIDIA drivers, glFinish doesn't cause all queries to report available result", "glFinish doesn't cause all queries to report available result", &members};
&members};
// Always call useProgram after a successful link to avoid a driver bug. // Always call useProgram after a successful link to avoid a driver bug.
// This workaround is meant to reproduce the use_current_program_after_successful_link // This workaround is meant to reproduce the use_current_program_after_successful_link
...@@ -80,21 +77,24 @@ struct FeaturesGL : FeatureSetBase ...@@ -80,21 +77,24 @@ struct FeaturesGL : FeatureSetBase
// not necessary for MacOSX 10.9 and higher (http://crrev.com/39eb535b). // not necessary for MacOSX 10.9 and higher (http://crrev.com/39eb535b).
Feature alwaysCallUseProgramAfterLink = { Feature alwaysCallUseProgramAfterLink = {
"always_call_use_program_after_link", FeatureCategory::OpenGLWorkarounds, "always_call_use_program_after_link", FeatureCategory::OpenGLWorkarounds,
"Always call useProgram after a successful link to avoid a driver bug", &members}; "Always call useProgram after a successful link to avoid a driver bug", &members,
"http://crbug.com/110263"};
// In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row. // On NVIDIA, in the case of unpacking from a pixel unpack buffer, unpack overlapping rows row
// by row.
Feature unpackOverlappingRowsSeparatelyUnpackBuffer = { Feature unpackOverlappingRowsSeparatelyUnpackBuffer = {
"unpack_overlapping_rows_separately_unpack_buffer", FeatureCategory::OpenGLWorkarounds, "unpack_overlapping_rows_separately_unpack_buffer", FeatureCategory::OpenGLWorkarounds,
"In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row", "In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row",
&members}; &members};
// In the case of packing to a pixel pack buffer, pack overlapping rows row by row. // On NVIDIA, in the case of packing to a pixel pack buffer, pack overlapping rows row by row.
Feature packOverlappingRowsSeparatelyPackBuffer = { Feature packOverlappingRowsSeparatelyPackBuffer = {
"pack_overlapping_rows_separately_pack_buffer", FeatureCategory::OpenGLWorkarounds, "pack_overlapping_rows_separately_pack_buffer", FeatureCategory::OpenGLWorkarounds,
"In the case of packing to a pixel pack buffer, pack overlapping rows row by row", "In the case of packing to a pixel pack buffer, pack overlapping rows row by row",
&members}; &members};
// During initialization, assign the current vertex attributes to the spec-mandated defaults. // On NVIDIA, during initialization, assign the current vertex attributes to the spec-mandated
// defaults.
Feature initializeCurrentVertexAttributes = { Feature initializeCurrentVertexAttributes = {
"initialize_current_vertex_attributes", FeatureCategory::OpenGLWorkarounds, "initialize_current_vertex_attributes", FeatureCategory::OpenGLWorkarounds,
"During initialization, assign the current vertex attributes to the spec-mandated defaults", "During initialization, assign the current vertex attributes to the spec-mandated defaults",
...@@ -102,15 +102,15 @@ struct FeaturesGL : FeatureSetBase ...@@ -102,15 +102,15 @@ struct FeaturesGL : FeatureSetBase
// abs(i) where i is an integer returns unexpected result on Intel Mac. // abs(i) where i is an integer returns unexpected result on Intel Mac.
// Emulate abs(i) with i * sign(i). // Emulate abs(i) with i * sign(i).
Feature emulateAbsIntFunction = { Feature emulateAbsIntFunction = {"emulate_abs_int_function", FeatureCategory::OpenGLWorkarounds,
"emulate_abs_int_function", FeatureCategory::OpenGLWorkarounds, "abs(i) where i is an integer returns unexpected result",
"On Intel Mac, abs(i) where i is an integer returns unexpected result", &members}; &members};
// On Intel Mac, calculation of loop conditions in for and while loop has bug. // On Intel Mac, calculation of loop conditions in for and while loop has bug.
// Add "&& true" to the end of the condition expression to work around the bug. // Add "&& true" to the end of the condition expression to work around the bug.
Feature addAndTrueToLoopCondition = { Feature addAndTrueToLoopCondition = {
"add_and_true_to_loop_condition", FeatureCategory::OpenGLWorkarounds, "add_and_true_to_loop_condition", FeatureCategory::OpenGLWorkarounds,
"On Intel Mac, calculation of loop conditions in for and while loop has bug", &members}; "Calculation of loop conditions in for and while loop has bug", &members};
// When uploading textures from an unpack buffer, some drivers count an extra row padding when // When uploading textures from an unpack buffer, some drivers count an extra row padding when
// checking if the pixel unpack buffer is big enough. Tracking bug: http://anglebug.com/1512 // checking if the pixel unpack buffer is big enough. Tracking bug: http://anglebug.com/1512
...@@ -127,20 +127,20 @@ struct FeaturesGL : FeatureSetBase ...@@ -127,20 +127,20 @@ struct FeaturesGL : FeatureSetBase
Feature unpackLastRowSeparatelyForPaddingInclusion = { Feature unpackLastRowSeparatelyForPaddingInclusion = {
"unpack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds, "unpack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds,
"When uploading textures from an unpack buffer, some drivers count an extra row padding", "When uploading textures from an unpack buffer, some drivers count an extra row padding",
&members}; &members, "http://anglebug.com/1512"};
// Equivalent workaround when uploading data from a pixel pack buffer. // Equivalent workaround when uploading data from a pixel pack buffer.
Feature packLastRowSeparatelyForPaddingInclusion = { Feature packLastRowSeparatelyForPaddingInclusion = {
"pack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds, "pack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds,
"When uploading textures from an pack buffer, some drivers count an extra row padding", "When uploading textures from an pack buffer, some drivers count an extra row padding",
&members}; &members, "http://anglebug.com/1512"};
// On some Intel drivers, using isnan() on highp float will get wrong answer. To work around // On some Intel drivers, using isnan() on highp float will get wrong answer. To work around
// this bug, we use an expression to emulate function isnan(). // this bug, we use an expression to emulate function isnan().
// Tracking bug: http://crbug.com/650547 // Tracking bug: http://crbug.com/650547
Feature emulateIsnanFloat = { Feature emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::OpenGLWorkarounds,
"emulate_isnan_float", FeatureCategory::OpenGLWorkarounds, "Using isnan() on highp float will get wrong answer", &members,
"On some Intel drivers, using isnan() on highp float will get wrong answer", &members}; "http://crbug.com/650547"};
// On Mac with OpenGL version 4.1, unused std140 or shared uniform blocks will be // On Mac with OpenGL version 4.1, unused std140 or shared uniform blocks will be
// treated as inactive which is not consistent with WebGL2.0 spec. Reference all members in a // treated as inactive which is not consistent with WebGL2.0 spec. Reference all members in a
...@@ -148,9 +148,7 @@ struct FeaturesGL : FeatureSetBase ...@@ -148,9 +148,7 @@ struct FeaturesGL : FeatureSetBase
// Also used on Linux AMD. // Also used on Linux AMD.
Feature useUnusedBlocksWithStandardOrSharedLayout = { Feature useUnusedBlocksWithStandardOrSharedLayout = {
"use_unused_blocks_with_standard_or_shared_layout", FeatureCategory::OpenGLWorkarounds, "use_unused_blocks_with_standard_or_shared_layout", FeatureCategory::OpenGLWorkarounds,
"On Mac with OpenGL version 4.1 and Linux AMD, unused std140 or shared uniform blocks " "Unused std140 or shared uniform blocks will be treated as inactive", &members};
"will be treated as inactive",
&members};
// This flag is used to fix spec difference between GLSL 4.1 or lower and ESSL3. // This flag is used to fix spec difference between GLSL 4.1 or lower and ESSL3.
Feature removeInvariantAndCentroidForESSL3 = { Feature removeInvariantAndCentroidForESSL3 = {
...@@ -162,14 +160,13 @@ struct FeaturesGL : FeatureSetBase ...@@ -162,14 +160,13 @@ struct FeaturesGL : FeatureSetBase
// Tracking bug: http://crbug.com/308366 // Tracking bug: http://crbug.com/308366
Feature rewriteFloatUnaryMinusOperator = { Feature rewriteFloatUnaryMinusOperator = {
"rewrite_float_unary_minus_operator", FeatureCategory::OpenGLWorkarounds, "rewrite_float_unary_minus_operator", FeatureCategory::OpenGLWorkarounds,
"On Intel Mac OSX 10.11 driver, using '-<float>' will get wrong answer", &members, "Using '-<float>' will get wrong answer", &members, "http://crbug.com/308366"};
"http://crbug.com/308366"};
// On NVIDIA drivers, atan(y, x) may return a wrong answer. // On NVIDIA drivers, atan(y, x) may return a wrong answer.
// Tracking bug: http://crbug.com/672380 // Tracking bug: http://crbug.com/672380
Feature emulateAtan2Float = {"emulate_atan_2_float", FeatureCategory::OpenGLWorkarounds, Feature emulateAtan2Float = {"emulate_atan_2_float", FeatureCategory::OpenGLWorkarounds,
"On NVIDIA drivers, atan(y, x) may return a wrong answer", "atan(y, x) may return a wrong answer", &members,
&members, "http://crbug.com/672380"}; "http://crbug.com/672380"};
// Some drivers seem to forget about UBO bindings when using program binaries. Work around // Some drivers seem to forget about UBO bindings when using program binaries. Work around
// this by re-applying the bindings after the program binary is loaded or saved. // this by re-applying the bindings after the program binary is loaded or saved.
...@@ -177,98 +174,92 @@ struct FeaturesGL : FeatureSetBase ...@@ -177,98 +174,92 @@ struct FeaturesGL : FeatureSetBase
// http://anglebug.com/1637 // http://anglebug.com/1637
Feature reapplyUBOBindingsAfterUsingBinaryProgram = { Feature reapplyUBOBindingsAfterUsingBinaryProgram = {
"reapply_ubo_bindings_after_using_binary_program", FeatureCategory::OpenGLWorkarounds, "reapply_ubo_bindings_after_using_binary_program", FeatureCategory::OpenGLWorkarounds,
"Some AMD OpenGL drivers and Android devices forget about UBO bindings " "Some drivers forget about UBO bindings when using program binaries", &members,
"when using program binaries", "http://anglebug.com/1637"};
&members, "http://anglebug.com/1637"};
// Some OpenGL drivers return 0 when we query MAX_VERTEX_ATTRIB_STRIDE in an OpenGL 4.4 or // Some Linux OpenGL drivers return 0 when we query MAX_VERTEX_ATTRIB_STRIDE in an OpenGL 4.4 or
// higher context. // higher context.
// This only seems to affect AMD OpenGL drivers. // This only seems to affect AMD OpenGL drivers.
// Tracking bug: http://anglebug.com/1936 // Tracking bug: http://anglebug.com/1936
Feature emulateMaxVertexAttribStride = { Feature emulateMaxVertexAttribStride = {
"emulate_max_vertex_attrib_stride", FeatureCategory::OpenGLWorkarounds, "emulate_max_vertex_attrib_stride", FeatureCategory::OpenGLWorkarounds,
"Some AMD OpenGL >= 4.4 drivers return 0 when MAX_VERTEX_ATTRIB_STRIED queried", &members, "Some drivers return 0 when MAX_VERTEX_ATTRIB_STRIED queried", &members,
"http://anglebug.com/1936"}; "http://anglebug.com/1936"};
// Initializing uninitialized locals caused odd behavior on Mac in a few WebGL 2 tests. // Initializing uninitialized locals caused odd behavior on Android Qualcomm in a few WebGL 2
// Tracking bug: http://anglebug/2041 // tests. Tracking bug: http://anglebug.com/2046
Feature dontInitializeUninitializedLocals = { Feature dontInitializeUninitializedLocals = {
"dont_initialize_uninitialized_locals", FeatureCategory::OpenGLWorkarounds, "dont_initialize_uninitialized_locals", FeatureCategory::OpenGLWorkarounds,
"On Mac initializing uninitialized locals caused odd behavior in a few WebGL 2 tests", "Initializing uninitialized locals caused odd behavior in a few WebGL 2 tests", &members,
&members, "http://anglebug.com/2041"}; "http://anglebug.com/2046"};
// On some NVIDIA drivers the point size range reported from the API is inconsistent with the // On some NVIDIA drivers the point size range reported from the API is inconsistent with the
// actual behavior. Clamp the point size to the value from the API to fix this. // actual behavior. Clamp the point size to the value from the API to fix this.
Feature clampPointSize = { Feature clampPointSize = {
"clamp_point_size", FeatureCategory::OpenGLWorkarounds, "clamp_point_size", FeatureCategory::OpenGLWorkarounds,
"On some NVIDIA drivers the point size range reported from the API is " "The point size range reported from the API is inconsistent with the actual behavior",
"inconsistent with the actual behavior",
&members}; &members};
// On some NVIDIA drivers certain types of GLSL arithmetic ops mixing vectors and scalars may be // On some NVIDIA drivers certain types of GLSL arithmetic ops mixing vectors and scalars may be
// executed incorrectly. Change them in the shader translator. Tracking bug: // executed incorrectly. Change them in the shader translator. Tracking bug:
// http://crbug.com/772651 // http://crbug.com/772651
Feature rewriteVectorScalarArithmetic = { Feature rewriteVectorScalarArithmetic = {"rewrite_vector_scalar_arithmetic",
"rewrite_vector_scalar_arithmetic", FeatureCategory::OpenGLWorkarounds, FeatureCategory::OpenGLWorkarounds,
"On some NVIDIA drivers certain types of GLSL arithmetic ops mixing " "Certain types of GLSL arithmetic ops mixing vectors "
"vectors and scalars may be executed incorrectly", "and scalars may be executed incorrectly",
&members, "http://crbug.com/772651"}; &members, "http://crbug.com/772651"};
// On some Android devices for loops used to initialize variables hit native GLSL compiler bugs. // On some Android devices for loops used to initialize variables hit native GLSL compiler bugs.
Feature dontUseLoopsToInitializeVariables = { Feature dontUseLoopsToInitializeVariables = {
"dont_use_loops_to_initialize_variables", FeatureCategory::OpenGLWorkarounds, "dont_use_loops_to_initialize_variables", FeatureCategory::OpenGLWorkarounds,
"On some Android devices for loops used to initialize variables hit " "For loops used to initialize variables hit native GLSL compiler bugs", &members};
"native GLSL compiler bugs",
&members};
// On some NVIDIA drivers gl_FragDepth is not clamped correctly when rendering to a floating // On some NVIDIA drivers gl_FragDepth is not clamped correctly when rendering to a floating
// point depth buffer. Clamp it in the translated shader to fix this. // point depth buffer. Clamp it in the translated shader to fix this.
Feature clampFragDepth = {"clamp_frag_depth", FeatureCategory::OpenGLWorkarounds, Feature clampFragDepth = {
"On some NVIDIA drivers gl_FragDepth is not clamped correctly when " "clamp_frag_depth", FeatureCategory::OpenGLWorkarounds,
"rendering to a floating point depth buffer", "gl_FragDepth is not clamped correctly when rendering to a floating point depth buffer",
&members}; &members};
// On some NVIDIA drivers before version 397.31 repeated assignment to swizzled values inside a // On some NVIDIA drivers before version 397.31 repeated assignment to swizzled values inside a
// GLSL user-defined function have incorrect results. Rewrite this type of statements to fix // GLSL user-defined function have incorrect results. Rewrite this type of statements to fix
// this. // this.
Feature rewriteRepeatedAssignToSwizzled = { Feature rewriteRepeatedAssignToSwizzled = {"rewrite_repeated_assign_to_swizzled",
"rewrite_repeated_assign_to_swizzled", FeatureCategory::OpenGLWorkarounds, FeatureCategory::OpenGLWorkarounds,
"On some NVIDIA drivers < v397.31, repeated assignment to swizzled " "Repeated assignment to swizzled values inside a "
"values inside a GLSL user-defined function have incorrect results", "GLSL user-defined function have incorrect results",
&members}; &members};
// On some AMD and Intel GL drivers ARB_blend_func_extended does not pass the tests. // On some AMD and Intel GL drivers ARB_blend_func_extended does not pass the tests.
// It might be possible to work around the Intel bug by rewriting *FragData to *FragColor // It might be possible to work around the Intel bug by rewriting *FragData to *FragColor
// instead of disabling the functionality entirely. The AMD bug looked like incorrect blending, // instead of disabling the functionality entirely. The AMD bug looked like incorrect blending,
// not sure if a workaround is feasible. http://anglebug.com/1085 // not sure if a workaround is feasible. http://anglebug.com/1085
Feature disableBlendFuncExtended = { Feature disableBlendFuncExtended = {
"disable_blend_func_extended", FeatureCategory::OpenGLWorkarounds, "disable_blend_func_extended", FeatureCategory::OpenGLWorkarounds,
"On some AMD and Intel GL drivers ARB_blend_func_extended does not pass the tests", "ARB_blend_func_extended does not pass the tests", &members, "http://anglebug.com/1085"};
&members, "http://anglebug.com/1085"};
// Qualcomm drivers returns raw sRGB values instead of linearized values when calling // Qualcomm drivers returns raw sRGB values instead of linearized values when calling
// glReadPixels on unsized sRGB texture formats. http://crbug.com/550292 and // glReadPixels on unsized sRGB texture formats. http://crbug.com/550292 and
// http://crbug.com/565179 // http://crbug.com/565179
Feature unsizedsRGBReadPixelsDoesntTransform = { Feature unsizedsRGBReadPixelsDoesntTransform = {
"unsized_srgb_read_pixels_doesnt_transform", FeatureCategory::OpenGLWorkarounds, "unsized_srgb_read_pixels_doesnt_transform", FeatureCategory::OpenGLWorkarounds,
"Qualcomm drivers returns raw sRGB values instead of linearized values " "Drivers returning raw sRGB values instead of linearized values when calling glReadPixels "
"when calling glReadPixels on unsized sRGB texture formats", "on unsized sRGB texture formats",
&members, "http://crbug.com/565179"}; &members, "http://crbug.com/565179"};
// Older Qualcomm drivers generate errors when querying the number of bits in timer queries, ex: // Older Qualcomm drivers generate errors when querying the number of bits in timer queries, ex:
// GetQueryivEXT(GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS). http://anglebug.com/3027 // GetQueryivEXT(GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS). http://anglebug.com/3027
Feature queryCounterBitsGeneratesErrors = { Feature queryCounterBitsGeneratesErrors = {
"query_counter_bits_generates_errors", FeatureCategory::OpenGLWorkarounds, "query_counter_bits_generates_errors", FeatureCategory::OpenGLWorkarounds,
"Older Qualcomm drivers generate errors when querying the number of bits in timer queries", "Drivers generate errors when querying the number of bits in timer queries", &members,
&members, "http://anglebug.com/3027"}; "http://anglebug.com/3027"};
// Re-linking a program in parallel is buggy on some Intel Windows OpenGL drivers and Android // Re-linking a program in parallel is buggy on some Intel Windows OpenGL drivers and Android
// platforms. // platforms.
// http://anglebug.com/3045 // http://anglebug.com/3045
Feature dontRelinkProgramsInParallel = { Feature dontRelinkProgramsInParallel = {
"dont_relink_programs_in_parallel", FeatureCategory::OpenGLWorkarounds, "dont_relink_programs_in_parallel", FeatureCategory::OpenGLWorkarounds,
"On some Intel Windows OpenGL drivers and Android, relinking a program " "Relinking a program in parallel is buggy", &members, "http://anglebug.com/3045"};
"in parallel is buggy",
&members, "http://anglebug.com/3045"};
// Some tests have been seen to fail using worker contexts, this switch allows worker contexts // Some tests have been seen to fail using worker contexts, this switch allows worker contexts
// to be disabled for some platforms. http://crbug.com/849576 // to be disabled for some platforms. http://crbug.com/849576
...@@ -282,15 +273,15 @@ struct FeaturesGL : FeatureSetBase ...@@ -282,15 +273,15 @@ struct FeaturesGL : FeatureSetBase
Feature limitMaxTextureSizeTo4096 = {"max_texture_size_limit_4096", Feature limitMaxTextureSizeTo4096 = {"max_texture_size_limit_4096",
FeatureCategory::OpenGLWorkarounds, FeatureCategory::OpenGLWorkarounds,
"Limit max texture size to 4096 to avoid frequent " "Limit max texture size to 4096 to avoid frequent "
"out-of-memory errors on Android or Intel Linux", "out-of-memory errors",
&members, "http://crbug.com/927470"}; &members, "http://crbug.com/927470"};
// Prevent excessive MSAA allocations on Android devices, various rendering bugs have been // Prevent excessive MSAA allocations on Android devices, various rendering bugs have been
// observed and they tend to be high DPI anyways. http://crbug.com/797243 // observed and they tend to be high DPI anyways. http://crbug.com/797243
Feature limitMaxMSAASamplesTo4 = { Feature limitMaxMSAASamplesTo4 = {
"max_msaa_sample_count_4", FeatureCategory::OpenGLWorkarounds, "max_msaa_sample_count_4", FeatureCategory::OpenGLWorkarounds,
"Various rendering bugs have been observed when using higher MSAA counts on Android", "Various rendering bugs have been observed when using higher MSAA counts", &members,
&members, "http://crbug.com/797243"}; "http://crbug.com/797243"};
// Prefer to do the robust resource init clear using a glClear. Calls to TexSubImage2D on large // Prefer to do the robust resource init clear using a glClear. Calls to TexSubImage2D on large
// textures can take hundreds of milliseconds because of slow uploads on macOS. Do this only on // textures can take hundreds of milliseconds because of slow uploads on macOS. Do this only on
...@@ -328,8 +319,7 @@ struct FeaturesGL : FeatureSetBase ...@@ -328,8 +319,7 @@ struct FeaturesGL : FeatureSetBase
// this by capping the max texture size. // this by capping the max texture size.
Feature limitMax3dArrayTextureSizeTo1024 = { Feature limitMax3dArrayTextureSizeTo1024 = {
"max_3d_array_texture_size_1024", FeatureCategory::OpenGLWorkarounds, "max_3d_array_texture_size_1024", FeatureCategory::OpenGLWorkarounds,
"Limit max 3d texture size and max array texture layers to 1024 to avoid system hang on " "Limit max 3d texture size and max array texture layers to 1024 to avoid system hang",
"older Intel Linux",
&members, "http://crbug.com/927470"}; &members, "http://crbug.com/927470"};
// BlitFramebuffer has issues on some platforms with large source/dest texture sizes. This // BlitFramebuffer has issues on some platforms with large source/dest texture sizes. This
...@@ -344,7 +334,7 @@ struct FeaturesGL : FeatureSetBase ...@@ -344,7 +334,7 @@ struct FeaturesGL : FeatureSetBase
// This workaround clips the source region and adjust the dest region proportionally. // This workaround clips the source region and adjust the dest region proportionally.
Feature clipSrcRegionBlitFramebuffer = { Feature clipSrcRegionBlitFramebuffer = {
"clip_src_region_for_blitframebuffer", FeatureCategory::OpenGLWorkarounds, "clip_src_region_for_blitframebuffer", FeatureCategory::OpenGLWorkarounds,
"Mac has issues with blitFramebuffer when the parameters don't match the framebuffer size.", "Issues with blitFramebuffer when the parameters don't match the framebuffer size.",
&members, "http://crbug.com/830046"}; &members, "http://crbug.com/830046"};
// Calling glTexImage2D with zero size generates GL errors // Calling glTexImage2D with zero size generates GL errors
......
...@@ -49,8 +49,7 @@ struct FeaturesVk : FeatureSetBase ...@@ -49,8 +49,7 @@ struct FeaturesVk : FeatureSetBase
// to have a bug where the last region is ignored. // to have a bug where the last region is ignored.
Feature extraCopyBufferRegion = { Feature extraCopyBufferRegion = {
"extra_copy_buffer_region", FeatureCategory::VulkanWorkarounds, "extra_copy_buffer_region", FeatureCategory::VulkanWorkarounds,
"Windows Intel driver seems to have a bug where the last copy region in " "Some drivers seem to have a bug where the last copy region in vkCmdCopyBuffer is ignored",
"vkCmdCopyBuffer is ignored",
&members}; &members};
// This flag is added for the sole purpose of end2end tests, to test the correctness // This flag is added for the sole purpose of end2end tests, to test the correctness
...@@ -64,8 +63,7 @@ struct FeaturesVk : FeatureSetBase ...@@ -64,8 +63,7 @@ struct FeaturesVk : FeatureSetBase
// Tracked in http://anglebug.com/2970. // Tracked in http://anglebug.com/2970.
Feature clampPointSize = { Feature clampPointSize = {
"clamp_point_size", FeatureCategory::VulkanWorkarounds, "clamp_point_size", FeatureCategory::VulkanWorkarounds,
"On some NVIDIA drivers, the point size range reported from the API is " "The point size range reported from the API is inconsistent with the actual behavior",
"inconsistent with the actual behavior",
&members, "http://anglebug.com/2970"}; &members, "http://anglebug.com/2970"};
// On some android devices, the memory barrier between the compute shader that converts vertex // On some android devices, the memory barrier between the compute shader that converts vertex
...@@ -73,8 +71,8 @@ struct FeaturesVk : FeatureSetBase ...@@ -73,8 +71,8 @@ struct FeaturesVk : FeatureSetBase
// to perform a flush after the conversion. http://anglebug.com/3016 // to perform a flush after the conversion. http://anglebug.com/3016
Feature flushAfterVertexConversion = { Feature flushAfterVertexConversion = {
"flush_after_vertex_conversion", FeatureCategory::VulkanWorkarounds, "flush_after_vertex_conversion", FeatureCategory::VulkanWorkarounds,
"On some android devices, the memory barrier between the compute shader that converts " "The memory barrier between the compute shader that converts vertex attributes and the "
"vertex attributes and the vertex shader that reads from it is ineffective", "vertex shader that reads from it is ineffective",
&members, "http://anglebug.com/3016"}; &members, "http://anglebug.com/3016"};
// Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the // Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the
...@@ -88,8 +86,7 @@ struct FeaturesVk : FeatureSetBase ...@@ -88,8 +86,7 @@ struct FeaturesVk : FeatureSetBase
// textures. // textures.
Feature forceCPUPathForCubeMapCopy = { Feature forceCPUPathForCubeMapCopy = {
"force_cpu_path_for_cube_map_copy", FeatureCategory::VulkanWorkarounds, "force_cpu_path_for_cube_map_copy", FeatureCategory::VulkanWorkarounds,
"Some Intel Windows drivers have an issue with creating single-layer " "Some drivers have an issue with creating single-layer views on cube map textures",
"views on cube map textures",
&members}; &members};
// Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer // Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer
...@@ -128,15 +125,13 @@ struct FeaturesVk : FeatureSetBase ...@@ -128,15 +125,13 @@ struct FeaturesVk : FeatureSetBase
// VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153 // VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153
Feature disableFifoPresentMode = { Feature disableFifoPresentMode = {
"disable_fifo_present_mode", FeatureCategory::VulkanWorkarounds, "disable_fifo_present_mode", FeatureCategory::VulkanWorkarounds,
"On Linux Intel, VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, "VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, "http://anglebug.com/3153"};
"http://anglebug.com/3153"};
// On Qualcomm, a bug is preventing us from using loadOp=Clear with inline commands in the // On Qualcomm, a bug is preventing us from using loadOp=Clear with inline commands in the
// render pass. http://anglebug.com/2361 // render pass. http://anglebug.com/2361
Feature restartRenderPassAfterLoadOpClear = { Feature restartRenderPassAfterLoadOpClear = {
"restart_render_pass_after_load_op_clear", FeatureCategory::VulkanWorkarounds, "restart_render_pass_after_load_op_clear", FeatureCategory::VulkanWorkarounds,
"On Qualcomm, a bug is preventing us from using loadOp=Clear with inline " "A bug is preventing us from using loadOp=Clear with inline commands in the render pass",
"commands in the render pass",
&members, "http://anglebug.com/2361"}; &members, "http://anglebug.com/2361"};
// On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave. // On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave.
...@@ -145,26 +140,25 @@ struct FeaturesVk : FeatureSetBase ...@@ -145,26 +140,25 @@ struct FeaturesVk : FeatureSetBase
// unused descriptor set to work around this issue. http://anglebug.com/2727 // unused descriptor set to work around this issue. http://anglebug.com/2727
Feature bindEmptyForUnusedDescriptorSets = { Feature bindEmptyForUnusedDescriptorSets = {
"bind_empty_for_unused_descriptor_sets", FeatureCategory::VulkanWorkarounds, "bind_empty_for_unused_descriptor_sets", FeatureCategory::VulkanWorkarounds,
"On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave", "Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members,
&members, "http://anglebug.com/2727"}; "http://anglebug.com/2727"};
// When the scissor is (0,0,0,0) on Windows Intel, the driver acts as if the scissor was // When the scissor is (0,0,0,0) on Windows Intel, the driver acts as if the scissor was
// disabled. Work-around this by setting the scissor to just outside of the render area // disabled. Work-around this by setting the scissor to just outside of the render area
// (e.g. (renderArea.x, renderArea.y, 1, 1)). http://anglebug.com/3407 // (e.g. (renderArea.x, renderArea.y, 1, 1)). http://anglebug.com/3407
Feature forceNonZeroScissor = { Feature forceNonZeroScissor = {
"force_non_zero_scissor", FeatureCategory::VulkanWorkarounds, "force_non_zero_scissor", FeatureCategory::VulkanWorkarounds,
"On Windows Intel, when the scissor is (0,0,0,0), the driver acts as if the " "When the scissor is (0,0,0,0), the driver acts as if the scissor was disabled", &members,
"scissor was disabled", "http://anglebug.com/3407"};
&members, "http://anglebug.com/3407"};
// OES_depth_texture is a commonly expected feature on Android. However it // OES_depth_texture is a commonly expected feature on Android. However it
// requires that D16_UNORM support texture filtering // requires that D16_UNORM support texture filtering
// (e.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) and some devices // (e.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) and some devices
// do not. Work-around this by setting saying D16_UNORM supports filtering // do not. Work-around this by setting saying D16_UNORM supports filtering
// anyway. // anyway.
Feature forceD16TexFilter = {"force_D16_texture_filter", FeatureCategory::VulkanWorkarounds, Feature forceD16TexFilter = {
"On some Android devices, VK_FORMAT_D16_UNORM does not support " "force_D16_texture_filter", FeatureCategory::VulkanWorkarounds,
"VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, " "VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "
"which prevents OES_depth_texture from being supported.", "which prevents OES_depth_texture from being supported.",
&members, "http://anglebug.com/3452"}; &members, "http://anglebug.com/3452"};
...@@ -172,8 +166,8 @@ struct FeaturesVk : FeatureSetBase ...@@ -172,8 +166,8 @@ struct FeaturesVk : FeatureSetBase
// workaround makes sure this path is avoided. http://anglebug.com/3498 // workaround makes sure this path is avoided. http://anglebug.com/3498
Feature disableFlippingBlitWithCommand = { Feature disableFlippingBlitWithCommand = {
"disable_flipping_blit_with_command", FeatureCategory::VulkanWorkarounds, "disable_flipping_blit_with_command", FeatureCategory::VulkanWorkarounds,
"On some android devices, vkCmdBlitImage with flipped coordinates blits incorrectly.", "vkCmdBlitImage with flipped coordinates blits incorrectly.", &members,
&members, "http://anglebug.com/3498"}; "http://anglebug.com/3498"};
// On platform with Intel or AMD GPU, a window resizing would not trigger the vulkan driver to // On platform with Intel or AMD GPU, a window resizing would not trigger the vulkan driver to
// return VK_ERROR_OUT_OF_DATE on swapchain present. Work-around by query current window extent // return VK_ERROR_OUT_OF_DATE on swapchain present. Work-around by query current window extent
...@@ -181,9 +175,8 @@ struct FeaturesVk : FeatureSetBase ...@@ -181,9 +175,8 @@ struct FeaturesVk : FeatureSetBase
// http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625 // http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625
Feature perFrameWindowSizeQuery = { Feature perFrameWindowSizeQuery = {
"per_frame_window_size_query", FeatureCategory::VulkanWorkarounds, "per_frame_window_size_query", FeatureCategory::VulkanWorkarounds,
"On platform with Intel or AMD gpu, vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE" "Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members,
"when window resizing", "http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};
&members, "http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};
// On Pixel1XL and Pixel2, reset a vkCommandBuffer seems to have side effects on binding // On Pixel1XL and Pixel2, reset a vkCommandBuffer seems to have side effects on binding
// descriptor sets to it afterwards, Work-around by keep using transient vkCommandBuffer on // descriptor sets to it afterwards, Work-around by keep using transient vkCommandBuffer on
...@@ -191,22 +184,22 @@ struct FeaturesVk : FeatureSetBase ...@@ -191,22 +184,22 @@ struct FeaturesVk : FeatureSetBase
// http://b/135763283 // http://b/135763283
Feature transientCommandBuffer = { Feature transientCommandBuffer = {
"transient_command_buffer", FeatureCategory::VulkanWorkarounds, "transient_command_buffer", FeatureCategory::VulkanWorkarounds,
"On Pixel2, keep using transient vkCommandBuffer to work around driver issue in reseting" "Keep using transient vkCommandBuffer to work around driver issue in reseting"
"vkCommandBuffer", "vkCommandBuffer",
&members, "http://b/135763283"}; &members, "http://b/135763283"};
// Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed. // Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed.
Feature disallowSeamfulCubeMapEmulation = { Feature disallowSeamfulCubeMapEmulation = {
"disallow_seamful_cube_map_emulation", FeatureCategory::VulkanWorkarounds, "disallow_seamful_cube_map_emulation", FeatureCategory::VulkanWorkarounds,
"Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed", "Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members,
&members, "http://anglebug.com/3243"}; "http://anglebug.com/3243"};
// Qualcomm shader compiler doesn't support sampler arrays as parameters, so // Qualcomm shader compiler doesn't support sampler arrays as parameters, so
// revert to old RewriteStructSamplers behavior, which produces fewer. // revert to old RewriteStructSamplers behavior, which produces fewer.
Feature forceOldRewriteStructSamplers = { Feature forceOldRewriteStructSamplers = {
"force_old_rewrite_struct_samplers", FeatureCategory::VulkanWorkarounds, "force_old_rewrite_struct_samplers", FeatureCategory::VulkanWorkarounds,
"Qualcomm shader compiler doesn't support sampler arrays as parameters, so " "Some shader compilers don't support sampler arrays as parameters, so revert to old "
"revert to old RewriteStructSamplers behavior, which produces fewer.", "RewriteStructSamplers behavior, which produces fewer.",
&members, "http://anglebug.com/2703"}; &members, "http://anglebug.com/2703"};
}; };
......
...@@ -34,14 +34,14 @@ struct FrontendFeatures : angle::FeatureSetBase ...@@ -34,14 +34,14 @@ struct FrontendFeatures : angle::FeatureSetBase
angle::Feature disableProgramCachingForTransformFeedback = { angle::Feature disableProgramCachingForTransformFeedback = {
"disable_program_caching_for_transform_feedback", "disable_program_caching_for_transform_feedback",
angle::FeatureCategory::FrontendWorkarounds, angle::FeatureCategory::FrontendWorkarounds,
"On Qualcomm GPUs, program binaries don't contain transform feedback varyings", &members}; "On some GPUs, program binaries don't contain transform feedback varyings", &members};
// On Windows Intel OpenGL drivers TexImage sometimes seems to interact with the Framebuffer. // On Windows Intel OpenGL drivers TexImage sometimes seems to interact with the Framebuffer.
// Flaky crashes can occur unless we sync the Framebuffer bindings. The workaround is to add // Flaky crashes can occur unless we sync the Framebuffer bindings. The workaround is to add
// Framebuffer binding dirty bits to TexImage updates. See http://anglebug.com/2906 // Framebuffer binding dirty bits to TexImage updates. See http://anglebug.com/2906
angle::Feature syncFramebufferBindingsOnTexImage = { angle::Feature syncFramebufferBindingsOnTexImage = {
"sync_framebuffer_bindings_on_tex_image", angle::FeatureCategory::FrontendWorkarounds, "sync_framebuffer_bindings_on_tex_image", angle::FeatureCategory::FrontendWorkarounds,
"On Windows Intel OpenGL drivers TexImage sometimes seems to interact " "On some drivers TexImage sometimes seems to interact "
"with the Framebuffer", "with the Framebuffer",
&members}; &members};
......
...@@ -1389,8 +1389,8 @@ void Display::initVendorString() ...@@ -1389,8 +1389,8 @@ void Display::initVendorString()
void Display::initializeFrontendFeatures() void Display::initializeFrontendFeatures()
{ {
// Enable on all Impls // Enable on all Impls
mFrontendFeatures.loseContextOnOutOfMemory.enabled = true; ANGLE_FEATURE_CONDITION((&mFrontendFeatures), loseContextOnOutOfMemory, true)
mFrontendFeatures.scalarizeVecAndMatConstructorArgs.enabled = true; ANGLE_FEATURE_CONDITION((&mFrontendFeatures), scalarizeVecAndMatConstructorArgs, true)
mImplementation->initializeFrontendFeatures(&mFrontendFeatures); mImplementation->initializeFrontendFeatures(&mFrontendFeatures);
...@@ -1543,6 +1543,9 @@ const char *Display::queryStringi(const EGLint name, const EGLint index) ...@@ -1543,6 +1543,9 @@ const char *Display::queryStringi(const EGLint name, const EGLint index)
case EGL_FEATURE_STATUS_ANGLE: case EGL_FEATURE_STATUS_ANGLE:
result = angle::FeatureStatusToString(mFeatures[index]->enabled); result = angle::FeatureStatusToString(mFeatures[index]->enabled);
break; break;
case EGL_FEATURE_CONDITION_ANGLE:
result = mFeatures[index]->condition;
break;
default: default:
UNREACHABLE(); UNREACHABLE();
return nullptr; return nullptr;
......
...@@ -2382,84 +2382,91 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps, ...@@ -2382,84 +2382,91 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps,
const DXGI_ADAPTER_DESC &adapterDesc, const DXGI_ADAPTER_DESC &adapterDesc,
angle::FeaturesD3D *features) angle::FeaturesD3D *features)
{ {
bool is9_3 = (deviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3); bool isNvidia = IsNvidia(adapterDesc.VendorId);
bool isIntel = IsIntel(adapterDesc.VendorId);
bool isSkylake = false;
bool isBroadwell = false;
bool isHaswell = false;
bool isAMD = IsAMD(adapterDesc.VendorId);
bool isFeatureLevel9_3 = (deviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3);
IntelDriverVersion capsVersion = IntelDriverVersion(0);
if (isIntel)
{
capsVersion = d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion);
features->mrtPerfWorkaround.enabled = true; isSkylake = IsSkylake(adapterDesc.DeviceId);
features->setDataFasterThanImageUpload.enabled = true; isBroadwell = IsBroadwell(adapterDesc.DeviceId);
features->zeroMaxLodWorkaround.enabled = is9_3; isHaswell = IsHaswell(adapterDesc.DeviceId);
features->useInstancedPointSpriteEmulation.enabled = is9_3; }
// TODO(jmadill): Narrow problematic driver range. if (isNvidia)
if (IsNvidia(adapterDesc.VendorId))
{ {
if (deviceCaps.driverVersion.valid()) // TODO(jmadill): Narrow problematic driver range.
bool driverVersionValid = deviceCaps.driverVersion.valid();
if (driverVersionValid)
{ {
WORD part1 = HIWORD(deviceCaps.driverVersion.value().LowPart); WORD part1 = HIWORD(deviceCaps.driverVersion.value().LowPart);
WORD part2 = LOWORD(deviceCaps.driverVersion.value().LowPart); WORD part2 = LOWORD(deviceCaps.driverVersion.value().LowPart);
// Disable the workaround to fix a second driver bug on newer NVIDIA. // Disable the workaround to fix a second driver bug on newer NVIDIA.
features->depthStencilBlitExtraCopy.enabled = (part1 <= 13u && part2 < 6881); ANGLE_FEATURE_CONDITION(
features, depthStencilBlitExtraCopy,
(part1 <= 13u && part2 < 6881) && isNvidia && driverVersionValid)
} }
else else
{ {
features->depthStencilBlitExtraCopy.enabled = true; ANGLE_FEATURE_CONDITION(features, depthStencilBlitExtraCopy,
isNvidia && !driverVersionValid)
} }
} }
ANGLE_FEATURE_CONDITION(features, mrtPerfWorkaround, true)
ANGLE_FEATURE_CONDITION(features, zeroMaxLodWorkaround, isFeatureLevel9_3)
ANGLE_FEATURE_CONDITION(features, useInstancedPointSpriteEmulation, isFeatureLevel9_3)
// TODO(jmadill): Disable workaround when we have a fixed compiler DLL. // TODO(jmadill): Disable workaround when we have a fixed compiler DLL.
features->expandIntegerPowExpressions.enabled = true; ANGLE_FEATURE_CONDITION(features, expandIntegerPowExpressions, true)
features->flushAfterEndingTransformFeedback.enabled = IsNvidia(adapterDesc.VendorId); ANGLE_FEATURE_CONDITION(features, flushAfterEndingTransformFeedback, isNvidia)
features->getDimensionsIgnoresBaseLevel.enabled = IsNvidia(adapterDesc.VendorId); ANGLE_FEATURE_CONDITION(features, getDimensionsIgnoresBaseLevel, isNvidia)
features->skipVSConstantRegisterZero.enabled = IsNvidia(adapterDesc.VendorId); ANGLE_FEATURE_CONDITION(features, skipVSConstantRegisterZero, isNvidia)
features->forceAtomicValueResolution.enabled = IsNvidia(adapterDesc.VendorId); ANGLE_FEATURE_CONDITION(features, forceAtomicValueResolution, isNvidia)
if (IsIntel(adapterDesc.VendorId)) ANGLE_FEATURE_CONDITION(features, preAddTexelFetchOffsets, isIntel)
{ ANGLE_FEATURE_CONDITION(features, useSystemMemoryForConstantBuffers, isIntel)
IntelDriverVersion capsVersion = d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion);
features->preAddTexelFetchOffsets.enabled = true; ANGLE_FEATURE_CONDITION(features, callClearTwice,
features->useSystemMemoryForConstantBuffers.enabled = true; isIntel && isSkylake && capsVersion < IntelDriverVersion(4771))
features->disableB5G6R5Support.enabled = capsVersion < IntelDriverVersion(4539); ANGLE_FEATURE_CONDITION(features, emulateIsnanFloat,
features->addDummyTextureNoRenderTarget.enabled = capsVersion < IntelDriverVersion(4815); isIntel && isSkylake && capsVersion < IntelDriverVersion(4542))
if (IsSkylake(adapterDesc.DeviceId)) ANGLE_FEATURE_CONDITION(
{ features, rewriteUnaryMinusOperator,
features->callClearTwice.enabled = capsVersion < IntelDriverVersion(4771); isIntel && (isBroadwell || isHaswell) && capsVersion < IntelDriverVersion(4624))
features->emulateIsnanFloat.enabled = capsVersion < IntelDriverVersion(4542);
} ANGLE_FEATURE_CONDITION(features, addDummyTextureNoRenderTarget,
else if (IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId)) isIntel && capsVersion < IntelDriverVersion(4815))
{
features->rewriteUnaryMinusOperator.enabled = capsVersion < IntelDriverVersion(4624);
// Haswell drivers occasionally corrupt (small?) (vertex?) texture data uploads. // Haswell drivers occasionally corrupt (small?) (vertex?) texture data uploads.
features->setDataFasterThanImageUpload.enabled = false; ANGLE_FEATURE_CONDITION(features, setDataFasterThanImageUpload, !(isBroadwell || isHaswell))
}
}
if (IsAMD(adapterDesc.VendorId)) ANGLE_FEATURE_CONDITION(features, disableB5G6R5Support,
{ (isIntel && capsVersion < IntelDriverVersion(4539)) || isAMD)
features->disableB5G6R5Support.enabled = true;
}
// TODO(jmadill): Disable when we have a fixed driver version. // TODO(jmadill): Disable when we have a fixed driver version.
features->emulateTinyStencilTextures.enabled = IsAMD(adapterDesc.VendorId);
// The tiny stencil texture workaround involves using CopySubresource or UpdateSubresource on a // The tiny stencil texture workaround involves using CopySubresource or UpdateSubresource on a
// depth stencil texture. This is not allowed until feature level 10.1 but since it is not // depth stencil texture. This is not allowed until feature level 10.1 but since it is not
// possible to support ES3 on these devices, there is no need for the workaround to begin with // possible to support ES3 on these devices, there is no need for the workaround to begin with
// (anglebug.com/1572). // (anglebug.com/1572).
if (deviceCaps.featureLevel < D3D_FEATURE_LEVEL_10_1) ANGLE_FEATURE_CONDITION(features, emulateTinyStencilTextures,
{ isAMD && !(deviceCaps.featureLevel < D3D_FEATURE_LEVEL_10_1))
features->emulateTinyStencilTextures.enabled = false;
}
// If the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer feature is not available, we have to // If the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer feature is not available, we have to
// select the viewport / RT array index in the geometry shader. // select the viewport / RT array index in the geometry shader.
features->selectViewInGeometryShader.enabled = ANGLE_FEATURE_CONDITION(features, selectViewInGeometryShader,
(deviceCaps.supportsVpRtIndexWriteFromVertexShader == false); !deviceCaps.supportsVpRtIndexWriteFromVertexShader)
// Never clear for robust resource init. This matches Chrome's texture clearning behaviour. // Never clear for robust resource init. This matches Chrome's texture clearning behaviour.
features->allowClearForRobustResourceInit.enabled = false; ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, false)
// Call platform hooks for testing overrides. // Call platform hooks for testing overrides.
auto *platform = ANGLEPlatformCurrent(); auto *platform = ANGLEPlatformCurrent();
......
...@@ -805,15 +805,15 @@ void MakeValidSize(bool isImage, ...@@ -805,15 +805,15 @@ void MakeValidSize(bool isImage,
void InitializeFeatures(angle::FeaturesD3D *features) void InitializeFeatures(angle::FeaturesD3D *features)
{ {
features->mrtPerfWorkaround.enabled = true; ANGLE_FEATURE_CONDITION(features, mrtPerfWorkaround, true)
features->setDataFasterThanImageUpload.enabled = false; ANGLE_FEATURE_CONDITION(features, setDataFasterThanImageUpload, false)
features->useInstancedPointSpriteEmulation.enabled = false; ANGLE_FEATURE_CONDITION(features, useInstancedPointSpriteEmulation, false)
// TODO(jmadill): Disable workaround when we have a fixed compiler DLL. // TODO(jmadill): Disable workaround when we have a fixed compiler DLL.
features->expandIntegerPowExpressions.enabled = true; ANGLE_FEATURE_CONDITION(features, expandIntegerPowExpressions, true)
// Never clear for robust resource init. This matches Chrome's texture clearning behaviour. // Never clear for robust resource init. This matches Chrome's texture clearning behaviour.
features->allowClearForRobustResourceInit.enabled = false; ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, false)
// Call platform hooks for testing overrides. // Call platform hooks for testing overrides.
auto *platform = ANGLEPlatformCurrent(); auto *platform = ANGLEPlatformCurrent();
......
...@@ -34,6 +34,7 @@ using angle::CheckedNumeric; ...@@ -34,6 +34,7 @@ using angle::CheckedNumeric;
namespace rx namespace rx
{ {
VendorID GetVendorID(const FunctionsGL *functions) VendorID GetVendorID(const FunctionsGL *functions)
{ {
std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR))); std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR)));
...@@ -1440,126 +1441,138 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature ...@@ -1440,126 +1441,138 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
{ {
VendorID vendor = GetVendorID(functions); VendorID vendor = GetVendorID(functions);
uint32_t device = GetDeviceID(functions); uint32_t device = GetDeviceID(functions);
bool isAMD = IsAMD(vendor);
bool isIntel = IsIntel(vendor);
bool isNvidia = IsNvidia(vendor);
bool isQualcomm = IsQualcomm(vendor);
// Don't use 1-bit alpha formats on desktop GL with AMD or Intel drivers. // Don't use 1-bit alpha formats on desktop GL with AMD drivers.
features->avoid1BitAlphaTextureFormats.enabled = ANGLE_FEATURE_CONDITION(features, avoid1BitAlphaTextureFormats,
functions->standard == STANDARD_GL_DESKTOP && (IsAMD(vendor)); functions->standard == STANDARD_GL_DESKTOP && isAMD)
features->rgba4IsNotSupportedForColorRendering.enabled = ANGLE_FEATURE_CONDITION(features, rgba4IsNotSupportedForColorRendering,
functions->standard == STANDARD_GL_DESKTOP && IsIntel(vendor); functions->standard == STANDARD_GL_DESKTOP && isIntel)
features->emulateAbsIntFunction.enabled = IsIntel(vendor); ANGLE_FEATURE_CONDITION(features, emulateAbsIntFunction, isIntel)
features->addAndTrueToLoopCondition.enabled = IsIntel(vendor); ANGLE_FEATURE_CONDITION(features, addAndTrueToLoopCondition, isIntel)
features->emulateIsnanFloat.enabled = IsIntel(vendor); ANGLE_FEATURE_CONDITION(features, emulateIsnanFloat, isIntel)
features->doesSRGBClearsOnLinearFramebufferAttachments.enabled = ANGLE_FEATURE_CONDITION(features, doesSRGBClearsOnLinearFramebufferAttachments,
functions->standard == STANDARD_GL_DESKTOP && (IsIntel(vendor) || IsAMD(vendor)); functions->standard == STANDARD_GL_DESKTOP && (isIntel || isAMD))
features->emulateMaxVertexAttribStride.enabled = ANGLE_FEATURE_CONDITION(features, emulateMaxVertexAttribStride,
IsLinux() && functions->standard == STANDARD_GL_DESKTOP && IsAMD(vendor); IsLinux() && functions->standard == STANDARD_GL_DESKTOP && isAMD)
features->useUnusedBlocksWithStandardOrSharedLayout.enabled = IsLinux() && IsAMD(vendor); ANGLE_FEATURE_CONDITION(
features, useUnusedBlocksWithStandardOrSharedLayout,
(IsApple() && functions->standard == STANDARD_GL_DESKTOP) || (IsLinux() && isAMD))
features->doWhileGLSLCausesGPUHang.enabled = IsApple(); ANGLE_FEATURE_CONDITION(features, doWhileGLSLCausesGPUHang, IsApple())
features->useUnusedBlocksWithStandardOrSharedLayout.enabled = IsApple(); ANGLE_FEATURE_CONDITION(features, rewriteFloatUnaryMinusOperator, IsApple() && isIntel)
features->rewriteFloatUnaryMinusOperator.enabled = IsApple() && IsIntel(vendor);
features->addBaseVertexToVertexID.enabled = IsApple() && IsAMD(vendor); ANGLE_FEATURE_CONDITION(features, addBaseVertexToVertexID, IsApple() && isAMD)
// Triggers a bug on Marshmallow Adreno (4xx?) driver. // Triggers a bug on Marshmallow Adreno (4xx?) driver.
// http://anglebug.com/2046 // http://anglebug.com/2046
features->dontInitializeUninitializedLocals.enabled = IsAndroid() && IsQualcomm(vendor); ANGLE_FEATURE_CONDITION(features, dontInitializeUninitializedLocals, IsAndroid() && isQualcomm)
features->finishDoesNotCauseQueriesToBeAvailable.enabled = ANGLE_FEATURE_CONDITION(features, finishDoesNotCauseQueriesToBeAvailable,
functions->standard == STANDARD_GL_DESKTOP && IsNvidia(vendor); functions->standard == STANDARD_GL_DESKTOP && isNvidia)
// TODO(cwallez): Disable this workaround for MacOSX versions 10.9 or later. // TODO(cwallez): Disable this workaround for MacOSX versions 10.9 or later.
features->alwaysCallUseProgramAfterLink.enabled = true; ANGLE_FEATURE_CONDITION(features, alwaysCallUseProgramAfterLink, true)
features->unpackOverlappingRowsSeparatelyUnpackBuffer.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, unpackOverlappingRowsSeparatelyUnpackBuffer, isNvidia)
features->packOverlappingRowsSeparatelyPackBuffer.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, packOverlappingRowsSeparatelyPackBuffer, isNvidia)
features->initializeCurrentVertexAttributes.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, initializeCurrentVertexAttributes, isNvidia)
features->unpackLastRowSeparatelyForPaddingInclusion.enabled = IsApple() || IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, unpackLastRowSeparatelyForPaddingInclusion,
features->packLastRowSeparatelyForPaddingInclusion.enabled = IsApple() || IsNvidia(vendor); IsApple() || isNvidia)
ANGLE_FEATURE_CONDITION(features, packLastRowSeparatelyForPaddingInclusion,
IsApple() || isNvidia)
features->removeInvariantAndCentroidForESSL3.enabled = ANGLE_FEATURE_CONDITION(features, removeInvariantAndCentroidForESSL3,
functions->isAtMostGL(gl::Version(4, 1)) || functions->isAtMostGL(gl::Version(4, 1)) ||
(functions->standard == STANDARD_GL_DESKTOP && IsAMD(vendor)); (functions->standard == STANDARD_GL_DESKTOP && isAMD))
// TODO(oetuaho): Make this specific to the affected driver versions. Versions that came after // TODO(oetuaho): Make this specific to the affected driver versions. Versions that came after
// 364 are known to be affected, at least up to 375. // 364 are known to be affected, at least up to 375.
features->emulateAtan2Float.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, emulateAtan2Float, isNvidia)
features->reapplyUBOBindingsAfterUsingBinaryProgram.enabled = IsAMD(vendor); ANGLE_FEATURE_CONDITION(features, reapplyUBOBindingsAfterUsingBinaryProgram,
isAMD || IsAndroid())
features->rewriteVectorScalarArithmetic.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, rewriteVectorScalarArithmetic, isNvidia)
// TODO(oetuaho): Make this specific to the affected driver versions. Versions at least up to // TODO(oetuaho): Make this specific to the affected driver versions. Versions at least up to
// 390 are known to be affected. Versions after that are expected not to be affected. // 390 are known to be affected. Versions after that are expected not to be affected.
features->clampFragDepth.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, clampFragDepth, isNvidia)
// TODO(oetuaho): Make this specific to the affected driver versions. Versions since 397.31 are // TODO(oetuaho): Make this specific to the affected driver versions. Versions since 397.31 are
// not affected. // not affected.
features->rewriteRepeatedAssignToSwizzled.enabled = IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, rewriteRepeatedAssignToSwizzled, isNvidia)
// TODO(jmadill): Narrow workaround range for specific devices. // TODO(jmadill): Narrow workaround range for specific devices.
features->reapplyUBOBindingsAfterUsingBinaryProgram.enabled = IsAndroid();
features->clampPointSize.enabled = IsAndroid() || IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, clampPointSize, IsAndroid() || isNvidia)
features->dontUseLoopsToInitializeVariables.enabled = IsAndroid() && !IsNvidia(vendor); ANGLE_FEATURE_CONDITION(features, dontUseLoopsToInitializeVariables, IsAndroid() && !isNvidia)
features->disableBlendFuncExtended.enabled = IsAMD(vendor) || IsIntel(vendor); ANGLE_FEATURE_CONDITION(features, disableBlendFuncExtended, isAMD || isIntel)
features->unsizedsRGBReadPixelsDoesntTransform.enabled = IsAndroid() && IsQualcomm(vendor); ANGLE_FEATURE_CONDITION(features, unsizedsRGBReadPixelsDoesntTransform,
IsAndroid() && isQualcomm)
features->queryCounterBitsGeneratesErrors.enabled = IsNexus5X(vendor, device); ANGLE_FEATURE_CONDITION(features, queryCounterBitsGeneratesErrors, IsNexus5X(vendor, device))
features->dontRelinkProgramsInParallel.enabled = ANGLE_FEATURE_CONDITION(features, dontRelinkProgramsInParallel,
IsAndroid() || (IsWindows() && IsIntel(vendor)); IsAndroid() || (IsWindows() && isIntel))
// TODO(jie.a.chen@intel.com): Clean up the bugs. // TODO(jie.a.chen@intel.com): Clean up the bugs.
// anglebug.com/3031 // anglebug.com/3031
// crbug.com/922936 // crbug.com/922936
features->disableWorkerContexts.enabled = ANGLE_FEATURE_CONDITION(features, disableWorkerContexts,
(IsWindows() && (IsIntel(vendor) || IsAMD(vendor))) || (IsLinux() && IsNvidia(vendor)); (IsWindows() && (isIntel || isAMD)) || (IsLinux() && isNvidia))
features->limitMaxTextureSizeTo4096.enabled = IsAndroid() || (IsIntel(vendor) && IsLinux()); ANGLE_FEATURE_CONDITION(features, limitMaxTextureSizeTo4096,
features->limitMaxMSAASamplesTo4.enabled = IsAndroid(); IsAndroid() || (isIntel && IsLinux()))
features->limitMax3dArrayTextureSizeTo1024.enabled = IsIntel(vendor) && IsLinux(); ANGLE_FEATURE_CONDITION(features, limitMaxMSAASamplesTo4, IsAndroid())
ANGLE_FEATURE_CONDITION(features, limitMax3dArrayTextureSizeTo1024, isIntel && IsLinux())
features->allowClearForRobustResourceInit.enabled = IsApple(); ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, IsApple())
// The WebGL conformance/uniforms/out-of-bounds-uniform-array-access test has been seen to fail // The WebGL conformance/uniforms/out-of-bounds-uniform-array-access test has been seen to fail
// on AMD and Android devices. // on AMD and Android devices.
features->clampArrayAccess.enabled = IsAndroid() || IsAMD(vendor); ANGLE_FEATURE_CONDITION(features, clampArrayAccess, IsAndroid() || isAMD)
features->resetTexImage2DBaseLevel.enabled = ANGLE_FEATURE_CONDITION(features, resetTexImage2DBaseLevel,
IsApple() && IsIntel(vendor) && GetMacOSVersion() >= OSVersion(10, 12, 4); IsApple() && isIntel && GetMacOSVersion() >= OSVersion(10, 12, 4))
features->clearToZeroOrOneBroken.enabled = ANGLE_FEATURE_CONDITION(features, clearToZeroOrOneBroken,
IsApple() && IsIntel(vendor) && GetMacOSVersion() < OSVersion(10, 12, 6); IsApple() && isIntel && GetMacOSVersion() < OSVersion(10, 12, 6))
features->adjustSrcDstRegionBlitFramebuffer.enabled = ANGLE_FEATURE_CONDITION(features, adjustSrcDstRegionBlitFramebuffer,
IsLinux() || (IsAndroid() && IsNvidia(vendor)) || (IsWindows() && IsNvidia(vendor)); IsLinux() || (IsAndroid() && isNvidia) || (IsWindows() && isNvidia))
features->clipSrcRegionBlitFramebuffer.enabled = IsApple(); ANGLE_FEATURE_CONDITION(features, clipSrcRegionBlitFramebuffer, IsApple())
features->resettingTexturesGeneratesErrors.enabled = ANGLE_FEATURE_CONDITION(features, resettingTexturesGeneratesErrors,
IsApple() || (IsWindows() && IsAMD(device)); IsApple() || (IsWindows() && isAMD))
features->rgbDXT1TexturesSampleZeroAlpha.enabled = IsApple(); ANGLE_FEATURE_CONDITION(features, rgbDXT1TexturesSampleZeroAlpha, IsApple())
} }
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features) void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
{ {
VendorID vendor = GetVendorID(functions); VendorID vendor = GetVendorID(functions);
bool isIntel = IsIntel(vendor);
bool isQualcomm = IsQualcomm(vendor);
features->disableProgramCachingForTransformFeedback.enabled = IsAndroid() && IsQualcomm(vendor); ANGLE_FEATURE_CONDITION(features, disableProgramCachingForTransformFeedback,
features->syncFramebufferBindingsOnTexImage.enabled = IsWindows() && IsIntel(vendor); IsAndroid() && isQualcomm)
ANGLE_FEATURE_CONDITION(features, syncFramebufferBindingsOnTexImage, IsWindows() && isIntel)
} }
} // namespace nativegl_gl } // namespace nativegl_gl
......
...@@ -1245,131 +1245,99 @@ gl::Version RendererVk::getMaxConformantESVersion() const ...@@ -1245,131 +1245,99 @@ gl::Version RendererVk::getMaxConformantESVersion() const
void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames) void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames)
{ {
bool isAMD = IsAMD(mPhysicalDeviceProperties.vendorID);
bool isIntel = IsIntel(mPhysicalDeviceProperties.vendorID);
bool isNvidia = IsNvidia(mPhysicalDeviceProperties.vendorID);
bool isQualcomm = IsQualcomm(mPhysicalDeviceProperties.vendorID);
// Use OpenGL line rasterization rules by default. // Use OpenGL line rasterization rules by default.
// TODO(jmadill): Fix Android support. http://anglebug.com/2830 // TODO(jmadill): Fix Android support. http://anglebug.com/2830
#if defined(ANGLE_PLATFORM_ANDROID) ANGLE_FEATURE_CONDITION((&mFeatures), basicGLLineRasterization, !IsAndroid())
mFeatures.basicGLLineRasterization.enabled = false;
#else
mFeatures.basicGLLineRasterization.enabled = true;
#endif // defined(ANGLE_PLATFORM_ANDROID)
if ((mPhysicalDeviceProperties.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) ||
ExtensionFound(VK_KHR_MAINTENANCE1_EXTENSION_NAME, deviceExtensionNames))
{
// TODO(lucferron): Currently disabled on Intel only since many tests are failing and need // TODO(lucferron): Currently disabled on Intel only since many tests are failing and need
// investigation. http://anglebug.com/2728 // investigation. http://anglebug.com/2728
mFeatures.flipViewportY.enabled = !IsIntel(mPhysicalDeviceProperties.vendorID); ANGLE_FEATURE_CONDITION(
} (&mFeatures), flipViewportY,
!IsIntel(mPhysicalDeviceProperties.vendorID) &&
(mPhysicalDeviceProperties.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) ||
ExtensionFound(VK_KHR_MAINTENANCE1_EXTENSION_NAME, deviceExtensionNames))
#ifdef ANGLE_PLATFORM_WINDOWS
// http://anglebug.com/2838 // http://anglebug.com/2838
mFeatures.extraCopyBufferRegion.enabled = IsIntel(mPhysicalDeviceProperties.vendorID); ANGLE_FEATURE_CONDITION((&mFeatures), extraCopyBufferRegion, IsWindows() && isIntel)
// http://anglebug.com/3055 // http://anglebug.com/3055
mFeatures.forceCPUPathForCubeMapCopy.enabled = IsIntel(mPhysicalDeviceProperties.vendorID); ANGLE_FEATURE_CONDITION((&mFeatures), forceCPUPathForCubeMapCopy, IsWindows() && isIntel)
#endif
angle::PlatformMethods *platform = ANGLEPlatformCurrent();
platform->overrideFeaturesVk(platform, &mFeatures);
// Work around incorrect NVIDIA point size range clamping. // Work around incorrect NVIDIA point size range clamping.
// TODO(jmadill): Narrow driver range once fixed. http://anglebug.com/2970 // TODO(jmadill): Narrow driver range once fixed. http://anglebug.com/2970
if (IsNvidia(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), clampPointSize, isNvidia)
{
mFeatures.clampPointSize.enabled = true;
}
#if defined(ANGLE_PLATFORM_ANDROID)
// Work around ineffective compute-graphics barriers on Nexus 5X. // Work around ineffective compute-graphics barriers on Nexus 5X.
// TODO(syoussefi): Figure out which other vendors and driver versions are affected. // TODO(syoussefi): Figure out which other vendors and driver versions are affected.
// http://anglebug.com/3019 // http://anglebug.com/3019
mFeatures.flushAfterVertexConversion.enabled = ANGLE_FEATURE_CONDITION((&mFeatures), flushAfterVertexConversion,
IsNexus5X(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID); IsAndroid() && IsNexus5X(mPhysicalDeviceProperties.vendorID,
#endif mPhysicalDeviceProperties.deviceID))
if (ExtensionFound(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, deviceExtensionNames)) ANGLE_FEATURE_CONDITION(
{ (&mFeatures), supportsIncrementalPresent,
mFeatures.supportsIncrementalPresent.enabled = true; ExtensionFound(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, deviceExtensionNames))
}
#if defined(ANGLE_PLATFORM_ANDROID) #if defined(ANGLE_PLATFORM_ANDROID)
mFeatures.supportsAndroidHardwareBuffer.enabled = ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsAndroidHardwareBuffer,
IsAndroid() &&
ExtensionFound(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME, ExtensionFound(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME,
deviceExtensionNames) && deviceExtensionNames) &&
ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames); ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames))
#endif #endif
if (ExtensionFound(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, deviceExtensionNames)) ANGLE_FEATURE_CONDITION(
{ (&mFeatures), supportsExternalMemoryFd,
mFeatures.supportsExternalMemoryFd.enabled = true; ExtensionFound(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, deviceExtensionNames))
}
if (ExtensionFound(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, deviceExtensionNames)) ANGLE_FEATURE_CONDITION(
{ (&mFeatures), supportsExternalSemaphoreFd,
mFeatures.supportsExternalSemaphoreFd.enabled = true; ExtensionFound(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, deviceExtensionNames))
}
if (ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames)) ANGLE_FEATURE_CONDITION(
{ (&mFeatures), supportsShaderStencilExport,
mFeatures.supportsShaderStencilExport.enabled = true; ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames))
}
// TODO(syoussefi): when the code path using the extension is implemented, this should be // TODO(syoussefi): when the code path using the extension is implemented, this should be
// conditioned to the extension not being present as well. http://anglebug.com/3206 // conditioned to the extension not being present as well. http://anglebug.com/3206
if (mPhysicalDeviceFeatures.vertexPipelineStoresAndAtomics) ANGLE_FEATURE_CONDITION((&mFeatures), emulateTransformFeedback,
{ mPhysicalDeviceFeatures.vertexPipelineStoresAndAtomics)
mFeatures.emulateTransformFeedback.enabled = true;
}
if (IsLinux() && IsIntel(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), disableFifoPresentMode, IsLinux() && isIntel)
{
mFeatures.disableFifoPresentMode.enabled = true;
}
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), restartRenderPassAfterLoadOpClear,
{ IsAndroid() && isQualcomm && vk::CommandBuffer::ExecutesInline())
if (vk::CommandBuffer::ExecutesInline())
{
mFeatures.restartRenderPassAfterLoadOpClear.enabled = true;
}
mFeatures.bindEmptyForUnusedDescriptorSets.enabled = true; ANGLE_FEATURE_CONDITION((&mFeatures), bindEmptyForUnusedDescriptorSets,
IsAndroid() && isQualcomm)
mFeatures.forceOldRewriteStructSamplers.enabled = true; ANGLE_FEATURE_CONDITION((&mFeatures), forceOldRewriteStructSamplers, IsAndroid() && isQualcomm)
}
if (IsWindows() && IsIntel(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), forceNonZeroScissor, IsWindows() && isIntel)
{
mFeatures.forceNonZeroScissor.enabled = true;
}
if (IsIntel(mPhysicalDeviceProperties.vendorID) || ANGLE_FEATURE_CONDITION((&mFeatures), perFrameWindowSizeQuery,
(IsWindows() && IsAMD(mPhysicalDeviceProperties.vendorID))) isIntel || (IsWindows() && isAMD))
{
mFeatures.perFrameWindowSizeQuery.enabled = true;
}
if (IsWindows() && IsAMD(mPhysicalDeviceProperties.vendorID))
{
// Disabled on AMD/windows due to buggy behavior. // Disabled on AMD/windows due to buggy behavior.
mFeatures.disallowSeamfulCubeMapEmulation.enabled = true; ANGLE_FEATURE_CONDITION((&mFeatures), disallowSeamfulCubeMapEmulation, IsWindows() && isAMD)
}
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), forceD16TexFilter, IsAndroid() && isQualcomm)
{
mFeatures.forceD16TexFilter.enabled = true;
}
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID)) ANGLE_FEATURE_CONDITION((&mFeatures), disableFlippingBlitWithCommand, IsAndroid() && isQualcomm)
{
mFeatures.disableFlippingBlitWithCommand.enabled = true;
}
if (IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) || ANGLE_FEATURE_CONDITION(
(&mFeatures), transientCommandBuffer,
IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) ||
IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID)) IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID))
{
mFeatures.transientCommandBuffer.enabled = true; angle::PlatformMethods *platform = ANGLEPlatformCurrent();
} platform->overrideFeaturesVk(platform, &mFeatures);
} }
void RendererVk::initPipelineCacheVkKey() void RendererVk::initPipelineCacheVkKey()
......
...@@ -3941,6 +3941,7 @@ Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint inde ...@@ -3941,6 +3941,7 @@ Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint inde
case EGL_FEATURE_DESCRIPTION_ANGLE: case EGL_FEATURE_DESCRIPTION_ANGLE:
case EGL_FEATURE_BUG_ANGLE: case EGL_FEATURE_BUG_ANGLE:
case EGL_FEATURE_STATUS_ANGLE: case EGL_FEATURE_STATUS_ANGLE:
case EGL_FEATURE_CONDITION_ANGLE:
break; break;
default: default:
return EglBadParameter() << "name is not valid."; return EglBadParameter() << "name is not valid.";
......
...@@ -101,6 +101,8 @@ TEST_P(EGLFeatureControlTest, QueryAll) ...@@ -101,6 +101,8 @@ TEST_P(EGLFeatureControlTest, QueryAll)
EXPECT_STREQ(features[i]->bug, eglQueryStringiANGLE(mDisplay, EGL_FEATURE_BUG_ANGLE, i)); EXPECT_STREQ(features[i]->bug, eglQueryStringiANGLE(mDisplay, EGL_FEATURE_BUG_ANGLE, i));
EXPECT_STREQ(FeatureStatusToString(features[i]->enabled), EXPECT_STREQ(FeatureStatusToString(features[i]->enabled),
eglQueryStringiANGLE(mDisplay, EGL_FEATURE_STATUS_ANGLE, i)); eglQueryStringiANGLE(mDisplay, EGL_FEATURE_STATUS_ANGLE, i));
EXPECT_STREQ(features[i]->condition,
eglQueryStringiANGLE(mDisplay, EGL_FEATURE_CONDITION_ANGLE, i));
ASSERT_EGL_SUCCESS(); ASSERT_EGL_SUCCESS();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment