Commit 1cb9e275 authored by Saman Sami's avatar Saman Sami Committed by Commit Bot

Re-enable Vulkan viz_unittests

This CL enables all Vulkan viz_unittests except for video tests but
excludes configuration that failed in my previous attempt. As the fixes
roll in, I will enable more configurations.

Bug: 960795
Change-Id: Iddb7b7728a65622f4669672eff90d242d7f378f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635550Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664341}
parent d6b680a9
......@@ -7,6 +7,7 @@ include_rules = [
"+gpu/command_buffer/client/shared_memory_limits.h",
"+gpu/command_buffer/common/context_creation_attribs.h",
"+gpu/command_buffer/common/skia_utils.h",
"+gpu/command_buffer/service/gpu_switches.h",
"+gpu/command_buffer/service/image_factory.h",
"+gpu/config/gpu_feature_type.h",
"+gpu/config/gpu_info.h",
......
......@@ -40,6 +40,7 @@
#include "components/viz/test/test_shared_bitmap_manager.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/service_utils.h"
#include "gpu/config/gpu_feature_type.h"
#include "gpu/config/gpu_info.h"
......@@ -271,7 +272,12 @@ void PixelTest::SetUpGLRenderer(bool flipped_output_surface) {
renderer_->SetVisible(true);
}
void PixelTest::SetUpSkiaRenderer(bool flipped_output_surface) {
void PixelTest::SetUpSkiaRenderer(bool flipped_output_surface,
bool enable_vulkan) {
if (enable_vulkan) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
::switches::kEnableVulkan);
}
// Set up the GPU service.
gpu_service_holder_ = viz::TestGpuServiceHolder::GetInstance();
......
......@@ -112,7 +112,7 @@ class PixelTest : public testing::Test {
void SetUpGLWithoutRenderer(bool flipped_output_surface);
void SetUpGLRenderer(bool flipped_output_surface);
void SetUpSkiaRenderer(bool flipped_output_surface);
void SetUpSkiaRenderer(bool flipped_output_surface, bool enable_vulkan);
void SetUpSoftwareRenderer();
void TearDown() override;
......@@ -207,6 +207,35 @@ class SkiaRendererWithFlippedSurface : public viz::SkiaRenderer {
mode) {}
};
class VulkanSkiaRenderer : public viz::SkiaRenderer {
public:
VulkanSkiaRenderer(const viz::RendererSettings* settings,
viz::OutputSurface* output_surface,
viz::DisplayResourceProvider* resource_provider,
viz::SkiaOutputSurface* skia_output_surface,
DrawMode mode)
: SkiaRenderer(settings,
output_surface,
resource_provider,
skia_output_surface,
mode) {}
};
class VulkanSkiaRendererWithFlippedSurface : public viz::SkiaRenderer {
public:
VulkanSkiaRendererWithFlippedSurface(
const viz::RendererSettings* settings,
viz::OutputSurface* output_surface,
viz::DisplayResourceProvider* resource_provider,
viz::SkiaOutputSurface* skia_output_surface,
DrawMode mode)
: SkiaRenderer(settings,
output_surface,
resource_provider,
skia_output_surface,
mode) {}
};
template <>
inline void RendererPixelTest<viz::GLRenderer>::SetUp() {
SetUpGLRenderer(false);
......@@ -234,17 +263,26 @@ inline void RendererPixelTest<SoftwareRendererWithExpandedViewport>::SetUp() {
template <>
inline void RendererPixelTest<viz::SkiaRenderer>::SetUp() {
SetUpSkiaRenderer(false);
SetUpSkiaRenderer(false, false);
}
template <>
inline void RendererPixelTest<SkiaRendererWithFlippedSurface>::SetUp() {
SetUpSkiaRenderer(true);
SetUpSkiaRenderer(true, false);
}
template <>
inline void RendererPixelTest<VulkanSkiaRenderer>::SetUp() {
SetUpSkiaRenderer(false, true);
}
template <>
inline void RendererPixelTest<VulkanSkiaRendererWithFlippedSurface>::SetUp() {
SetUpSkiaRenderer(true, true);
}
typedef RendererPixelTest<viz::GLRenderer> GLRendererPixelTest;
typedef RendererPixelTest<viz::SoftwareRenderer> SoftwareRendererPixelTest;
typedef RendererPixelTest<viz::SkiaRenderer> SkiaRendererPixelTest;
} // namespace cc
......
......@@ -486,6 +486,14 @@ viz_source_set("unit_tests") {
"//gpu/vulkan/init",
]
}
# TODO(samans): Support more configurations.
# MSAN issue: https://crbug.com/967819
# CFI issue: https://crbug.com/967819
# x86 issue: https://crbug.com/967831
if (use_x11 && !is_msan && target_cpu != "x86" && !is_cfi) {
defines = [ "ENABLE_VIZ_VULKAN_TESTS" ]
}
}
viz_source_set("perf_tests") {
......
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