Commit 32732665 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

Enable Vulkan support by default

Currently, building with Vulkan support is behind a gn flag
(enable_vulkan). It would be easy to not build & test with this flag. As
a result, it would also be easy to allow Vulkan support to bitrot.

Enabling Vulkan building by default would keep the Vulkan code
buildable. This patch does that.

(You still need a command line parameter of --enable-vulkan when running
Chrome to actually use the Vulkan codepath. This is just for the
building.)

BUG=848100

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I26fa03f9f6e2dc924691db913f723661b510f272
Reviewed-on: https://chromium-review.googlesource.com/1098117Reviewed-by: default avatarBrian Salomon <bsalomon@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567307}
parent 2520b39f
......@@ -14,60 +14,57 @@ buildflag_header("buildflags") {
}
if (enable_vulkan) {
vulkan_lib_dir = getenv("VULKAN_SDK") + "/lib"
component("vulkan") {
output_name = "vulkan_wrapper"
if (is_linux) {
sources = [
"vulkan_command_buffer.cc",
"vulkan_command_buffer.h",
"vulkan_command_pool.cc",
"vulkan_command_pool.h",
"vulkan_descriptor_layout.cc",
"vulkan_descriptor_layout.h",
"vulkan_descriptor_pool.cc",
"vulkan_descriptor_pool.h",
"vulkan_descriptor_set.cc",
"vulkan_descriptor_set.h",
"vulkan_device_queue.cc",
"vulkan_device_queue.h",
"vulkan_export.h",
"vulkan_function_pointers.cc",
"vulkan_function_pointers.h",
"vulkan_image_view.cc",
"vulkan_image_view.h",
"vulkan_implementation.cc",
"vulkan_implementation.h",
"vulkan_instance.cc",
"vulkan_instance.h",
"vulkan_render_pass.cc",
"vulkan_render_pass.h",
"vulkan_sampler.cc",
"vulkan_sampler.h",
"vulkan_shader_module.cc",
"vulkan_shader_module.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_swap_chain.cc",
"vulkan_swap_chain.h",
]
sources = [
"vulkan_command_buffer.cc",
"vulkan_command_buffer.h",
"vulkan_command_pool.cc",
"vulkan_command_pool.h",
"vulkan_descriptor_layout.cc",
"vulkan_descriptor_layout.h",
"vulkan_descriptor_pool.cc",
"vulkan_descriptor_pool.h",
"vulkan_descriptor_set.cc",
"vulkan_descriptor_set.h",
"vulkan_device_queue.cc",
"vulkan_device_queue.h",
"vulkan_export.h",
"vulkan_function_pointers.cc",
"vulkan_function_pointers.h",
"vulkan_image_view.cc",
"vulkan_image_view.h",
"vulkan_implementation.cc",
"vulkan_implementation.h",
"vulkan_instance.cc",
"vulkan_instance.h",
"vulkan_render_pass.cc",
"vulkan_render_pass.h",
"vulkan_sampler.cc",
"vulkan_sampler.h",
"vulkan_shader_module.cc",
"vulkan_shader_module.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_swap_chain.cc",
"vulkan_swap_chain.h",
]
configs += [ "//build/config:precompiled_headers" ]
configs += [ "//build/config:precompiled_headers" ]
defines = [ "VULKAN_IMPLEMENTATION" ]
defines = [ "VULKAN_IMPLEMENTATION" ]
if (use_x11) {
defines += [ "VK_USE_PLATFORM_XLIB_KHR" ]
}
if (use_x11) {
defines += [ "VK_USE_PLATFORM_XLIB_KHR" ]
}
all_dependent_configs = [ "//third_party/vulkan:vulkan_config" ]
all_dependent_configs = [ "//third_party/vulkan:vulkan_config" ]
deps = [
"//base",
"//ui/gfx",
]
}
deps = [
"//base",
"//ui/gfx",
]
}
test("vulkan_tests") {
......@@ -79,15 +76,6 @@ if (enable_vulkan) {
"tests/vulkan_tests_main.cc",
]
if (current_cpu == "x64") {
lib_dirs = [
"/usr/lib/x86_64-linux-gnu",
vulkan_lib_dir,
]
} else {
assert(false, "Unsupported vulkan target: " + current_cpu)
}
deps = [
"//base/test:test_support",
"//gpu/vulkan/init",
......
......@@ -2,9 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ui.gni")
# Features used by targets inside and outside of |gpu/vulkan|.
# For details see declare_args() in build/config/BUILDCONFIG.gn.
declare_args() {
# Enable experimental vulkan backend.
enable_vulkan = false
enable_vulkan = is_linux && use_x11
}
......@@ -23,9 +23,6 @@ skia_support_pdf = !is_ios && enable_basic_printing
declare_args() {
skia_whitelist_serialized_typefaces = false
if (enable_vulkan) {
vulkan_sdk_path = getenv("VULKAN_SDK")
}
}
# External-facing config for dependent code.
......@@ -49,7 +46,7 @@ config("skia_config") {
]
if (enable_vulkan) {
include_dirs += [
"$vulkan_sdk_path/include",
"//third_party/vulkan/include",
"//third_party/skia/third_party/vulkanmemoryallocator",
]
configs = [ "//third_party/vulkan:vulkan_config" ]
......
......@@ -5,15 +5,4 @@
config("vulkan_config") {
defines = [ "VK_NO_PROTOTYPES" ]
include_dirs = [ "include" ]
vulkan_lib_dir = getenv("VULKAN_SDK") + "/lib"
libs = [ "vulkan" ]
if (current_cpu == "x64") {
lib_dirs = [
"/usr/lib/x86_64-linux-gnu",
vulkan_lib_dir,
]
} else {
assert(false, "Unsupported vulkan target: " + current_cpu)
}
}
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