Commit a2d670c5 by Jamie Madill Committed by Commit Bot

Run trace tests against Vulkan Mock ICD.

Required an upstream fix: https://github.com/KhronosGroup/Vulkan-Tools/pull/437 Also a workaround filed as an issue: https://github.com/KhronosGroup/Vulkan-Tools/issues/445 Bug: angleproject:4950 Change-Id: I21333464d2a8e52d5d85d35654f0e6372f9650db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358517Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 972441af
...@@ -1252,13 +1252,19 @@ angle::Result TextureVk::ensureImageAllocated(ContextVk *contextVk, const vk::Fo ...@@ -1252,13 +1252,19 @@ angle::Result TextureVk::ensureImageAllocated(ContextVk *contextVk, const vk::Fo
VK_IMAGE_USAGE_SAMPLED_BIT; VK_IMAGE_USAGE_SAMPLED_BIT;
// If the image has depth/stencil support, add those as possible usage. // If the image has depth/stencil support, add those as possible usage.
if (contextVk->getRenderer()->hasImageFormatFeatureBits( RendererVk *renderer = contextVk->getRenderer();
format.vkImageFormat, VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) if (format.actualImageFormat().hasDepthOrStencilBits())
{ {
mImageUsageFlags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; // Work around a bug in the Mock ICD:
// https://github.com/KhronosGroup/Vulkan-Tools/issues/445
if (renderer->hasImageFormatFeatureBits(format.vkImageFormat,
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))
{
mImageUsageFlags |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
}
} }
else if (contextVk->getRenderer()->hasImageFormatFeatureBits( else if (renderer->hasImageFormatFeatureBits(format.vkImageFormat,
format.vkImageFormat, VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT))
{ {
mImageUsageFlags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; mImageUsageFlags |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
} }
......
...@@ -800,6 +800,7 @@ std::vector<TraceEvent> &ANGLERenderTest::getTraceEventBuffer() ...@@ -800,6 +800,7 @@ std::vector<TraceEvent> &ANGLERenderTest::getTraceEventBuffer()
void ANGLERenderTest::onErrorMessage(const char *errorMessage) void ANGLERenderTest::onErrorMessage(const char *errorMessage)
{ {
abortTest();
FAIL() << "Failing test because of unexpected internal ANGLE error:\n" << errorMessage << "\n"; FAIL() << "Failing test because of unexpected internal ANGLE error:\n" << errorMessage << "\n";
} }
......
...@@ -62,6 +62,14 @@ ParamsT Vulkan(const ParamsT &in) ...@@ -62,6 +62,14 @@ ParamsT Vulkan(const ParamsT &in)
} }
template <typename ParamsT> template <typename ParamsT>
ParamsT VulkanMockICD(const ParamsT &in)
{
ParamsT out = in;
out.eglParameters = angle::egl_platform::VULKAN_NULL();
return out;
}
template <typename ParamsT>
ParamsT WGL(const ParamsT &in) ParamsT WGL(const ParamsT &in)
{ {
ParamsT out = in; ParamsT out = in;
......
...@@ -244,6 +244,12 @@ void TracePerfTest::drawBenchmark() ...@@ -244,6 +244,12 @@ void TracePerfTest::drawBenchmark()
getGLWindow()->swap(); getGLWindow()->swap();
endInternalTraceEvent(frameName); endInternalTraceEvent(frameName);
// Check for abnormal exit.
if (!mRunning)
{
return;
}
} }
ResetReplay(GetParam().testID); ResetReplay(GetParam().testID);
...@@ -412,7 +418,8 @@ using P = TracePerfParams; ...@@ -412,7 +418,8 @@ using P = TracePerfParams;
std::vector<P> gTestsWithID = std::vector<P> gTestsWithID =
CombineWithValues({P()}, AllEnums<RestrictedTraceID>(), CombineTestID); CombineWithValues({P()}, AllEnums<RestrictedTraceID>(), CombineTestID);
std::vector<P> gTestsWithRenderer = CombineWithFuncs(gTestsWithID, {Vulkan<P>, Native<P>}); std::vector<P> gTestsWithRenderer =
CombineWithFuncs(gTestsWithID, {Vulkan<P>, VulkanMockICD<P>, Native<P>});
ANGLE_INSTANTIATE_TEST_ARRAY(TracePerfTest, gTestsWithRenderer); ANGLE_INSTANTIATE_TEST_ARRAY(TracePerfTest, gTestsWithRenderer);
} // anonymous namespace } // anonymous namespace
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