Commit 62475e95 by Jamie Madill Committed by Commit Bot

Allow tests to pick ANGLE features.

This uses the EGL_ANGLE_feature_control extension through the test harness to control feature selection via a test config. This obviates the need for the hacky platform methods table override. Also adds a command graph feature that will be used to prototype the command graph linearization for Vulkan. Bug: angleproject:4029 Change-Id: Id37fadd5d2c317c9d9dd90dfab1fdc8e4ac3701f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2007612 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent 0c10c952
...@@ -238,6 +238,14 @@ struct FeaturesVk : FeatureSetBase ...@@ -238,6 +238,14 @@ struct FeaturesVk : FeatureSetBase
"supports_swapchain_colorspace", FeatureCategory::VulkanFeatures, "supports_swapchain_colorspace", FeatureCategory::VulkanFeatures,
"VkDevice supports the VK_EXT_swapchain_colorspace extension", &members, "VkDevice supports the VK_EXT_swapchain_colorspace extension", &members,
"http://anglebug.com/2514"}; "http://anglebug.com/2514"};
// Whether to use ANGLE's deferred command graph. http://anglebug.com/4029
Feature commandGraph = {
"command_graph",
FeatureCategory::VulkanFeatures,
"Use ANGLE's Vulkan deferred command graph.",
&members,
};
}; };
inline FeaturesVk::FeaturesVk() = default; inline FeaturesVk::FeaturesVk() = default;
......
...@@ -1479,6 +1479,8 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames) ...@@ -1479,6 +1479,8 @@ void RendererVk::initFeatures(const ExtensionNameList &deviceExtensionNames)
IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) || IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) ||
IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID)); IsPixel1XL(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID));
ANGLE_FEATURE_CONDITION((&mFeatures), commandGraph, true);
angle::PlatformMethods *platform = ANGLEPlatformCurrent(); angle::PlatformMethods *platform = ANGLEPlatformCurrent();
platform->overrideFeaturesVk(platform, &mFeatures); platform->overrideFeaturesVk(platform, &mFeatures);
} }
......
...@@ -187,6 +187,15 @@ std::ostream &operator<<(std::ostream &stream, const PlatformParameters &pp) ...@@ -187,6 +187,15 @@ std::ostream &operator<<(std::ostream &stream, const PlatformParameters &pp)
stream << "_NoVirtual"; stream << "_NoVirtual";
} }
if (pp.eglParameters.commandGraphFeature == EGL_FALSE)
{
stream << "_NoCommandGraph";
}
else if (pp.eglParameters.commandGraphFeature == EGL_TRUE)
{
stream << "_CommandGraph";
}
return stream; return stream;
} }
......
...@@ -206,6 +206,13 @@ inline PlatformParameters WithNoFixture(const PlatformParameters &params) ...@@ -206,6 +206,13 @@ inline PlatformParameters WithNoFixture(const PlatformParameters &params)
withNoFixture.noFixture = true; withNoFixture.noFixture = true;
return withNoFixture; return withNoFixture;
} }
inline PlatformParameters WithNoCommandGraph(const PlatformParameters &params)
{
PlatformParameters withNoCommandGraph = params;
withNoCommandGraph.eglParameters.commandGraphFeature = EGL_FALSE;
return withNoCommandGraph;
}
} // namespace angle } // namespace angle
#endif // ANGLE_TEST_CONFIGS_H_ #endif // ANGLE_TEST_CONFIGS_H_
...@@ -58,6 +58,7 @@ struct EGLPlatformParameters ...@@ -58,6 +58,7 @@ struct EGLPlatformParameters
EGLint presentPath = EGL_DONT_CARE; EGLint presentPath = EGL_DONT_CARE;
EGLint debugLayersEnabled = EGL_DONT_CARE; EGLint debugLayersEnabled = EGL_DONT_CARE;
EGLint contextVirtualization = EGL_DONT_CARE; EGLint contextVirtualization = EGL_DONT_CARE;
EGLint commandGraphFeature = EGL_DONT_CARE;
angle::PlatformMethods *platformMethods = nullptr; angle::PlatformMethods *platformMethods = nullptr;
}; };
......
...@@ -120,6 +120,9 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow, ...@@ -120,6 +120,9 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow,
angle::LoadEGL(getProcAddress); angle::LoadEGL(getProcAddress);
#endif // defined(ANGLE_USE_UTIL_LOADER) #endif // defined(ANGLE_USE_UTIL_LOADER)
const char *extensionString =
static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
std::vector<EGLAttrib> displayAttributes; std::vector<EGLAttrib> displayAttributes;
displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); displayAttributes.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE);
displayAttributes.push_back(params.renderer); displayAttributes.push_back(params.renderer);
...@@ -136,8 +139,6 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow, ...@@ -136,8 +139,6 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow,
if (params.presentPath != EGL_DONT_CARE) if (params.presentPath != EGL_DONT_CARE)
{ {
const char *extensionString =
static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
if (strstr(extensionString, "EGL_ANGLE_experimental_present_path") == nullptr) if (strstr(extensionString, "EGL_ANGLE_experimental_present_path") == nullptr)
{ {
destroyGL(); destroyGL();
...@@ -169,6 +170,48 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow, ...@@ -169,6 +170,48 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow,
displayAttributes.push_back(reinterpret_cast<EGLAttrib>(params.platformMethods)); displayAttributes.push_back(reinterpret_cast<EGLAttrib>(params.platformMethods));
} }
std::vector<const char *> disabledFeatureOverrides;
std::vector<const char *> enabledFeatureOverrides;
if (params.commandGraphFeature == EGL_TRUE)
{
enabledFeatureOverrides.push_back("command_graph");
}
else if (params.commandGraphFeature == EGL_FALSE)
{
disabledFeatureOverrides.push_back("command_graph");
}
if (!disabledFeatureOverrides.empty())
{
if (strstr(extensionString, "EGL_ANGLE_feature_control") == nullptr)
{
std::cout << "Missing EGL_ANGLE_feature_control.\n";
destroyGL();
return false;
}
disabledFeatureOverrides.push_back(nullptr);
displayAttributes.push_back(EGL_FEATURE_OVERRIDES_DISABLED_ANGLE);
displayAttributes.push_back(reinterpret_cast<EGLAttrib>(disabledFeatureOverrides.data()));
}
if (!enabledFeatureOverrides.empty())
{
if (strstr(extensionString, "EGL_ANGLE_feature_control") == nullptr)
{
std::cout << "Missing EGL_ANGLE_feature_control.\n";
destroyGL();
return false;
}
enabledFeatureOverrides.push_back(nullptr);
displayAttributes.push_back(EGL_FEATURE_OVERRIDES_ENABLED_ANGLE);
displayAttributes.push_back(reinterpret_cast<EGLAttrib>(enabledFeatureOverrides.data()));
}
displayAttributes.push_back(EGL_NONE); displayAttributes.push_back(EGL_NONE);
mDisplay = eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE, mDisplay = eglGetPlatformDisplay(EGL_PLATFORM_ANGLE_ANGLE,
......
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