Automatically query status of features for tests

Now tests can skip based on what features exist, compared to what
features are explicitly asked for.  For example, a test suite may
override-enable a (normally disabled) feature that depends on a hardware
capability. With this change, it can be skipped if said hardware
capability doesn't exist.

As a bonus, tests now correctly skip if the feature is overriden through
an environment variable.  This change also cleans up
VulkanPerformanceCounterTest tests which did the same for a number of
specific features.

Bug: b/243398683
Change-Id: I84f026e3394eab56fd123e02bee72720c7ed94c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3909789
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
This commit is contained in:
Shahbaz Youssefi
2022-09-21 11:40:18 -04:00
committed by Angle LUCI CQ
parent 5d15e9c654
commit 2debd07df8
11 changed files with 179 additions and 290 deletions

View File

@@ -1184,7 +1184,8 @@ class FramebufferTest_ES3Metal : public FramebufferTest_ES3
// to color attachments. Test we're enforcing that limit.
TEST_P(FramebufferTest_ES3Metal, TooManyBitsGeneratesFramebufferUnsupported)
{
ANGLE_SKIP_TEST_IF(!GetParam().isEnabled(Feature::LimitMaxColorTargetBitsForTesting));
ANGLE_SKIP_TEST_IF(
!getEGLWindow()->isFeatureEnabled(Feature::LimitMaxColorTargetBitsForTesting));
GLint maxDrawBuffers;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
@@ -1234,7 +1235,8 @@ TEST_P(FramebufferTest_ES3Metal, TooManyBitsGeneratesFramebufferUnsupported)
// when drawing.
TEST_P(FramebufferTest_ES3Metal, TooManyBitsGeneratesInvalidFramebufferOperation)
{
ANGLE_SKIP_TEST_IF(!GetParam().isEnabled(Feature::LimitMaxColorTargetBitsForTesting));
ANGLE_SKIP_TEST_IF(
!getEGLWindow()->isFeatureEnabled(Feature::LimitMaxColorTargetBitsForTesting));
GLint maxDrawBuffers;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
@@ -4574,8 +4576,9 @@ void main()
glViewport(0, 0, std::max(kWidth1, kWidth2), std::max(kHeight1, kHeight2));
const bool isSwappedDimensions = GetParam().isEnabled(Feature::EmulatedPrerotation90) ||
GetParam().isEnabled(Feature::EmulatedPrerotation270);
const bool isSwappedDimensions =
getEGLWindow()->isFeatureEnabled(Feature::EmulatedPrerotation90) ||
getEGLWindow()->isFeatureEnabled(Feature::EmulatedPrerotation270);
auto resizeWindow = [this, isSwappedDimensions](GLuint width, GLuint height) {
if (isSwappedDimensions)

View File

@@ -5101,7 +5101,7 @@ TEST_P(Texture2DTestES3, CopyCompressedImageMipMaps)
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_copy_image"));
// TODO(http://anglebug.com/5634): Fix calls to vkCmdCopyBufferToImage() with images smaller
// than the compressed format block size.
ANGLE_SKIP_TEST_IF(GetParam().isEnabled(Feature::AllocateNonZeroMemory));
ANGLE_SKIP_TEST_IF(getEGLWindow()->isFeatureEnabled(Feature::AllocateNonZeroMemory));
constexpr uint32_t kSize = 4;
constexpr size_t kNumLevels = 3;
@@ -8053,8 +8053,9 @@ TEST_P(Texture2DRGTest, TextureRGUNormTest)
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_texture_rg"));
// This workaround causes a GL error on Windows AMD, which is likely a driver bug.
// The workaround is not intended to be enabled in this configuration so skip it.
ANGLE_SKIP_TEST_IF(GetParam().isEnabled(Feature::EmulateCopyTexImage2DFromRenderbuffers) &&
IsWindows() && IsAMD());
ANGLE_SKIP_TEST_IF(
getEGLWindow()->isFeatureEnabled(Feature::EmulateCopyTexImage2DFromRenderbuffers) &&
IsWindows() && IsAMD());
GLubyte pixelValue = 0xab;
GLubyte imageData[] = {pixelValue, pixelValue};
@@ -9927,7 +9928,7 @@ TEST_P(Texture2DTestES3, NonZeroBaseEmulatedClear)
// format is *not* emulated and the feature Feature::AllocateNonZeroMemory is enabled, the
// texture memory will contain non-zero memory, which means the color is not black (causing the
// test to fail).
ANGLE_SKIP_TEST_IF(GetParam().isEnabled(Feature::AllocateNonZeroMemory));
ANGLE_SKIP_TEST_IF(getEGLWindow()->isFeatureEnabled(Feature::AllocateNonZeroMemory));
setUpProgram();

View File

@@ -1829,7 +1829,8 @@ TEST_P(TransformFeedbackTestES31, DifferentArrayElementVaryings)
{
// When transform feedback extension is used, capturing array elements is not supported.
// http://anglebug.com/4140
ANGLE_SKIP_TEST_IF(IsVulkan() && !GetParam().isEnabled(Feature::EmulateTransformFeedback));
ANGLE_SKIP_TEST_IF(IsVulkan() &&
!getEGLWindow()->isFeatureEnabled(Feature::EmulateTransformFeedback));
constexpr char kVS[] =
"#version 310 es\n"
@@ -1895,7 +1896,8 @@ TEST_P(TransformFeedbackTestES31, DifferentArrayElementVaryingsNonZeroIndex)
{
// When transform feedback extension is used, capturing array elements is not supported.
// http://anglebug.com/4140
ANGLE_SKIP_TEST_IF(IsVulkan() && !GetParam().isEnabled(Feature::EmulateTransformFeedback));
ANGLE_SKIP_TEST_IF(IsVulkan() &&
!getEGLWindow()->isFeatureEnabled(Feature::EmulateTransformFeedback));
constexpr char kVS[] =
"#version 310 es\n"

View File

@@ -764,7 +764,7 @@ TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphores)
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
// http://anglebug.com/5383
ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsDesktopOpenGL());
@@ -783,7 +783,7 @@ TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresWithFlags)
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
RunShouldClearWithSemaphoresTest<OpaqueFdTraits>(true, kDefaultImageCreateFlags,
kDefaultImageUsageFlags, isSwiftshader(),
@@ -799,7 +799,7 @@ TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresNoStorage)
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
RunShouldClearWithSemaphoresTest<OpaqueFdTraits>(true, kDefaultImageCreateFlags,
kNoStorageImageUsageFlags, isSwiftshader(),
@@ -816,7 +816,7 @@ TEST_P(VulkanExternalImageTest, ShouldClearOpaqueFdWithSemaphoresMutableNoStorag
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
RunShouldClearWithSemaphoresTest<OpaqueFdTraits>(true, kMutableImageCreateFlags,
kNoStorageImageUsageFlags, isSwiftshader(),
@@ -1005,7 +1005,7 @@ TEST_P(VulkanExternalImageTest, ShouldDrawOpaqueFdWithSemaphores)
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
// http://anglebug.com/5383
ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsDesktopOpenGL());
@@ -1176,7 +1176,7 @@ TEST_P(VulkanExternalImageTest, WaitSemaphoresRetainsContentOpaqueFd)
// http://issuetracker.google.com/173004081
ANGLE_SKIP_TEST_IF(IsVulkan() && IsIntel() && IsLinux() &&
GetParam().isEnabled(Feature::AsyncCommandQueue));
getEGLWindow()->isFeatureEnabled(Feature::AsyncCommandQueue));
// http://anglebug.com/5383
ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsDesktopOpenGL());

View File

@@ -24,13 +24,6 @@ using namespace angle;
namespace
{
enum class ANGLEFeature
{
Supported,
Unsupported,
Unknown,
};
// Normally, if LOAD_OP_NONE is not supported, LOAD_OP_LOAD is used instead. Similarly, if
// STORE_OP_NONE is not supported, STORE_OP_STORE is used instead.
//
@@ -44,7 +37,7 @@ enum class ANGLEFeature
// validation allows variations there.
#define EXPECT_OP_LOAD_AND_NONE(expectedLoads, actualLoads, expectedNones, actualNones) \
{ \
if (mLoadOpNoneSupport == ANGLEFeature::Supported) \
if (hasLoadOpNoneSupport()) \
{ \
EXPECT_EQ(expectedLoads, actualLoads); \
EXPECT_EQ(expectedNones, actualNones); \
@@ -58,15 +51,14 @@ enum class ANGLEFeature
}
#define EXPECT_OP_STORE_AND_NONE(expectedStores, actualStores, expectedNones, actualNones) \
{ \
if (mStoreOpNoneSupport == ANGLEFeature::Supported && \
mLoadOpNoneSupport == ANGLEFeature::Supported) \
if (hasStoreOpNoneSupport() && hasLoadOpNoneSupport()) \
{ \
EXPECT_EQ(expectedStores, actualStores); \
EXPECT_EQ(expectedNones, actualNones); \
} \
else \
{ \
if (mStoreOpNoneSupport != ANGLEFeature::Supported) \
if (!hasStoreOpNoneSupport()) \
{ \
EXPECT_EQ(actualNones, 0u); \
} \
@@ -129,30 +121,22 @@ enum class ANGLEFeature
EXPECT_EQ(expected.stencilAttachmentResolves, counters.stencilAttachmentResolves); \
}
#define EXPECT_CLEAR_ATTACHMENTS_COUNTER(expected, actual) \
{ \
if (mPreferDrawOverClearAttachments == ANGLEFeature::Supported) \
{ \
EXPECT_EQ(actual, 0u); \
} \
else \
{ \
EXPECT_EQ(actual, expected); \
} \
#define EXPECT_CLEAR_ATTACHMENTS_COUNTER(expected, actual) \
{ \
if (hasPreferDrawOverClearAttachments()) \
{ \
EXPECT_EQ(actual, 0u); \
} \
else \
{ \
EXPECT_EQ(actual, expected); \
} \
}
class VulkanPerformanceCounterTest : public ANGLETest<>
{
protected:
VulkanPerformanceCounterTest()
: mLoadOpNoneSupport(ANGLEFeature::Unknown),
mStoreOpNoneSupport(ANGLEFeature::Unknown),
mMutableMipmapTextureUpload(ANGLEFeature::Unknown),
mPreferDrawOverClearAttachments(ANGLEFeature::Unknown),
mSupportsPipelineCreationFeedback(ANGLEFeature::Unknown),
mWarmUpPipelineCacheAtLink(ANGLEFeature::Unknown),
mPreferCPUForBufferSubData(ANGLEFeature::Unknown),
mPreferSubmitAtFBOBoundary(ANGLEFeature::Unknown)
{
// Depth/Stencil required for SwapShouldInvalidate*.
// Also RGBA8 is required to avoid the clear for emulated alpha.
@@ -166,104 +150,6 @@ class VulkanPerformanceCounterTest : public ANGLETest<>
static constexpr GLsizei kOpsTestSize = 16;
void initANGLEFeatures()
{
const bool hasANGLEFeatureControl =
IsEGLClientExtensionEnabled("EGL_ANGLE_feature_control");
if (!hasANGLEFeatureControl)
{
return;
}
EGLDisplay display = getEGLWindow()->getDisplay();
EGLAttrib featureCount = -1;
ASSERT_EQ(static_cast<EGLBoolean>(EGL_TRUE),
eglQueryDisplayAttribANGLE(display, EGL_FEATURE_COUNT_ANGLE, &featureCount));
for (EGLAttrib index = 0; index < featureCount; index++)
{
const char *featureName = eglQueryStringiANGLE(display, EGL_FEATURE_NAME_ANGLE, index);
const char *featureStatus =
eglQueryStringiANGLE(display, EGL_FEATURE_STATUS_ANGLE, index);
ASSERT_NE(featureName, nullptr);
ASSERT_NE(featureStatus, nullptr);
const bool isStoreOpNone =
strcmp(featureName, GetFeatureName(Feature::SupportsRenderPassStoreOpNone)) == 0;
const bool isLoadStoreOpNoneEXT =
strcmp(featureName, GetFeatureName(Feature::SupportsRenderPassLoadStoreOpNone)) ==
0;
const bool isEnabled = strcmp(featureStatus, angle::kFeatureStatusEnabled) == 0;
const bool isDisabled = strcmp(featureStatus, angle::kFeatureStatusDisabled) == 0;
ASSERT_TRUE(isEnabled || isDisabled);
const ANGLEFeature isSupported =
isEnabled ? ANGLEFeature::Supported : ANGLEFeature::Unsupported;
if (isLoadStoreOpNoneEXT)
{
mLoadOpNoneSupport = isSupported;
}
if (isStoreOpNone || isLoadStoreOpNoneEXT)
{
if (mStoreOpNoneSupport == ANGLEFeature::Unknown ||
mStoreOpNoneSupport == ANGLEFeature::Unsupported)
{
mStoreOpNoneSupport = isSupported;
}
}
if (strcmp(featureName, GetFeatureName(Feature::MutableMipmapTextureUpload)) == 0)
{
mMutableMipmapTextureUpload = isSupported;
}
else if (strcmp(featureName,
GetFeatureName(Feature::PreferDrawClearOverVkCmdClearAttachments)) == 0)
{
mPreferDrawOverClearAttachments = isSupported;
}
else if (strcmp(featureName,
GetFeatureName(Feature::SupportsPipelineCreationFeedback)) == 0)
{
mSupportsPipelineCreationFeedback = isSupported;
}
else if (strcmp(featureName, GetFeatureName(Feature::WarmUpPipelineCacheAtLink)) == 0)
{
mWarmUpPipelineCacheAtLink = isSupported;
}
else if (strcmp(featureName, GetFeatureName(Feature::PreferCPUForBufferSubData)) == 0)
{
mPreferCPUForBufferSubData = isSupported;
}
else if (strcmp(featureName, GetFeatureName(Feature::PreferSubmitAtFBOBoundary)) == 0)
{
mPreferSubmitAtFBOBoundary = isSupported;
}
else if (strcmp(featureName,
GetFeatureName(Feature::DisallowMixedDepthStencilLoadOpNoneAndLoad)) ==
0)
{
mDisallowMixedDepthStencilLoadOpNoneAndLoad = isSupported;
}
}
// Make sure feature renames are caught
ASSERT_NE(mLoadOpNoneSupport, ANGLEFeature::Unknown);
ASSERT_NE(mStoreOpNoneSupport, ANGLEFeature::Unknown);
ASSERT_NE(mMutableMipmapTextureUpload, ANGLEFeature::Unknown);
ASSERT_NE(mPreferDrawOverClearAttachments, ANGLEFeature::Unknown);
ASSERT_NE(mSupportsPipelineCreationFeedback, ANGLEFeature::Unknown);
ASSERT_NE(mWarmUpPipelineCacheAtLink, ANGLEFeature::Unknown);
ASSERT_NE(mPreferCPUForBufferSubData, ANGLEFeature::Unknown);
ASSERT_NE(mPreferSubmitAtFBOBoundary, ANGLEFeature::Unknown);
ASSERT_NE(mDisallowMixedDepthStencilLoadOpNoneAndLoad, ANGLEFeature::Unknown);
// Impossible to have LOAD_OP_NONE but not STORE_OP_NONE
ASSERT_FALSE(mLoadOpNoneSupport == ANGLEFeature::Supported &&
mStoreOpNoneSupport != ANGLEFeature::Supported);
}
void setupForColorOpsTest(GLFramebuffer *framebuffer, GLTexture *texture)
{
// Setup the framebuffer
@@ -445,18 +331,50 @@ class VulkanPerformanceCounterTest : public ANGLETest<>
return GetPerfCounters(mIndexMap);
}
CounterNameToIndexMap mIndexMap;
// Support status for ANGLE features.
ANGLEFeature mLoadOpNoneSupport;
ANGLEFeature mStoreOpNoneSupport;
ANGLEFeature mMutableMipmapTextureUpload;
ANGLEFeature mPreferDrawOverClearAttachments;
ANGLEFeature mSupportsPipelineCreationFeedback;
ANGLEFeature mWarmUpPipelineCacheAtLink;
ANGLEFeature mPreferCPUForBufferSubData;
ANGLEFeature mPreferSubmitAtFBOBoundary;
ANGLEFeature mDisallowMixedDepthStencilLoadOpNoneAndLoad;
bool isFeatureEnabled(Feature feature) const
{
return getEGLWindow()->isFeatureEnabled(feature);
}
bool hasLoadOpNoneSupport() const
{
return isFeatureEnabled(Feature::SupportsRenderPassLoadStoreOpNone);
}
bool hasStoreOpNoneSupport() const
{
return isFeatureEnabled(Feature::SupportsRenderPassLoadStoreOpNone) ||
isFeatureEnabled(Feature::SupportsRenderPassStoreOpNone);
}
bool hasMutableMipmapTextureUpload() const
{
return isFeatureEnabled(Feature::MutableMipmapTextureUpload);
}
bool hasPreferDrawOverClearAttachments() const
{
return isFeatureEnabled(Feature::PreferDrawClearOverVkCmdClearAttachments);
}
bool hasSupportsPipelineCreationFeedback() const
{
return isFeatureEnabled(Feature::SupportsPipelineCreationFeedback);
}
bool hasWarmUpPipelineCacheAtLink() const
{
return isFeatureEnabled(Feature::WarmUpPipelineCacheAtLink);
}
bool hasPreferCPUForBufferSubData() const
{
return isFeatureEnabled(Feature::PreferCPUForBufferSubData);
}
bool hasPreferSubmitAtFBOBoundary() const
{
return isFeatureEnabled(Feature::PreferSubmitAtFBOBoundary);
}
bool hasDisallowMixedDepthStencilLoadOpNoneAndLoad() const
{
return isFeatureEnabled(Feature::DisallowMixedDepthStencilLoadOpNoneAndLoad);
}
CounterNameToIndexMap mIndexMap;
};
class VulkanPerformanceCounterTest_ES31 : public VulkanPerformanceCounterTest
@@ -566,7 +484,6 @@ void VulkanPerformanceCounterTest::maskedFramebufferFetchDrawVerify(const GLColo
TEST_P(VulkanPerformanceCounterTest, NewTextureDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
GLColor kInitialData[4] = {GLColor::red, GLColor::blue, GLColor::green, GLColor::yellow};
@@ -617,8 +534,6 @@ TEST_P(VulkanPerformanceCounterTest, NewTextureDoesNotBreakRenderPass)
// current render pass.
TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotBreakRenderPass)
{
initANGLEFeatures();
constexpr size_t kMaxBufferToImageCopySize = 64 * 1024 * 1024;
constexpr uint64_t kNumSubmits = 2;
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
@@ -684,8 +599,6 @@ TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotCollec
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_disjoint_timer_query"));
initANGLEFeatures();
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
uint64_t submitCommandsCount = getPerfCounters().vkQueueSubmitCallsTotal;
@@ -765,7 +678,7 @@ TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotCollec
// When the preferSubmitAtFBOBoundary feature is enabled, the render pass closure causes an
// extra submission.
if (mPreferSubmitAtFBOBoundary == ANGLEFeature::Supported)
if (hasPreferSubmitAtFBOBoundary())
{
++submitCommandsCount;
}
@@ -778,8 +691,7 @@ TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotCollec
// Tests that mutable texture is uploaded with appropriate mip level attributes.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCompatibleMipLevelsInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -804,8 +716,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCompatibleMipLevelsInit)
// dimensions.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCompatibleMipLevelsNonSquareInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -832,8 +743,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCompatibleMipLevelsNonSquareI
// after glTexStorage2D.
TEST_P(VulkanPerformanceCounterTest, MutableTextureChangeToImmutableNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -858,8 +768,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureChangeToImmutableNoInit)
// Tests that mutable texture is not uploaded when there is no base mip level (0).
TEST_P(VulkanPerformanceCounterTest, MutableTextureNoBaseLevelNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -884,8 +793,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureNoBaseLevelNoInit)
// despite the defined mip levels being compatible.
TEST_P(VulkanPerformanceCounterTest, MutableTextureMissingMipLevelGreaterThanOneInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -911,8 +819,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureMissingMipLevelGreaterThanOne
// Tests that mutable texture is not uploaded with incompatible mip level sizes.
TEST_P(VulkanPerformanceCounterTest, MutableTextureMipLevelsWithIncompatibleSizesNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -938,8 +845,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureMipLevelsWithIncompatibleSize
// Tests that mutable texture is not uploaded with incompatible mip level formats.
TEST_P(VulkanPerformanceCounterTest, MutableTextureMipLevelsWithIncompatibleFormatsNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -963,8 +869,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureMipLevelsWithIncompatibleForm
// Tests that mutable 3D texture is uploaded with appropriate mip level attributes.
TEST_P(VulkanPerformanceCounterTest, MutableTexture3DCompatibleMipLevelsInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -991,8 +896,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTexture3DCompatibleMipLevelsInit)
// unequal dimensions.
TEST_P(VulkanPerformanceCounterTest, MutableTexture3DCompatibleMipLevelsNonCubeInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -1021,8 +925,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTexture3DCompatibleMipLevelsNonCubeI
// Tests that mutable 3D texture is not uploaded with incompatible mip level sizes.
TEST_P(VulkanPerformanceCounterTest, MutableTexture3DMipLevelsWithIncompatibleSizesNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -1048,8 +951,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTexture3DMipLevelsWithIncompatibleSi
// Tests that mutable 2D array texture is not uploaded with incompatible mip level sizes.
TEST_P(VulkanPerformanceCounterTest, MutableTexture2DArrayMipLevelsWithIncompatibleSizesNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -1075,8 +977,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTexture2DArrayMipLevelsWithIncompati
// Tests that mutable cubemap texture is uploaded with appropriate mip level attributes.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapCompatibleMipLevelsInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -1105,8 +1006,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapCompatibleMipLevelsIni
// Tests that mutable cubemap texture is not uploaded if not complete.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapIncompleteInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -1132,8 +1032,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapIncompleteInit)
// Tests that mutable cubemap array texture is uploaded with appropriate mip level attributes.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapArrayCompatibleMipLevelsInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded + 1;
@@ -1160,8 +1059,7 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapArrayCompatibleMipLeve
// Tests that mutable cubemap array texture is not uploaded with different layer-faces.
TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapArrayDifferentLayerFacesNoInit)
{
initANGLEFeatures();
ANGLE_SKIP_TEST_IF(mMutableMipmapTextureUpload != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasMutableMipmapTextureUpload());
uint32_t expectedMutableTexturesUploaded = getPerfCounters().mutableTexturesUploaded;
@@ -1189,7 +1087,6 @@ TEST_P(VulkanPerformanceCounterTest, MutableTextureCubemapArrayDifferentLayerFac
TEST_P(VulkanPerformanceCounterTest, SampleFromRGBTextureDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Texture2D(), essl1_shaders::fs::Texture2D());
glUseProgram(program);
@@ -1233,7 +1130,6 @@ TEST_P(VulkanPerformanceCounterTest, SampleFromRGBTextureDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, RenderToRGBTextureDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
glUseProgram(program);
@@ -1273,7 +1169,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderToRGBTextureDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, ChangingMaxLevelHitsDescriptorCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
GLColor kInitialData[4] = {GLColor::red, GLColor::blue, GLColor::green, GLColor::yellow};
@@ -1326,7 +1221,6 @@ TEST_P(VulkanPerformanceCounterTest, ChangingMaxLevelHitsDescriptorCache)
TEST_P(VulkanPerformanceCounterTest, IndependentBufferCopiesShareSingleBarrier)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLint srcDataA[] = {1, 2, 3, 4};
constexpr GLint srcDataB[] = {5, 6, 7, 8};
@@ -1381,7 +1275,6 @@ TEST_P(VulkanPerformanceCounterTest, IndependentBufferCopiesShareSingleBarrier)
TEST_P(VulkanPerformanceCounterTest_ES31, MultisampleResolveWithBlit)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr int kSize = 16;
glViewport(0, 0, kSize, kSize);
@@ -1481,7 +1374,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, ResolveToFBOWithInvalidate)
TEST_P(VulkanPerformanceCounterTest, ReadOnlyDepthStencilFeedbackLoopUsesSingleRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLsizei kSize = 4;
@@ -1572,7 +1464,6 @@ TEST_P(VulkanPerformanceCounterTest, ReadOnlyDepthStencilFeedbackLoopUsesSingleR
TEST_P(VulkanPerformanceCounterTest, ColorInvalidateMaskDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1620,7 +1511,6 @@ TEST_P(VulkanPerformanceCounterTest, ColorInvalidateMaskDraw)
TEST_P(VulkanPerformanceCounterTest, ColorInvalidateDiscardDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1668,7 +1558,6 @@ TEST_P(VulkanPerformanceCounterTest, ColorInvalidateDiscardDraw)
TEST_P(VulkanPerformanceCounterTest, ColorMaskedDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1717,7 +1606,6 @@ TEST_P(VulkanPerformanceCounterTest, ColorMaskedDraw)
TEST_P(VulkanPerformanceCounterTest, ColorDiscardDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1767,7 +1655,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, ColorMaskedFramebufferFetchDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1797,7 +1684,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, ColorMaskedFramebufferFetchDraw)
TEST_P(VulkanPerformanceCounterTest, ColorClearMaskedDrawThenClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1843,7 +1729,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, ColorMaskedFramebufferFetchDrawThenCle
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1882,7 +1767,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, FramebufferFetchRenderPassThenColorMas
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch_non_coherent"));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -1930,10 +1814,9 @@ TEST_P(VulkanPerformanceCounterTest_ES31, FramebufferFetchRenderPassThenColorMas
TEST_P(VulkanPerformanceCounterTest, DepthStencilMaskedDrawThenClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// This optimization is not implemented when this workaround is in effect.
ANGLE_SKIP_TEST_IF(mPreferDrawOverClearAttachments == ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(hasPreferDrawOverClearAttachments());
angle::VulkanPerfCounters expected;
@@ -1979,7 +1862,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilMaskedDrawThenClear)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2030,7 +1912,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDraw)
TEST_P(VulkanPerformanceCounterTest, DisableInvalidateDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2081,7 +1962,6 @@ TEST_P(VulkanPerformanceCounterTest, DisableInvalidateDraw)
TEST_P(VulkanPerformanceCounterTest, DisableDrawInvalidateEnable)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2143,7 +2023,6 @@ TEST_P(VulkanPerformanceCounterTest, DisableDrawInvalidateEnable)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidate)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2185,7 +2064,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidate)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateSub)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2228,7 +2106,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateSub)
TEST_P(VulkanPerformanceCounterTest, DepthStencilPartialInvalidateSub)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2303,7 +2180,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilPartialInvalidateSub)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2350,7 +2226,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDraw)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisable)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// http://anglebug.com/6857
ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsVulkan());
@@ -2407,7 +2282,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisable)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDrawEnable)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2464,7 +2338,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDrawEnable)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDrawEnableDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2524,7 +2397,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableDrawEnableDraw
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnable)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2584,7 +2456,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnable)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnableInvalidate)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2646,7 +2517,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnableInva
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnableInvalidateDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2712,7 +2582,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawDisableEnableInva
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableEnableDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2768,7 +2637,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDisableEnableDraw)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateAndClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2829,7 +2697,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateAndClear)
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateAndMaskedClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2895,7 +2762,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateAndMaskedClear)
TEST_P(VulkanPerformanceCounterTest, DepthFuncALWAYSWithDepthMaskDisabledShouldNotLoadStore)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2906,7 +2772,7 @@ TEST_P(VulkanPerformanceCounterTest, DepthFuncALWAYSWithDepthMaskDisabledShouldN
// Expect rpCount+1, depth(Clears+0, Loads+0, LoadNones+0, Stores+1, StoreNones+0),
setExpectedCountersForDepthOps(getPerfCounters(), 1, 0, 0, 0, 1, 0, &expected);
if (mDisallowMixedDepthStencilLoadOpNoneAndLoad == ANGLEFeature::Supported)
if (hasDisallowMixedDepthStencilLoadOpNoneAndLoad())
{
// stencil(Clears+0, Loads+1, LoadNones+0, Stores+0, StoreNones+1)
setExpectedCountersForStencilOps(getPerfCounters(), 0, 1, 0, 0, 1, &expected);
@@ -2944,7 +2810,6 @@ TEST_P(VulkanPerformanceCounterTest,
DepthFuncALWAYSWithDepthMaskDisabledThenClearShouldNotLoadStore)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -2961,7 +2826,7 @@ TEST_P(VulkanPerformanceCounterTest,
drawQuad(redProgram, essl1_shaders::PositionAttrib(), 0.95f);
EXPECT_PIXEL_COLOR_EQ(kOpsTestSize / 2, kOpsTestSize / 2, GLColor::red);
if (mPreferDrawOverClearAttachments == ANGLEFeature::Supported)
if (hasPreferDrawOverClearAttachments())
{
// Expect rpCount+1, depth(Clears+0, Loads+1, LoadNones+0, Stores+1, StoreNones+0),
// stencil(Clears+0, Loads+0, LoadNones+0, Stores+1, StoreNones+0)
@@ -3002,7 +2867,6 @@ TEST_P(VulkanPerformanceCounterTest,
TEST_P(VulkanPerformanceCounterTest, DepthFuncNEVERWithDepthMaskDisabledShouldNotLoadStore)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -3038,7 +2902,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthFuncNEVERWithDepthMaskDisabledShouldNo
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDetachModifyTexAttachDrawWithBlend)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -3137,7 +3000,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDetachModifyTexAttach
TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawAndDeleteRenderbuffer)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -3189,7 +3051,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilInvalidateDrawAndDeleteRenderbu
TEST_P(VulkanPerformanceCounterTest_ES31, ColorDisableThenDrawThenEnableThenDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -3241,7 +3102,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, ColorDisableThenDrawThenEnableThenDraw
TEST_P(VulkanPerformanceCounterTest, SwapShouldInvalidateDepthAfterClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(redProgram, essl1_shaders::vs::Simple(), essl1_shaders::fs::Red());
@@ -3267,7 +3127,6 @@ TEST_P(VulkanPerformanceCounterTest, SwapShouldInvalidateDepthAfterClear)
TEST_P(VulkanPerformanceCounterTest, MaskedColorClearDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
@@ -3308,7 +3167,6 @@ TEST_P(VulkanPerformanceCounterTest, MaskedColorClearDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, MaskedClearDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLsizei kSize = 64;
@@ -3390,7 +3248,6 @@ TEST_P(VulkanPerformanceCounterTest, MaskedClearDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, ClearThenScissoredDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
uint64_t expectedDepthClears = getPerfCounters().depthLoadOpClears + 1;
@@ -3464,7 +3321,6 @@ TEST_P(VulkanPerformanceCounterTest, ClearThenScissoredDraw)
TEST_P(VulkanPerformanceCounterTest, ScissoredClearDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLsizei kSize = 64;
@@ -3563,7 +3419,6 @@ TEST_P(VulkanPerformanceCounterTest, ScissoredClearDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, DrawbufferChangeWithAllColorMaskDisabled)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
glUseProgram(program);
@@ -3623,7 +3478,6 @@ TEST_P(VulkanPerformanceCounterTest, DrawbufferChangeWithAllColorMaskDisabled)
TEST_P(VulkanPerformanceCounterTest, InRenderpassFlushShouldNotBreakRenderpass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
@@ -3652,7 +3506,6 @@ TEST_P(VulkanPerformanceCounterTest, InRenderpassFlushShouldNotBreakRenderpass)
TEST_P(VulkanPerformanceCounterTest, DepthStencilTextureClearAndLoad)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// TODO: http://anglebug.com/5329 Flaky test
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsVulkan());
@@ -3766,7 +3619,6 @@ TEST_P(VulkanPerformanceCounterTest, DepthStencilTextureClearAndLoad)
TEST_P(VulkanPerformanceCounterTest, RenderToTextureDepthStencilTextureShouldNotLoad)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// http://anglebug.com/5083
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsVulkan());
@@ -3895,7 +3747,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderToTextureDepthStencilRenderbufferShou
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_multisampled_render_to_texture"));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -4021,7 +3872,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderToTextureInvalidate)
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_multisampled_render_to_texture"));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -4153,7 +4003,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderToTextureUninitializedAndUnusedDepthS
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_multisampled_render_to_texture"));
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -4222,7 +4071,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderToTextureUninitializedAndUnusedDepthS
TEST_P(VulkanPerformanceCounterTest, ReadOnlyDepthBufferLayout)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLsizei kSize = 64;
@@ -4307,7 +4155,6 @@ TEST_P(VulkanPerformanceCounterTest, ReadOnlyDepthBufferLayout)
TEST_P(VulkanPerformanceCounterTest, RenderPassAfterRenderPassWithoutDepthStencilWrite)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -4372,7 +4219,6 @@ TEST_P(VulkanPerformanceCounterTest, RenderPassAfterRenderPassWithoutDepthStenci
TEST_P(VulkanPerformanceCounterTest, ClearAfterClearDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
@@ -4518,7 +4364,6 @@ TEST_P(VulkanPerformanceCounterTest, ClearAfterClearDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, ScissorDoesNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr GLsizei kSize = 16;
@@ -4765,7 +4610,6 @@ TEST_P(VulkanPerformanceCounterTest, ScissorDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, ChangingUBOsHitsDescriptorSetCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// Set up two UBOs, one filled with "1" and the second with "2".
constexpr GLsizei kCount = 64;
@@ -4895,7 +4739,6 @@ void main()
TEST_P(VulkanPerformanceCounterTest, MappingGpuReadOnlyBufferGhostsBuffer)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// 1. Create a buffer, map it, fill it with red
// 2. Draw with buffer (GPU read-only)
@@ -4994,10 +4837,9 @@ void main()
TEST_P(VulkanPerformanceCounterTest, BufferSubDataShouldNotBreakRenderPass)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
if (mPreferCPUForBufferSubData != ANGLEFeature::Supported)
if (!hasPreferCPUForBufferSubData())
{
++expectedRenderPassCount;
}
@@ -5093,7 +4935,6 @@ void main()
TEST_P(VulkanPerformanceCounterTest, BufferSubDataShouldNotTriggerSyncState)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(testProgram, essl1_shaders::vs::Simple(), essl1_shaders::fs::Green());
glUseProgram(testProgram);
@@ -5136,7 +4977,6 @@ TEST_P(VulkanPerformanceCounterTest, BufferSubDataShouldNotTriggerSyncState)
TEST_P(VulkanPerformanceCounterTest, SwapShouldInvalidateDepthStencil)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -5169,7 +5009,6 @@ TEST_P(VulkanPerformanceCounterTest, SwapShouldInvalidateDepthStencil)
TEST_P(VulkanPerformanceCounterTest_MSAA, SwapShouldInvalidateDepthStencil)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -5347,7 +5186,6 @@ TEST_P(VulkanPerformanceCounterTest_MSAA, ResolveWhenRenderPassNotEntireArea)
TEST_P(VulkanPerformanceCounterTest, UniformUpdatesHitDescriptorSetCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
ANGLE_GL_PROGRAM(testProgram, essl1_shaders::vs::Simple(), essl1_shaders::fs::UniformColor());
glUseProgram(testProgram);
@@ -5729,10 +5567,9 @@ outData = texture(tex, vec2(x, y));
TEST_P(VulkanPerformanceCounterTest, DisableThenMidRenderPassClear)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// This optimization is not implemented when this workaround is in effect.
ANGLE_SKIP_TEST_IF(mPreferDrawOverClearAttachments == ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(hasPreferDrawOverClearAttachments());
angle::VulkanPerfCounters expected;
@@ -5834,7 +5671,6 @@ TEST_P(VulkanPerformanceCounterTest, InceptionScissorClears)
ANGLE_SKIP_TEST_IF(IsQualcomm() && IsVulkan());
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -5899,7 +5735,6 @@ TEST_P(VulkanPerformanceCounterTest, InceptionScissorClears)
TEST_P(VulkanPerformanceCounterTest, Depth16Scissored)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
GLRenderbuffer renderbuffer;
glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
@@ -5940,7 +5775,6 @@ TEST_P(VulkanPerformanceCounterTest, DrawThenInceptionScissorClears)
ANGLE_SKIP_TEST_IF(IsQualcomm() && IsVulkan());
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -6010,7 +5844,6 @@ TEST_P(VulkanPerformanceCounterTest, DrawThenInceptionScissorClears)
TEST_P(VulkanPerformanceCounterTest, ColorClearAfterInvalidate)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -6075,7 +5908,6 @@ TEST_P(VulkanPerformanceCounterTest, ColorClearAfterInvalidate)
TEST_P(VulkanPerformanceCounterTest, InvalidateThenRepeatedClearThenBlitThenDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -6144,7 +5976,6 @@ TEST_P(VulkanPerformanceCounterTest, InvalidateThenRepeatedClearThenBlitThenDraw
TEST_P(VulkanPerformanceCounterTest, InvalidateThenRepeatedClearThenReadbackThenDraw)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;
@@ -6191,8 +6022,6 @@ TEST_P(VulkanPerformanceCounterTest, InvalidateThenRepeatedClearThenReadbackThen
// Tests that the submission counters count the implicit submission in eglSwapBuffers().
TEST_P(VulkanPerformanceCounterTest, VerifySubmitCounters)
{
initANGLEFeatures();
uint64_t expectedVkQueueSubmitCount = getPerfCounters().vkQueueSubmitCallsTotal;
uint64_t expectedCommandQueueSubmitCount = getPerfCounters().commandQueueSubmitCallsTotal;
@@ -6223,7 +6052,6 @@ TEST_P(VulkanPerformanceCounterTest, VerifySubmitCounters)
TEST_P(VulkanPerformanceCounterTest, UnnecessaryFlushDoesntCauseSubmission)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
swapBuffers();
uint64_t expectedVkQueueSubmitCalls = getPerfCounters().vkQueueSubmitCallsTotal;
@@ -6259,7 +6087,6 @@ TEST_P(VulkanPerformanceCounterTest, UnnecessaryFlushDoesntCauseSubmission)
TEST_P(VulkanPerformanceCounterTest, SyncWihtoutCommandsDoesntCauseSubmission)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
swapBuffers();
uint64_t expectedVkQueueSubmitCalls = getPerfCounters().vkQueueSubmitCallsTotal;
@@ -6278,7 +6105,6 @@ TEST_P(VulkanPerformanceCounterTest, SyncWihtoutCommandsDoesntCauseSubmission)
TEST_P(VulkanPerformanceCounterTest_SingleBuffer, SwapBuffersAfterFlushIgnored)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// Set mode to single buffer
EXPECT_EGL_TRUE(eglSurfaceAttrib(getEGLWindow()->getDisplay(), getEGLWindow()->getSurface(),
@@ -6636,11 +6462,9 @@ void VulkanPerformanceCounterTest::testPipelineCacheIsWarm(GLProgram *program, G
TEST_P(VulkanPerformanceCounterTest, PipelineCacheIsWarmedUpAtLinkTime)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// Test is only valid when pipeline creation feedback is available
ANGLE_SKIP_TEST_IF(mSupportsPipelineCreationFeedback != ANGLEFeature::Supported ||
mWarmUpPipelineCacheAtLink != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasSupportsPipelineCreationFeedback() || !hasWarmUpPipelineCacheAtLink());
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
@@ -6651,11 +6475,9 @@ TEST_P(VulkanPerformanceCounterTest, PipelineCacheIsWarmedUpAtLinkTime)
TEST_P(VulkanPerformanceCounterTest, PipelineCacheIsRestoredWithProgramBinary)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// Test is only valid when pipeline creation feedback is available
ANGLE_SKIP_TEST_IF(mSupportsPipelineCreationFeedback != ANGLEFeature::Supported ||
mWarmUpPipelineCacheAtLink != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasSupportsPipelineCreationFeedback() || !hasWarmUpPipelineCacheAtLink());
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
GLProgram reloadedProgram;
@@ -6668,11 +6490,9 @@ TEST_P(VulkanPerformanceCounterTest, PipelineCacheIsRestoredWithProgramBinary)
TEST_P(VulkanPerformanceCounterTest, PipelineCacheIsRestoredWithProgramBinaryTwice)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
// Test is only valid when pipeline creation feedback is available
ANGLE_SKIP_TEST_IF(mSupportsPipelineCreationFeedback != ANGLEFeature::Supported ||
mWarmUpPipelineCacheAtLink != ANGLEFeature::Supported);
ANGLE_SKIP_TEST_IF(!hasSupportsPipelineCreationFeedback() || !hasWarmUpPipelineCacheAtLink());
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
GLProgram reloadedProgram;
@@ -6791,7 +6611,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31,
CreateDestroyTextureDoesNotIncreaseComputeShaderDescriptporSetCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
@@ -6842,7 +6661,6 @@ void main()
TEST_P(VulkanPerformanceCounterTest, DestroyUniformBufferAlsoDestroyDescriptporSetCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
const char *mkFS = R"(#version 300 es
precision highp float;
@@ -6911,7 +6729,6 @@ void main()
TEST_P(VulkanPerformanceCounterTest_ES31, DestroyAtomicCounterBufferAlsoDestroyDescriptporSetCache)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
constexpr char kFS[] =
"#version 310 es\n"
@@ -6971,7 +6788,6 @@ TEST_P(VulkanPerformanceCounterTest_ES31, DestroyAtomicCounterBufferAlsoDestroyD
TEST_P(VulkanPerformanceCounterTest, FenceThenSwapBuffers)
{
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled(kPerfMonitorExtensionName));
initANGLEFeatures();
angle::VulkanPerfCounters expected;

View File

@@ -673,8 +673,8 @@ void ANGLETestBase::ANGLETestSetUp()
int osWindowWidth = mFixture->osWindow->getWidth();
int osWindowHeight = mFixture->osWindow->getHeight();
const bool isRotated = mCurrentParams->isEnabled(Feature::EmulatedPrerotation90) ||
mCurrentParams->isEnabled(Feature::EmulatedPrerotation270);
const bool isRotated = mCurrentParams->isEnableRequested(Feature::EmulatedPrerotation90) ||
mCurrentParams->isEnableRequested(Feature::EmulatedPrerotation270);
if (isRotated)
{
std::swap(osWindowWidth, osWindowHeight);

View File

@@ -115,12 +115,12 @@ void PlatformParameters::initDefaultParameters()
eglParameters.debugLayersEnabled = EGL_TRUE;
}
bool PlatformParameters::isEnabled(Feature feature) const
bool PlatformParameters::isEnableRequested(Feature feature) const
{
return HasFeatureOverride(eglParameters.enabledFeatureOverrides, feature);
}
bool PlatformParameters::isDisabled(Feature feature) const
bool PlatformParameters::isDisableRequested(Feature feature) const
{
return HasFeatureOverride(eglParameters.disabledFeatureOverrides, feature);
}

View File

@@ -65,8 +65,8 @@ struct PlatformParameters
eglParameters.disable(feature);
return *this;
}
bool isEnabled(Feature feature) const;
bool isDisabled(Feature feature) const;
bool isEnableRequested(Feature feature) const;
bool isDisableRequested(Feature feature) const;
GLESDriverType driver;
bool noFixture;

View File

@@ -583,8 +583,8 @@ bool IsConfigAllowlisted(const SystemInfo &systemInfo, const PlatformParameters
return true;
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
// http://issuetracker.google.com/173004081
return !IsIntel() || !param.isEnabled(Feature::AsyncCommandQueue) ||
param.isDisabled(Feature::AsyncCommandQueue);
return !IsIntel() || !param.isEnableRequested(Feature::AsyncCommandQueue) ||
param.isDisableRequested(Feature::AsyncCommandQueue);
default:
return false;
}
@@ -618,7 +618,7 @@ bool IsConfigAllowlisted(const SystemInfo &systemInfo, const PlatformParameters
{
return false;
}
if (param.isDisabled(Feature::SupportsNegativeViewport))
if (param.isDisableRequested(Feature::SupportsNegativeViewport))
{
return false;
}

View File

@@ -13,6 +13,7 @@
#include <string.h>
#include "common/system_utils.h"
#include "platform/Feature.h"
#include "platform/PlatformMethods.h"
#include "util/OSWindow.h"
@@ -75,7 +76,9 @@ EGLWindow::EGLWindow(EGLenum clientType,
mContext(EGL_NO_CONTEXT),
mEGLMajorVersion(0),
mEGLMinorVersion(0)
{}
{
std::fill(mFeatures.begin(), mFeatures.end(), ANGLEFeatureStatus::Unknown);
}
EGLWindow::~EGLWindow()
{
@@ -284,6 +287,8 @@ bool EGLWindow::initializeDisplay(OSWindow *osWindow,
return false;
}
queryFeatures();
mPlatform = params;
return true;
}
@@ -858,3 +863,46 @@ void EGLWindow::Delete(EGLWindow **window)
delete *window;
*window = nullptr;
}
void EGLWindow::queryFeatures()
{
const char *extensionString =
static_cast<const char *>(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS));
const bool hasFeatureControlANGLE =
strstr(extensionString, "EGL_ANGLE_feature_control") != nullptr;
if (!hasFeatureControlANGLE)
{
return;
}
angle::HashMap<std::string, angle::Feature> featureFromName;
for (angle::Feature feature : angle::AllEnums<angle::Feature>())
{
featureFromName[angle::GetFeatureName(feature)] = feature;
}
EGLAttrib featureCount = -1;
eglQueryDisplayAttribANGLE(mDisplay, EGL_FEATURE_COUNT_ANGLE, &featureCount);
for (int index = 0; index < featureCount; index++)
{
const char *featureName = eglQueryStringiANGLE(mDisplay, EGL_FEATURE_NAME_ANGLE, index);
const char *featureStatus = eglQueryStringiANGLE(mDisplay, EGL_FEATURE_STATUS_ANGLE, index);
ASSERT(featureName != nullptr);
ASSERT(featureStatus != nullptr);
const angle::Feature feature = featureFromName[featureName];
const bool isEnabled = strcmp(featureStatus, angle::kFeatureStatusEnabled) == 0;
const bool isDisabled = strcmp(featureStatus, angle::kFeatureStatusDisabled) == 0;
ASSERT(isEnabled || isDisabled);
mFeatures[feature] = isEnabled ? ANGLEFeatureStatus::Enabled : ANGLEFeatureStatus::Disabled;
}
}
bool EGLWindow::isFeatureEnabled(angle::Feature feature)
{
return mFeatures[feature] == ANGLEFeatureStatus::Enabled;
}

View File

@@ -13,6 +13,7 @@
#include <string>
#include "common/Optional.h"
#include "common/PackedEnums.h"
#include "common/angleutils.h"
#include "util/EGLPlatformParameters.h"
#include "util/util_export.h"
@@ -141,6 +142,8 @@ class ANGLE_UTIL_EXPORT GLWindowBase : angle::NonCopyable
const EGLPlatformParameters &getPlatform() const { return mPlatform; }
const ConfigParameters &getConfigParams() const { return mConfigParams; }
virtual bool isFeatureEnabled(angle::Feature feature) { return false; }
protected:
GLWindowBase(EGLenum clientType,
EGLint glesMajorVersion,
@@ -156,6 +159,14 @@ class ANGLE_UTIL_EXPORT GLWindowBase : angle::NonCopyable
ConfigParameters mConfigParams;
};
enum class ANGLEFeatureStatus
{
Enabled,
Disabled,
Unknown,
};
using ANGLEFeatureArray = angle::PackedEnumMap<angle::Feature, ANGLEFeatureStatus>;
class ANGLE_UTIL_EXPORT EGLWindow : public GLWindowBase
{
public:
@@ -240,6 +251,12 @@ class ANGLE_UTIL_EXPORT EGLWindow : public GLWindowBase
bool isDisplayInitialized() const { return mDisplay != EGL_NO_DISPLAY; }
// Get the status of features and cache them in mFeatures.
void queryFeatures();
// Return whether a feature is enabled. Features that don't exist in the backend have Unknown
// status, and are considered disabled for the purposes of this function.
bool isFeatureEnabled(angle::Feature feature) override;
private:
EGLWindow(EGLenum clientType,
EGLint glesMajorVersion,
@@ -254,6 +271,8 @@ class ANGLE_UTIL_EXPORT EGLWindow : public GLWindowBase
EGLint mEGLMajorVersion;
EGLint mEGLMinorVersion;
ANGLEFeatureArray mFeatures;
};
#endif // UTIL_EGLWINDOW_H_