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
EGL_FEATURE_DESCRIPTION_ANGLE 0x3462
EGL_FEATURE_BUG_ANGLE 0x3463
EGL_FEATURE_STATUS_ANGLE 0x3464
EGL_FEATURE_CONDITION_ANGLE 0x3468
Accepted as a queried <attribute> in eglQueryDisplayAttribANGLE
......@@ -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
the value "enabled" if the feature is currently enabled, or
"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
......
......@@ -224,6 +224,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
#define EGL_FEATURE_COUNT_ANGLE 0x3465
#define EGL_FEATURE_OVERRIDES_ENABLED_ANGLE 0x3466
#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 EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
#ifdef EGL_EGLEXT_PROTOTYPES
......
......@@ -13,6 +13,10 @@
#include <string>
#include <vector>
#define ANGLE_FEATURE_CONDITION(set, feature, cond) \
set->feature.enabled = cond; \
set->feature.condition = ANGLE_STRINGIFY(cond);
namespace angle
{
......@@ -110,6 +114,9 @@ struct Feature
// Whether the workaround is enabled or not. Determined by heuristics like vendor ID and
// version, but may be overriden to any value.
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;
......@@ -118,7 +125,12 @@ inline Feature::Feature(const char *name,
const char *description,
FeatureMap *const mapPtr,
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)
{
......
......@@ -35,9 +35,9 @@ struct FeaturesD3D : FeatureSetBase
// 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
// in D3D11, by compacting the active color attachments list to omit null entries.
Feature mrtPerfWorkaround = {
"mrt_perf_workaround", FeatureCategory::D3DWorkarounds,
"Some NVIDIA D3D11 drivers have a bug where they ignore null render targets", &members};
Feature mrtPerfWorkaround = {"mrt_perf_workaround", FeatureCategory::D3DWorkarounds,
"Some drivers have a bug where they ignore null render targets",
&members};
Feature setDataFasterThanImageUpload = {"set_data_faster_than_image_upload",
FeatureCategory::D3DWorkarounds,
......@@ -50,9 +50,9 @@ struct FeaturesD3D : FeatureSetBase
// 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
// texture. The textures' level zeros are identical, but only one texture has mips.
Feature zeroMaxLodWorkaround = {
"zero_max_lod", FeatureCategory::D3DWorkarounds,
"D3D11 is missing an option to disable mipmaps on a mipmapped texture", &members};
Feature zeroMaxLodWorkaround = {"zero_max_lod", FeatureCategory::D3DWorkarounds,
"Missing an option to disable mipmaps on a mipmapped texture",
&members};
// 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
......@@ -68,8 +68,8 @@ struct FeaturesD3D : FeatureSetBase
// (See: http://anglebug.com/1452)
Feature depthStencilBlitExtraCopy = {
"depth_stencil_blit_extra_copy", FeatureCategory::D3DWorkarounds,
"Bug in NVIDIA D3D11 Driver version <=347.88 and >368.81 triggers a TDR when using "
"CopySubresourceRegion from a staging texture to a depth/stencil",
"Bug in some drivers triggers a TDR when using CopySubresourceRegion from a staging "
"texture to a depth/stencil",
&members, "http://anglebug.com/1452"};
// The HLSL optimizer has a bug with optimizing "pow" in certain integer-valued expressions.
......@@ -84,7 +84,7 @@ struct FeaturesD3D : FeatureSetBase
// feedback is used to repeatedly write to the same buffer positions.
Feature flushAfterEndingTransformFeedback = {
"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",
&members};
......@@ -92,7 +92,7 @@ struct FeaturesD3D : FeatureSetBase
// of the HLSL GetDimensions builtin.
Feature getDimensionsIgnoresBaseLevel = {
"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",
&members};
......@@ -104,8 +104,8 @@ struct FeaturesD3D : FeatureSetBase
// by adding Offset directly to Location before reading the texture.
Feature preAddTexelFetchOffsets = {
"pre_add_texel_fetch_offsets", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, HLSL's function texture.Load returns 0 when the parameter Location "
"is negative, even if the sum of Offset and Location is in range",
"HLSL's function texture.Load returns 0 when the parameter Location is negative, even if "
"the sum of Offset and Location is in range",
&members};
// On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly.
......@@ -113,8 +113,7 @@ struct FeaturesD3D : FeatureSetBase
// before we sample.
Feature emulateTinyStencilTextures = {
"emulate_tiny_stencil_textures", FeatureCategory::D3DWorkarounds,
"On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly",
&members};
"1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly", &members};
// 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
......@@ -122,7 +121,7 @@ struct FeaturesD3D : FeatureSetBase
// On older AMD drivers, the data in DXGI_FORMAT_B5G6R5_UNORM becomes corrupted for unknown
// reasons.
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",
&members};
......@@ -131,33 +130,31 @@ struct FeaturesD3D : FeatureSetBase
// This driver bug is fixed in 20.19.15.4624.
Feature rewriteUnaryMinusOperator = {
"rewrite_unary_minus_operator", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, evaluating unary minus operator on integer may "
"get wrong answer in vertex shaders",
"Evaluating unary minus operator on integer may get wrong answer in vertex shaders",
&members};
// 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().
// Tracking bug: https://crbug.com/650547
// This driver bug is fixed in 21.20.16.4542.
Feature emulateIsnanFloat = {
"emulate_isnan_float", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, using isnan() on highp float will get wrong answer", &members,
Feature emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::D3DWorkarounds,
"Using isnan() on highp float will get wrong answer", &members,
"https://crbug.com/650547"};
// On some Intel drivers, using clear() may not take effect. To work around this bug, we call
// clear() twice on these platforms.
// Tracking bug: https://crbug.com/655534
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"};
// 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
// for buffer data.
// D3D11-only workaround. See http://crbug.com/593024.
Feature useSystemMemoryForConstantBuffers = {
"use_system_memory_for_constant_buffers", FeatureCategory::D3DWorkarounds,
"On some Intel drivers, copying from staging storage to constant buffer "
Feature useSystemMemoryForConstantBuffers = {"use_system_memory_for_constant_buffers",
FeatureCategory::D3DWorkarounds,
"Copying from staging storage to constant buffer "
"storage does not work",
&members, "https://crbug.com/593024"};
......@@ -181,8 +178,7 @@ struct FeaturesD3D : FeatureSetBase
// So we add a dummy texture as render target in such case. See http://anglebug.com/2152
Feature addDummyTextureNoRenderTarget = {
"add_dummy_texture_no_render_target", FeatureCategory::D3DWorkarounds,
"On D3D ntel drivers <4815 when rendering with no render target, two "
"bugs lead to incorrect behavior",
"On some drivers when rendering with no render target, two bugs lead to incorrect behavior",
&members, "http://anglebug.com/2152"};
// Don't use D3D constant register zero when allocating space for uniforms in the vertex shader.
......@@ -190,9 +186,7 @@ struct FeaturesD3D : FeatureSetBase
// specific cases the driver would not handle constant register zero correctly.
Feature skipVSConstantRegisterZero = {
"skip_vs_constant_register_zero", FeatureCategory::D3DWorkarounds,
"On NVIDIA D3D driver v388.59 in specific cases the driver doesn't "
"handle constant register zero correctly",
&members};
"In specific cases the driver doesn't handle constant register zero correctly", &members};
// 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
......@@ -201,8 +195,8 @@ struct FeaturesD3D : FeatureSetBase
// http://anglebug.com/3246
Feature forceAtomicValueResolution = {
"force_atomic_value_resolution", FeatureCategory::D3DWorkarounds,
"On an NVIDIA D3D driver, the return value from RWByteAddressBuffer.InterlockedAdd does "
"not resolve when used in the .yzw components of a RWByteAddressBuffer.Store operation",
"On some drivers the return value from RWByteAddressBuffer.InterlockedAdd does not resolve "
"when used in the .yzw components of a RWByteAddressBuffer.Store operation",
&members, "http://anglebug.com/3246"};
// Match chromium's robust resource init behaviour by always prefering to upload texture data
......
......@@ -49,8 +49,7 @@ struct FeaturesVk : FeatureSetBase
// to have a bug where the last region is ignored.
Feature extraCopyBufferRegion = {
"extra_copy_buffer_region", FeatureCategory::VulkanWorkarounds,
"Windows Intel driver seems to have a bug where the last copy region in "
"vkCmdCopyBuffer is ignored",
"Some drivers seem to have a bug where the last copy region in vkCmdCopyBuffer is ignored",
&members};
// This flag is added for the sole purpose of end2end tests, to test the correctness
......@@ -64,8 +63,7 @@ struct FeaturesVk : FeatureSetBase
// Tracked in http://anglebug.com/2970.
Feature clampPointSize = {
"clamp_point_size", FeatureCategory::VulkanWorkarounds,
"On some NVIDIA drivers, the point size range reported from the API is "
"inconsistent with the actual behavior",
"The point size range reported from the API is inconsistent with the actual behavior",
&members, "http://anglebug.com/2970"};
// On some android devices, the memory barrier between the compute shader that converts vertex
......@@ -73,8 +71,8 @@ struct FeaturesVk : FeatureSetBase
// to perform a flush after the conversion. http://anglebug.com/3016
Feature flushAfterVertexConversion = {
"flush_after_vertex_conversion", FeatureCategory::VulkanWorkarounds,
"On some android devices, the memory barrier between the compute shader that converts "
"vertex attributes and the vertex shader that reads from it is ineffective",
"The memory barrier between the compute shader that converts vertex attributes and the "
"vertex shader that reads from it is ineffective",
&members, "http://anglebug.com/3016"};
// Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the
......@@ -88,8 +86,7 @@ struct FeaturesVk : FeatureSetBase
// textures.
Feature forceCPUPathForCubeMapCopy = {
"force_cpu_path_for_cube_map_copy", FeatureCategory::VulkanWorkarounds,
"Some Intel Windows drivers have an issue with creating single-layer "
"views on cube map textures",
"Some drivers have an issue with creating single-layer views on cube map textures",
&members};
// Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer
......@@ -128,15 +125,13 @@ struct FeaturesVk : FeatureSetBase
// VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153
Feature disableFifoPresentMode = {
"disable_fifo_present_mode", FeatureCategory::VulkanWorkarounds,
"On Linux Intel, VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members,
"http://anglebug.com/3153"};
"VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, "http://anglebug.com/3153"};
// On Qualcomm, a bug is preventing us from using loadOp=Clear with inline commands in the
// render pass. http://anglebug.com/2361
Feature restartRenderPassAfterLoadOpClear = {
"restart_render_pass_after_load_op_clear", FeatureCategory::VulkanWorkarounds,
"On Qualcomm, a bug is preventing us from using loadOp=Clear with inline "
"commands in the render pass",
"A bug is preventing us from using loadOp=Clear with inline commands in the render pass",
&members, "http://anglebug.com/2361"};
// On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave.
......@@ -145,26 +140,25 @@ struct FeaturesVk : FeatureSetBase
// unused descriptor set to work around this issue. http://anglebug.com/2727
Feature bindEmptyForUnusedDescriptorSets = {
"bind_empty_for_unused_descriptor_sets", FeatureCategory::VulkanWorkarounds,
"On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave",
&members, "http://anglebug.com/2727"};
"Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members,
"http://anglebug.com/2727"};
// 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
// (e.g. (renderArea.x, renderArea.y, 1, 1)). http://anglebug.com/3407
Feature forceNonZeroScissor = {
"force_non_zero_scissor", FeatureCategory::VulkanWorkarounds,
"On Windows Intel, when the scissor is (0,0,0,0), the driver acts as if the "
"scissor was disabled",
&members, "http://anglebug.com/3407"};
"When the scissor is (0,0,0,0), the driver acts as if the scissor was disabled", &members,
"http://anglebug.com/3407"};
// OES_depth_texture is a commonly expected feature on Android. However it
// requires that D16_UNORM support texture filtering
// (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
// anyway.
Feature forceD16TexFilter = {"force_D16_texture_filter", FeatureCategory::VulkanWorkarounds,
"On some Android devices, VK_FORMAT_D16_UNORM does not support "
"VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "
Feature forceD16TexFilter = {
"force_D16_texture_filter", FeatureCategory::VulkanWorkarounds,
"VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, "
"which prevents OES_depth_texture from being supported.",
&members, "http://anglebug.com/3452"};
......@@ -172,8 +166,8 @@ struct FeaturesVk : FeatureSetBase
// workaround makes sure this path is avoided. http://anglebug.com/3498
Feature disableFlippingBlitWithCommand = {
"disable_flipping_blit_with_command", FeatureCategory::VulkanWorkarounds,
"On some android devices, vkCmdBlitImage with flipped coordinates blits incorrectly.",
&members, "http://anglebug.com/3498"};
"vkCmdBlitImage with flipped coordinates blits incorrectly.", &members,
"http://anglebug.com/3498"};
// 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
......@@ -181,9 +175,8 @@ struct FeaturesVk : FeatureSetBase
// http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625
Feature perFrameWindowSizeQuery = {
"per_frame_window_size_query", FeatureCategory::VulkanWorkarounds,
"On platform with Intel or AMD gpu, vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE"
"when window resizing",
&members, "http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"};
"Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &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
// descriptor sets to it afterwards, Work-around by keep using transient vkCommandBuffer on
......@@ -191,22 +184,22 @@ struct FeaturesVk : FeatureSetBase
// http://b/135763283
Feature transientCommandBuffer = {
"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",
&members, "http://b/135763283"};
// Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed.
Feature disallowSeamfulCubeMapEmulation = {
"disallow_seamful_cube_map_emulation", FeatureCategory::VulkanWorkarounds,
"Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed",
&members, "http://anglebug.com/3243"};
"Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members,
"http://anglebug.com/3243"};
// Qualcomm shader compiler doesn't support sampler arrays as parameters, so
// revert to old RewriteStructSamplers behavior, which produces fewer.
Feature forceOldRewriteStructSamplers = {
"force_old_rewrite_struct_samplers", FeatureCategory::VulkanWorkarounds,
"Qualcomm shader compiler doesn't support sampler arrays as parameters, so "
"revert to old RewriteStructSamplers behavior, which produces fewer.",
"Some shader compilers don't support sampler arrays as parameters, so revert to old "
"RewriteStructSamplers behavior, which produces fewer.",
&members, "http://anglebug.com/2703"};
};
......
......@@ -34,14 +34,14 @@ struct FrontendFeatures : angle::FeatureSetBase
angle::Feature disableProgramCachingForTransformFeedback = {
"disable_program_caching_for_transform_feedback",
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.
// 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
angle::Feature syncFramebufferBindingsOnTexImage = {
"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",
&members};
......
......@@ -1389,8 +1389,8 @@ void Display::initVendorString()
void Display::initializeFrontendFeatures()
{
// Enable on all Impls
mFrontendFeatures.loseContextOnOutOfMemory.enabled = true;
mFrontendFeatures.scalarizeVecAndMatConstructorArgs.enabled = true;
ANGLE_FEATURE_CONDITION((&mFrontendFeatures), loseContextOnOutOfMemory, true)
ANGLE_FEATURE_CONDITION((&mFrontendFeatures), scalarizeVecAndMatConstructorArgs, true)
mImplementation->initializeFrontendFeatures(&mFrontendFeatures);
......@@ -1543,6 +1543,9 @@ const char *Display::queryStringi(const EGLint name, const EGLint index)
case EGL_FEATURE_STATUS_ANGLE:
result = angle::FeatureStatusToString(mFeatures[index]->enabled);
break;
case EGL_FEATURE_CONDITION_ANGLE:
result = mFeatures[index]->condition;
break;
default:
UNREACHABLE();
return nullptr;
......
......@@ -2382,84 +2382,91 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps,
const DXGI_ADAPTER_DESC &adapterDesc,
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;
features->setDataFasterThanImageUpload.enabled = true;
features->zeroMaxLodWorkaround.enabled = is9_3;
features->useInstancedPointSpriteEmulation.enabled = is9_3;
isSkylake = IsSkylake(adapterDesc.DeviceId);
isBroadwell = IsBroadwell(adapterDesc.DeviceId);
isHaswell = IsHaswell(adapterDesc.DeviceId);
}
// TODO(jmadill): Narrow problematic driver range.
if (IsNvidia(adapterDesc.VendorId))
if (isNvidia)
{
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 part2 = LOWORD(deviceCaps.driverVersion.value().LowPart);
// 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
{
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.
features->expandIntegerPowExpressions.enabled = true;
ANGLE_FEATURE_CONDITION(features, expandIntegerPowExpressions, true)
features->flushAfterEndingTransformFeedback.enabled = IsNvidia(adapterDesc.VendorId);
features->getDimensionsIgnoresBaseLevel.enabled = IsNvidia(adapterDesc.VendorId);
features->skipVSConstantRegisterZero.enabled = IsNvidia(adapterDesc.VendorId);
features->forceAtomicValueResolution.enabled = IsNvidia(adapterDesc.VendorId);
ANGLE_FEATURE_CONDITION(features, flushAfterEndingTransformFeedback, isNvidia)
ANGLE_FEATURE_CONDITION(features, getDimensionsIgnoresBaseLevel, isNvidia)
ANGLE_FEATURE_CONDITION(features, skipVSConstantRegisterZero, isNvidia)
ANGLE_FEATURE_CONDITION(features, forceAtomicValueResolution, isNvidia)
if (IsIntel(adapterDesc.VendorId))
{
IntelDriverVersion capsVersion = d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion);
ANGLE_FEATURE_CONDITION(features, preAddTexelFetchOffsets, isIntel)
ANGLE_FEATURE_CONDITION(features, useSystemMemoryForConstantBuffers, isIntel)
features->preAddTexelFetchOffsets.enabled = true;
features->useSystemMemoryForConstantBuffers.enabled = true;
features->disableB5G6R5Support.enabled = capsVersion < IntelDriverVersion(4539);
features->addDummyTextureNoRenderTarget.enabled = capsVersion < IntelDriverVersion(4815);
if (IsSkylake(adapterDesc.DeviceId))
{
features->callClearTwice.enabled = capsVersion < IntelDriverVersion(4771);
features->emulateIsnanFloat.enabled = capsVersion < IntelDriverVersion(4542);
}
else if (IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId))
{
features->rewriteUnaryMinusOperator.enabled = capsVersion < IntelDriverVersion(4624);
ANGLE_FEATURE_CONDITION(features, callClearTwice,
isIntel && isSkylake && capsVersion < IntelDriverVersion(4771))
ANGLE_FEATURE_CONDITION(features, emulateIsnanFloat,
isIntel && isSkylake && capsVersion < IntelDriverVersion(4542))
ANGLE_FEATURE_CONDITION(
features, rewriteUnaryMinusOperator,
isIntel && (isBroadwell || isHaswell) && capsVersion < IntelDriverVersion(4624))
ANGLE_FEATURE_CONDITION(features, addDummyTextureNoRenderTarget,
isIntel && capsVersion < IntelDriverVersion(4815))
// Haswell drivers occasionally corrupt (small?) (vertex?) texture data uploads.
features->setDataFasterThanImageUpload.enabled = false;
}
}
ANGLE_FEATURE_CONDITION(features, setDataFasterThanImageUpload, !(isBroadwell || isHaswell))
if (IsAMD(adapterDesc.VendorId))
{
features->disableB5G6R5Support.enabled = true;
}
ANGLE_FEATURE_CONDITION(features, disableB5G6R5Support,
(isIntel && capsVersion < IntelDriverVersion(4539)) || isAMD)
// 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
// 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
// (anglebug.com/1572).
if (deviceCaps.featureLevel < D3D_FEATURE_LEVEL_10_1)
{
features->emulateTinyStencilTextures.enabled = false;
}
ANGLE_FEATURE_CONDITION(features, emulateTinyStencilTextures,
isAMD && !(deviceCaps.featureLevel < D3D_FEATURE_LEVEL_10_1))
// If the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer feature is not available, we have to
// select the viewport / RT array index in the geometry shader.
features->selectViewInGeometryShader.enabled =
(deviceCaps.supportsVpRtIndexWriteFromVertexShader == false);
ANGLE_FEATURE_CONDITION(features, selectViewInGeometryShader,
!deviceCaps.supportsVpRtIndexWriteFromVertexShader)
// 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.
auto *platform = ANGLEPlatformCurrent();
......
......@@ -805,15 +805,15 @@ void MakeValidSize(bool isImage,
void InitializeFeatures(angle::FeaturesD3D *features)
{
features->mrtPerfWorkaround.enabled = true;
features->setDataFasterThanImageUpload.enabled = false;
features->useInstancedPointSpriteEmulation.enabled = false;
ANGLE_FEATURE_CONDITION(features, mrtPerfWorkaround, true)
ANGLE_FEATURE_CONDITION(features, setDataFasterThanImageUpload, false)
ANGLE_FEATURE_CONDITION(features, useInstancedPointSpriteEmulation, false)
// 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.
features->allowClearForRobustResourceInit.enabled = false;
ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, false)
// Call platform hooks for testing overrides.
auto *platform = ANGLEPlatformCurrent();
......
......@@ -1245,131 +1245,99 @@ gl::Version RendererVk::getMaxConformantESVersion() const
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.
// TODO(jmadill): Fix Android support. http://anglebug.com/2830
#if defined(ANGLE_PLATFORM_ANDROID)
mFeatures.basicGLLineRasterization.enabled = false;
#else
mFeatures.basicGLLineRasterization.enabled = true;
#endif // defined(ANGLE_PLATFORM_ANDROID)
ANGLE_FEATURE_CONDITION((&mFeatures), basicGLLineRasterization, !IsAndroid())
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
// 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
mFeatures.extraCopyBufferRegion.enabled = IsIntel(mPhysicalDeviceProperties.vendorID);
ANGLE_FEATURE_CONDITION((&mFeatures), extraCopyBufferRegion, IsWindows() && isIntel)
// http://anglebug.com/3055
mFeatures.forceCPUPathForCubeMapCopy.enabled = IsIntel(mPhysicalDeviceProperties.vendorID);
#endif
angle::PlatformMethods *platform = ANGLEPlatformCurrent();
platform->overrideFeaturesVk(platform, &mFeatures);
ANGLE_FEATURE_CONDITION((&mFeatures), forceCPUPathForCubeMapCopy, IsWindows() && isIntel)
// Work around incorrect NVIDIA point size range clamping.
// TODO(jmadill): Narrow driver range once fixed. http://anglebug.com/2970
if (IsNvidia(mPhysicalDeviceProperties.vendorID))
{
mFeatures.clampPointSize.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), clampPointSize, isNvidia)
#if defined(ANGLE_PLATFORM_ANDROID)
// Work around ineffective compute-graphics barriers on Nexus 5X.
// TODO(syoussefi): Figure out which other vendors and driver versions are affected.
// http://anglebug.com/3019
mFeatures.flushAfterVertexConversion.enabled =
IsNexus5X(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID);
#endif
ANGLE_FEATURE_CONDITION((&mFeatures), flushAfterVertexConversion,
IsAndroid() && IsNexus5X(mPhysicalDeviceProperties.vendorID,
mPhysicalDeviceProperties.deviceID))
if (ExtensionFound(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, deviceExtensionNames))
{
mFeatures.supportsIncrementalPresent.enabled = true;
}
ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsIncrementalPresent,
ExtensionFound(VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME, deviceExtensionNames))
#if defined(ANGLE_PLATFORM_ANDROID)
mFeatures.supportsAndroidHardwareBuffer.enabled =
ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsAndroidHardwareBuffer,
IsAndroid() &&
ExtensionFound(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME,
deviceExtensionNames) &&
ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames);
ExtensionFound(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME, deviceExtensionNames))
#endif
if (ExtensionFound(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, deviceExtensionNames))
{
mFeatures.supportsExternalMemoryFd.enabled = true;
}
ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsExternalMemoryFd,
ExtensionFound(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, deviceExtensionNames))
if (ExtensionFound(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, deviceExtensionNames))
{
mFeatures.supportsExternalSemaphoreFd.enabled = true;
}
ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsExternalSemaphoreFd,
ExtensionFound(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, deviceExtensionNames))
if (ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames))
{
mFeatures.supportsShaderStencilExport.enabled = true;
}
ANGLE_FEATURE_CONDITION(
(&mFeatures), supportsShaderStencilExport,
ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames))
// 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
if (mPhysicalDeviceFeatures.vertexPipelineStoresAndAtomics)
{
mFeatures.emulateTransformFeedback.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), emulateTransformFeedback,
mPhysicalDeviceFeatures.vertexPipelineStoresAndAtomics)
if (IsLinux() && IsIntel(mPhysicalDeviceProperties.vendorID))
{
mFeatures.disableFifoPresentMode.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), disableFifoPresentMode, IsLinux() && isIntel)
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID))
{
if (vk::CommandBuffer::ExecutesInline())
{
mFeatures.restartRenderPassAfterLoadOpClear.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), restartRenderPassAfterLoadOpClear,
IsAndroid() && isQualcomm && vk::CommandBuffer::ExecutesInline())
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))
{
mFeatures.forceNonZeroScissor.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), forceNonZeroScissor, IsWindows() && isIntel)
if (IsIntel(mPhysicalDeviceProperties.vendorID) ||
(IsWindows() && IsAMD(mPhysicalDeviceProperties.vendorID)))
{
mFeatures.perFrameWindowSizeQuery.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), perFrameWindowSizeQuery,
isIntel || (IsWindows() && isAMD))
if (IsWindows() && IsAMD(mPhysicalDeviceProperties.vendorID))
{
// Disabled on AMD/windows due to buggy behavior.
mFeatures.disallowSeamfulCubeMapEmulation.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), disallowSeamfulCubeMapEmulation, IsWindows() && isAMD)
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID))
{
mFeatures.forceD16TexFilter.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), forceD16TexFilter, IsAndroid() && isQualcomm)
if (IsAndroid() && IsQualcomm(mPhysicalDeviceProperties.vendorID))
{
mFeatures.disableFlippingBlitWithCommand.enabled = true;
}
ANGLE_FEATURE_CONDITION((&mFeatures), disableFlippingBlitWithCommand, IsAndroid() && isQualcomm)
if (IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) ||
ANGLE_FEATURE_CONDITION(
(&mFeatures), transientCommandBuffer,
IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) ||
IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID))
{
mFeatures.transientCommandBuffer.enabled = true;
}
angle::PlatformMethods *platform = ANGLEPlatformCurrent();
platform->overrideFeaturesVk(platform, &mFeatures);
}
void RendererVk::initPipelineCacheVkKey()
......
......@@ -3941,6 +3941,7 @@ Error ValidateQueryStringiANGLE(const Display *display, EGLint name, EGLint inde
case EGL_FEATURE_DESCRIPTION_ANGLE:
case EGL_FEATURE_BUG_ANGLE:
case EGL_FEATURE_STATUS_ANGLE:
case EGL_FEATURE_CONDITION_ANGLE:
break;
default:
return EglBadParameter() << "name is not valid.";
......
......@@ -101,6 +101,8 @@ TEST_P(EGLFeatureControlTest, QueryAll)
EXPECT_STREQ(features[i]->bug, eglQueryStringiANGLE(mDisplay, EGL_FEATURE_BUG_ANGLE, i));
EXPECT_STREQ(FeatureStatusToString(features[i]->enabled),
eglQueryStringiANGLE(mDisplay, EGL_FEATURE_STATUS_ANGLE, i));
EXPECT_STREQ(features[i]->condition,
eglQueryStringiANGLE(mDisplay, EGL_FEATURE_CONDITION_ANGLE, i));
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