2018-07-31 16:50:03 +00:00
|
|
|
# Copyright 2018 The Dawn Authors
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2018-10-31 10:49:21 +00:00
|
|
|
import("//build_overrides/build.gni")
|
2019-11-07 12:13:27 +00:00
|
|
|
import("//build_overrides/vulkan_validation_layers.gni")
|
2019-05-22 17:18:52 +00:00
|
|
|
import("generator/dawn_generator.gni")
|
2019-03-06 23:17:39 +00:00
|
|
|
import("scripts/dawn_component.gni")
|
2019-02-13 18:42:38 +00:00
|
|
|
import("scripts/dawn_features.gni")
|
|
|
|
import("scripts/dawn_overrides_with_defaults.gni")
|
2018-12-08 10:35:53 +00:00
|
|
|
|
|
|
|
import("//testing/test.gni")
|
2018-07-31 16:50:03 +00:00
|
|
|
|
2019-11-26 18:21:51 +00:00
|
|
|
# Swiftshader is an optional dependency of Dawn so we only use it if the path
|
|
|
|
# to it has been set.
|
|
|
|
use_swiftshader = dawn_use_swiftshader && dawn_swiftshader_dir != ""
|
|
|
|
|
|
|
|
if (use_swiftshader) {
|
|
|
|
assert(dawn_enable_vulkan,
|
|
|
|
"dawn_use_swiftshader requires dawn_enable_vulkan=true")
|
|
|
|
import("${dawn_swiftshader_dir}/src/Vulkan/vulkan.gni")
|
|
|
|
}
|
|
|
|
|
2019-12-11 16:54:51 +00:00
|
|
|
# Import mac_min_system_version
|
|
|
|
if (is_mac) {
|
|
|
|
import("//build/config/mac/mac_sdk.gni")
|
|
|
|
}
|
|
|
|
|
2019-08-13 19:00:34 +00:00
|
|
|
###############################################################################
|
|
|
|
# dawn_platform
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
source_set("dawn_platform") {
|
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"${dawn_root}/src/include/dawn_platform/DawnPlatform.h",
|
|
|
|
"src/dawn_platform/tracing/EventTracer.cpp",
|
|
|
|
"src/dawn_platform/tracing/EventTracer.h",
|
|
|
|
"src/dawn_platform/tracing/TraceEvent.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
"${dawn_root}/src/common",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-07-31 16:50:03 +00:00
|
|
|
###############################################################################
|
2019-01-09 09:05:18 +00:00
|
|
|
# libdawn_native
|
2018-07-31 16:50:03 +00:00
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
config("libdawn_native_internal") {
|
2019-03-07 01:46:39 +00:00
|
|
|
configs = [ "${dawn_root}/src/common:dawn_internal" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
|
2019-09-18 04:40:32 +00:00
|
|
|
# Suppress warnings that Metal isn't in the deployment target of Chrome:
|
|
|
|
# initialization of the Metal backend is behind a IsMetalSupported check so
|
|
|
|
# Dawn won't call Metal functions on macOS 10.10.
|
2019-12-11 16:54:51 +00:00
|
|
|
# At the time this is written Chromium supports 10.10.0 and above, so if we
|
|
|
|
# aren't on 10.11 it means we are on 10.11 and above, and Metal is available.
|
|
|
|
# Skipping this check on 10.11 and above is important as it allows getting
|
|
|
|
# proper compilation warning when using 10.12 and above feature for example.
|
2019-09-18 04:40:32 +00:00
|
|
|
# TODO(cwallez@chromium.org): Consider using API_AVAILABLE annotations on all
|
2019-12-11 16:54:51 +00:00
|
|
|
# metal code in dawn once crbug.com/1004024 is sorted out if Chromium still
|
|
|
|
# supports 10.10 then.
|
|
|
|
if (is_mac && mac_min_system_version == "10.10.0") {
|
2018-07-31 16:50:03 +00:00
|
|
|
cflags_objcc = [ "-Wno-unguarded-availability" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-21 11:35:49 +00:00
|
|
|
config("libdawn_native_weak_framework") {
|
|
|
|
if (is_mac && dawn_enable_metal) {
|
|
|
|
ldflags = [
|
|
|
|
"-weak_framework",
|
|
|
|
"Metal",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-11 18:03:05 +00:00
|
|
|
dawn_json_generator("libdawn_native_utils_gen") {
|
2018-07-31 16:50:03 +00:00
|
|
|
target = "dawn_native_utils"
|
2018-08-16 13:32:35 +00:00
|
|
|
outputs = [
|
2019-09-18 04:33:12 +00:00
|
|
|
"src/dawn_native/ProcTable.cpp",
|
2019-10-23 11:57:41 +00:00
|
|
|
"src/dawn_native/wgpu_structs_autogen.h",
|
|
|
|
"src/dawn_native/wgpu_structs_autogen.cpp",
|
2019-09-18 04:33:12 +00:00
|
|
|
"src/dawn_native/ValidationUtils_autogen.h",
|
|
|
|
"src/dawn_native/ValidationUtils_autogen.cpp",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-06-13 10:22:32 +00:00
|
|
|
if (dawn_enable_opengl) {
|
|
|
|
dawn_generator("libdawn_native_opengl_loader_gen") {
|
|
|
|
script = "generator/opengl_loader_generator.py"
|
|
|
|
args = [
|
|
|
|
"--gl-xml",
|
2019-06-17 09:17:29 +00:00
|
|
|
rebase_path("third_party/khronos/gl.xml", root_build_dir),
|
2019-08-22 08:19:13 +00:00
|
|
|
"--supported-extensions",
|
|
|
|
rebase_path("src/dawn_native/opengl/supported_extensions.json",
|
|
|
|
root_build_dir),
|
2019-06-13 10:22:32 +00:00
|
|
|
]
|
|
|
|
outputs = [
|
2019-09-18 04:33:12 +00:00
|
|
|
"src/dawn_native/opengl/OpenGLFunctionsBase_autogen.cpp",
|
|
|
|
"src/dawn_native/opengl/OpenGLFunctionsBase_autogen.h",
|
|
|
|
"src/dawn_native/opengl/opengl_platform_autogen.h",
|
2019-06-13 10:22:32 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-12 19:07:46 +00:00
|
|
|
# Public libdawn_native headers so they can be publically visible for
|
|
|
|
# dependencies of libdawn_native
|
|
|
|
source_set("libdawn_native_headers") {
|
|
|
|
public_deps = [
|
2019-10-16 10:26:01 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp_headers",
|
2018-08-12 19:07:46 +00:00
|
|
|
]
|
2019-03-26 17:16:28 +00:00
|
|
|
all_dependent_configs = [ "${dawn_root}/src/common:dawn_public_include_dirs" ]
|
2018-08-12 19:07:46 +00:00
|
|
|
sources = [
|
|
|
|
"src/include/dawn_native/DawnNative.h",
|
|
|
|
"src/include/dawn_native/dawn_native_export.h",
|
|
|
|
|
|
|
|
# Include all backend's public headers so that dependencies can include
|
|
|
|
# them even when the backends are disabled.
|
|
|
|
"src/include/dawn_native/D3D12Backend.h",
|
|
|
|
"src/include/dawn_native/MetalBackend.h",
|
|
|
|
"src/include/dawn_native/NullBackend.h",
|
|
|
|
"src/include/dawn_native/OpenGLBackend.h",
|
|
|
|
"src/include/dawn_native/VulkanBackend.h",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-07-31 16:50:03 +00:00
|
|
|
# The meat of the compilation for libdawn_native so that we can cheaply have
|
2019-01-09 09:05:18 +00:00
|
|
|
# shared_library / static_library versions of it. It compiles all the files
|
|
|
|
# except those that define exported symbols.
|
2018-07-31 16:50:03 +00:00
|
|
|
source_set("libdawn_native_sources") {
|
|
|
|
deps = [
|
2019-01-09 09:05:18 +00:00
|
|
|
":libdawn_native_headers",
|
2018-08-16 13:32:35 +00:00
|
|
|
":libdawn_native_utils_gen",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-11-28 17:14:55 +00:00
|
|
|
"${dawn_shaderc_dir}:spirv_cross",
|
2018-09-06 15:25:46 +00:00
|
|
|
"${dawn_spirv_tools_dir}:spvtools_val",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
2019-11-21 18:08:15 +00:00
|
|
|
defines = []
|
2019-11-26 18:21:51 +00:00
|
|
|
libs = []
|
|
|
|
data_deps = []
|
2019-11-21 20:31:05 +00:00
|
|
|
|
2018-11-14 21:04:26 +00:00
|
|
|
configs += [ ":libdawn_native_internal" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
|
2019-07-22 23:32:29 +00:00
|
|
|
# Dependencies that are needed to compile libdawn_native entry points in
|
|
|
|
# FooBackend.cpp need to be public deps so they are propagated to the
|
|
|
|
# libdawn_native target
|
2019-08-13 19:00:34 +00:00
|
|
|
public_deps = [
|
|
|
|
":dawn_platform",
|
2019-12-03 20:25:13 +00:00
|
|
|
"${dawn_shaderc_dir}:libshaderc_spvc",
|
2019-08-13 19:00:34 +00:00
|
|
|
]
|
2019-07-22 23:32:29 +00:00
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
sources = get_target_outputs(":libdawn_native_utils_gen")
|
|
|
|
sources += [
|
2019-01-04 10:30:40 +00:00
|
|
|
"src/dawn_native/Adapter.cpp",
|
|
|
|
"src/dawn_native/Adapter.h",
|
2019-07-26 19:08:18 +00:00
|
|
|
"src/dawn_native/AttachmentState.cpp",
|
|
|
|
"src/dawn_native/AttachmentState.h",
|
2019-01-04 10:30:40 +00:00
|
|
|
"src/dawn_native/BackendConnection.cpp",
|
|
|
|
"src/dawn_native/BackendConnection.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/BindGroup.cpp",
|
|
|
|
"src/dawn_native/BindGroup.h",
|
|
|
|
"src/dawn_native/BindGroupLayout.cpp",
|
|
|
|
"src/dawn_native/BindGroupLayout.h",
|
2019-09-17 19:25:27 +00:00
|
|
|
"src/dawn_native/BindGroupTracker.h",
|
2019-07-30 16:46:10 +00:00
|
|
|
"src/dawn_native/BuddyAllocator.cpp",
|
|
|
|
"src/dawn_native/BuddyAllocator.h",
|
2019-10-03 18:17:31 +00:00
|
|
|
"src/dawn_native/BuddyMemoryAllocator.cpp",
|
|
|
|
"src/dawn_native/BuddyMemoryAllocator.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Buffer.cpp",
|
|
|
|
"src/dawn_native/Buffer.h",
|
2019-10-30 00:20:03 +00:00
|
|
|
"src/dawn_native/CachedObject.cpp",
|
|
|
|
"src/dawn_native/CachedObject.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/CommandAllocator.cpp",
|
|
|
|
"src/dawn_native/CommandAllocator.h",
|
|
|
|
"src/dawn_native/CommandBuffer.cpp",
|
|
|
|
"src/dawn_native/CommandBuffer.h",
|
|
|
|
"src/dawn_native/CommandBufferStateTracker.cpp",
|
|
|
|
"src/dawn_native/CommandBufferStateTracker.h",
|
2019-02-15 12:54:08 +00:00
|
|
|
"src/dawn_native/CommandEncoder.cpp",
|
|
|
|
"src/dawn_native/CommandEncoder.h",
|
2019-08-13 00:22:28 +00:00
|
|
|
"src/dawn_native/CommandValidation.cpp",
|
|
|
|
"src/dawn_native/CommandValidation.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Commands.cpp",
|
|
|
|
"src/dawn_native/Commands.h",
|
2018-09-21 00:24:37 +00:00
|
|
|
"src/dawn_native/ComputePassEncoder.cpp",
|
|
|
|
"src/dawn_native/ComputePassEncoder.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/ComputePipeline.cpp",
|
|
|
|
"src/dawn_native/ComputePipeline.h",
|
|
|
|
"src/dawn_native/Device.cpp",
|
|
|
|
"src/dawn_native/Device.h",
|
2019-01-29 00:10:07 +00:00
|
|
|
"src/dawn_native/DynamicUploader.cpp",
|
|
|
|
"src/dawn_native/DynamicUploader.h",
|
2019-07-24 18:15:24 +00:00
|
|
|
"src/dawn_native/EncodingContext.cpp",
|
|
|
|
"src/dawn_native/EncodingContext.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Error.h",
|
|
|
|
"src/dawn_native/ErrorData.cpp",
|
|
|
|
"src/dawn_native/ErrorData.h",
|
2019-12-17 00:47:40 +00:00
|
|
|
"src/dawn_native/ErrorInjector.cpp",
|
|
|
|
"src/dawn_native/ErrorInjector.h",
|
2019-09-10 23:19:11 +00:00
|
|
|
"src/dawn_native/ErrorScope.cpp",
|
|
|
|
"src/dawn_native/ErrorScope.h",
|
2019-09-17 18:24:07 +00:00
|
|
|
"src/dawn_native/ErrorScopeTracker.cpp",
|
|
|
|
"src/dawn_native/ErrorScopeTracker.h",
|
2019-08-02 00:06:38 +00:00
|
|
|
"src/dawn_native/Extensions.cpp",
|
|
|
|
"src/dawn_native/Extensions.h",
|
2018-12-03 16:57:34 +00:00
|
|
|
"src/dawn_native/Fence.cpp",
|
|
|
|
"src/dawn_native/Fence.h",
|
|
|
|
"src/dawn_native/FenceSignalTracker.cpp",
|
|
|
|
"src/dawn_native/FenceSignalTracker.h",
|
2019-07-18 09:25:04 +00:00
|
|
|
"src/dawn_native/Format.cpp",
|
|
|
|
"src/dawn_native/Format.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Forward.h",
|
2019-01-04 10:30:40 +00:00
|
|
|
"src/dawn_native/Instance.cpp",
|
|
|
|
"src/dawn_native/Instance.h",
|
2018-10-15 12:54:30 +00:00
|
|
|
"src/dawn_native/ObjectBase.cpp",
|
|
|
|
"src/dawn_native/ObjectBase.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/PassResourceUsage.h",
|
2019-08-08 17:21:39 +00:00
|
|
|
"src/dawn_native/PassResourceUsageTracker.cpp",
|
|
|
|
"src/dawn_native/PassResourceUsageTracker.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/PerStage.cpp",
|
|
|
|
"src/dawn_native/PerStage.h",
|
|
|
|
"src/dawn_native/Pipeline.cpp",
|
|
|
|
"src/dawn_native/Pipeline.h",
|
|
|
|
"src/dawn_native/PipelineLayout.cpp",
|
|
|
|
"src/dawn_native/PipelineLayout.h",
|
2018-09-21 00:24:37 +00:00
|
|
|
"src/dawn_native/ProgrammablePassEncoder.cpp",
|
|
|
|
"src/dawn_native/ProgrammablePassEncoder.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Queue.cpp",
|
|
|
|
"src/dawn_native/Queue.h",
|
|
|
|
"src/dawn_native/RefCounted.cpp",
|
|
|
|
"src/dawn_native/RefCounted.h",
|
2019-08-13 22:12:54 +00:00
|
|
|
"src/dawn_native/RenderBundle.cpp",
|
|
|
|
"src/dawn_native/RenderBundle.h",
|
|
|
|
"src/dawn_native/RenderBundleEncoder.cpp",
|
|
|
|
"src/dawn_native/RenderBundleEncoder.h",
|
2019-07-20 01:34:56 +00:00
|
|
|
"src/dawn_native/RenderEncoderBase.cpp",
|
|
|
|
"src/dawn_native/RenderEncoderBase.h",
|
2018-09-21 00:24:37 +00:00
|
|
|
"src/dawn_native/RenderPassEncoder.cpp",
|
|
|
|
"src/dawn_native/RenderPassEncoder.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/RenderPipeline.cpp",
|
|
|
|
"src/dawn_native/RenderPipeline.h",
|
2019-08-27 23:36:26 +00:00
|
|
|
"src/dawn_native/ResourceHeap.h",
|
2019-10-24 21:28:16 +00:00
|
|
|
"src/dawn_native/ResourceHeapAllocator.h",
|
2019-08-27 23:36:26 +00:00
|
|
|
"src/dawn_native/ResourceMemoryAllocation.cpp",
|
|
|
|
"src/dawn_native/ResourceMemoryAllocation.h",
|
2019-09-18 22:06:41 +00:00
|
|
|
"src/dawn_native/RingBufferAllocator.cpp",
|
|
|
|
"src/dawn_native/RingBufferAllocator.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Sampler.cpp",
|
|
|
|
"src/dawn_native/Sampler.h",
|
|
|
|
"src/dawn_native/ShaderModule.cpp",
|
|
|
|
"src/dawn_native/ShaderModule.h",
|
2019-01-29 00:10:07 +00:00
|
|
|
"src/dawn_native/StagingBuffer.cpp",
|
|
|
|
"src/dawn_native/StagingBuffer.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/SwapChain.cpp",
|
|
|
|
"src/dawn_native/SwapChain.h",
|
|
|
|
"src/dawn_native/Texture.cpp",
|
|
|
|
"src/dawn_native/Texture.h",
|
|
|
|
"src/dawn_native/ToBackend.h",
|
2019-07-30 23:58:52 +00:00
|
|
|
"src/dawn_native/Toggles.cpp",
|
2019-04-26 07:52:57 +00:00
|
|
|
"src/dawn_native/Toggles.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/dawn_platform.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (dawn_enable_d3d12) {
|
2018-08-30 12:20:28 +00:00
|
|
|
libs += [ "dxguid.lib" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
sources += [
|
2019-01-30 16:07:48 +00:00
|
|
|
"src/dawn_native/d3d12/AdapterD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/AdapterD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/BackendD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/BackendD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/BindGroupD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/BindGroupD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/BindGroupLayoutD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/BindGroupLayoutD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/BufferD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/BufferD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/CommandAllocatorManager.cpp",
|
|
|
|
"src/dawn_native/d3d12/CommandAllocatorManager.h",
|
|
|
|
"src/dawn_native/d3d12/CommandBufferD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/CommandBufferD3D12.h",
|
2019-10-10 18:06:58 +00:00
|
|
|
"src/dawn_native/d3d12/CommandRecordingContext.cpp",
|
|
|
|
"src/dawn_native/d3d12/CommandRecordingContext.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/ComputePipelineD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/ComputePipelineD3D12.h",
|
2019-10-16 09:26:54 +00:00
|
|
|
"src/dawn_native/d3d12/D3D12Error.cpp",
|
|
|
|
"src/dawn_native/d3d12/D3D12Error.h",
|
2019-06-12 18:54:57 +00:00
|
|
|
"src/dawn_native/d3d12/D3D12Info.cpp",
|
|
|
|
"src/dawn_native/d3d12/D3D12Info.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/DescriptorHeapAllocator.cpp",
|
|
|
|
"src/dawn_native/d3d12/DescriptorHeapAllocator.h",
|
|
|
|
"src/dawn_native/d3d12/DeviceD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/DeviceD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/Forward.h",
|
2019-10-17 17:25:28 +00:00
|
|
|
"src/dawn_native/d3d12/HeapAllocatorD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/HeapAllocatorD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/HeapD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/HeapD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/NativeSwapChainImplD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/NativeSwapChainImplD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/PipelineLayoutD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/PipelineLayoutD3D12.h",
|
2018-08-30 12:20:28 +00:00
|
|
|
"src/dawn_native/d3d12/PlatformFunctions.cpp",
|
|
|
|
"src/dawn_native/d3d12/PlatformFunctions.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/QueueD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/QueueD3D12.h",
|
2019-11-12 18:14:21 +00:00
|
|
|
"src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/RenderPassBuilderD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/RenderPipelineD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/RenderPipelineD3D12.h",
|
2019-10-02 21:45:09 +00:00
|
|
|
"src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/ResourceAllocatorManagerD3D12.h",
|
2019-10-09 16:50:42 +00:00
|
|
|
"src/dawn_native/d3d12/ResourceHeapAllocationD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/ResourceHeapAllocationD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/SamplerD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/SamplerD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/ShaderModuleD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/ShaderModuleD3D12.h",
|
2019-01-29 00:10:07 +00:00
|
|
|
"src/dawn_native/d3d12/StagingBufferD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/StagingBufferD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/SwapChainD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/SwapChainD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/TextureCopySplitter.cpp",
|
|
|
|
"src/dawn_native/d3d12/TextureCopySplitter.h",
|
|
|
|
"src/dawn_native/d3d12/TextureD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/TextureD3D12.h",
|
2019-01-04 04:56:08 +00:00
|
|
|
"src/dawn_native/d3d12/UtilsD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/UtilsD3D12.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/d3d12/d3d12_platform.h",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
libs += [
|
|
|
|
"Cocoa.framework",
|
2018-11-29 10:54:03 +00:00
|
|
|
"IOKit.framework",
|
2019-03-01 12:01:18 +00:00
|
|
|
"IOSurface.framework",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
sources += [
|
2019-02-05 13:02:30 +00:00
|
|
|
"src/dawn_native/metal/BackendMTL.h",
|
|
|
|
"src/dawn_native/metal/BackendMTL.mm",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/metal/BufferMTL.h",
|
|
|
|
"src/dawn_native/metal/BufferMTL.mm",
|
|
|
|
"src/dawn_native/metal/CommandBufferMTL.h",
|
|
|
|
"src/dawn_native/metal/CommandBufferMTL.mm",
|
|
|
|
"src/dawn_native/metal/ComputePipelineMTL.h",
|
|
|
|
"src/dawn_native/metal/ComputePipelineMTL.mm",
|
|
|
|
"src/dawn_native/metal/DeviceMTL.h",
|
|
|
|
"src/dawn_native/metal/DeviceMTL.mm",
|
|
|
|
"src/dawn_native/metal/Forward.h",
|
|
|
|
"src/dawn_native/metal/PipelineLayoutMTL.h",
|
|
|
|
"src/dawn_native/metal/PipelineLayoutMTL.mm",
|
|
|
|
"src/dawn_native/metal/QueueMTL.h",
|
|
|
|
"src/dawn_native/metal/QueueMTL.mm",
|
|
|
|
"src/dawn_native/metal/RenderPipelineMTL.h",
|
|
|
|
"src/dawn_native/metal/RenderPipelineMTL.mm",
|
|
|
|
"src/dawn_native/metal/SamplerMTL.h",
|
|
|
|
"src/dawn_native/metal/SamplerMTL.mm",
|
|
|
|
"src/dawn_native/metal/ShaderModuleMTL.h",
|
|
|
|
"src/dawn_native/metal/ShaderModuleMTL.mm",
|
2019-02-15 21:18:40 +00:00
|
|
|
"src/dawn_native/metal/StagingBufferMTL.h",
|
|
|
|
"src/dawn_native/metal/StagingBufferMTL.mm",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/metal/SwapChainMTL.h",
|
|
|
|
"src/dawn_native/metal/SwapChainMTL.mm",
|
|
|
|
"src/dawn_native/metal/TextureMTL.h",
|
|
|
|
"src/dawn_native/metal/TextureMTL.mm",
|
2019-01-04 04:56:08 +00:00
|
|
|
"src/dawn_native/metal/UtilsMetal.h",
|
|
|
|
"src/dawn_native/metal/UtilsMetal.mm",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_null) {
|
|
|
|
sources += [
|
2019-01-09 08:35:16 +00:00
|
|
|
"src/dawn_native/null/DeviceNull.cpp",
|
|
|
|
"src/dawn_native/null/DeviceNull.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_opengl) {
|
2019-07-22 23:32:29 +00:00
|
|
|
public_deps += [
|
2019-06-13 10:22:32 +00:00
|
|
|
":libdawn_native_opengl_loader_gen",
|
2019-06-17 09:17:29 +00:00
|
|
|
"third_party:khronos_platform",
|
2019-06-13 10:22:32 +00:00
|
|
|
]
|
|
|
|
sources += get_target_outputs(":libdawn_native_opengl_loader_gen")
|
2018-07-31 16:50:03 +00:00
|
|
|
sources += [
|
2019-01-07 09:48:03 +00:00
|
|
|
"src/dawn_native/opengl/BackendGL.cpp",
|
|
|
|
"src/dawn_native/opengl/BackendGL.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/opengl/BufferGL.cpp",
|
|
|
|
"src/dawn_native/opengl/BufferGL.h",
|
|
|
|
"src/dawn_native/opengl/CommandBufferGL.cpp",
|
|
|
|
"src/dawn_native/opengl/CommandBufferGL.h",
|
|
|
|
"src/dawn_native/opengl/ComputePipelineGL.cpp",
|
|
|
|
"src/dawn_native/opengl/ComputePipelineGL.h",
|
|
|
|
"src/dawn_native/opengl/DeviceGL.cpp",
|
|
|
|
"src/dawn_native/opengl/DeviceGL.h",
|
|
|
|
"src/dawn_native/opengl/Forward.h",
|
2019-07-23 06:40:54 +00:00
|
|
|
"src/dawn_native/opengl/GLFormat.cpp",
|
|
|
|
"src/dawn_native/opengl/GLFormat.h",
|
2019-06-17 09:01:09 +00:00
|
|
|
"src/dawn_native/opengl/NativeSwapChainImplGL.cpp",
|
|
|
|
"src/dawn_native/opengl/NativeSwapChainImplGL.h",
|
2019-06-13 10:22:32 +00:00
|
|
|
"src/dawn_native/opengl/OpenGLFunctions.cpp",
|
|
|
|
"src/dawn_native/opengl/OpenGLFunctions.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/opengl/PersistentPipelineStateGL.cpp",
|
|
|
|
"src/dawn_native/opengl/PersistentPipelineStateGL.h",
|
|
|
|
"src/dawn_native/opengl/PipelineGL.cpp",
|
|
|
|
"src/dawn_native/opengl/PipelineGL.h",
|
|
|
|
"src/dawn_native/opengl/PipelineLayoutGL.cpp",
|
|
|
|
"src/dawn_native/opengl/PipelineLayoutGL.h",
|
|
|
|
"src/dawn_native/opengl/QueueGL.cpp",
|
|
|
|
"src/dawn_native/opengl/QueueGL.h",
|
|
|
|
"src/dawn_native/opengl/RenderPipelineGL.cpp",
|
|
|
|
"src/dawn_native/opengl/RenderPipelineGL.h",
|
|
|
|
"src/dawn_native/opengl/SamplerGL.cpp",
|
|
|
|
"src/dawn_native/opengl/SamplerGL.h",
|
|
|
|
"src/dawn_native/opengl/ShaderModuleGL.cpp",
|
|
|
|
"src/dawn_native/opengl/ShaderModuleGL.h",
|
|
|
|
"src/dawn_native/opengl/SwapChainGL.cpp",
|
|
|
|
"src/dawn_native/opengl/SwapChainGL.h",
|
|
|
|
"src/dawn_native/opengl/TextureGL.cpp",
|
|
|
|
"src/dawn_native/opengl/TextureGL.h",
|
2019-01-04 04:56:08 +00:00
|
|
|
"src/dawn_native/opengl/UtilsGL.cpp",
|
|
|
|
"src/dawn_native/opengl/UtilsGL.h",
|
2019-06-17 09:17:29 +00:00
|
|
|
"src/dawn_native/opengl/opengl_platform.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_vulkan) {
|
2019-07-22 23:32:29 +00:00
|
|
|
public_deps += [ "third_party:vulkan_headers" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
sources += [
|
2019-02-04 09:31:09 +00:00
|
|
|
"src/dawn_native/vulkan/AdapterVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/AdapterVk.h",
|
|
|
|
"src/dawn_native/vulkan/BackendVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/BackendVk.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/BindGroupLayoutVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/BindGroupLayoutVk.h",
|
|
|
|
"src/dawn_native/vulkan/BindGroupVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/BindGroupVk.h",
|
|
|
|
"src/dawn_native/vulkan/BufferVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/BufferVk.h",
|
|
|
|
"src/dawn_native/vulkan/CommandBufferVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/CommandBufferVk.h",
|
2019-09-18 04:33:12 +00:00
|
|
|
"src/dawn_native/vulkan/CommandRecordingContext.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/ComputePipelineVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/ComputePipelineVk.h",
|
2019-11-05 15:44:05 +00:00
|
|
|
"src/dawn_native/vulkan/DescriptorSetService.cpp",
|
|
|
|
"src/dawn_native/vulkan/DescriptorSetService.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/DeviceVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/DeviceVk.h",
|
2019-08-10 03:17:52 +00:00
|
|
|
"src/dawn_native/vulkan/ExternalHandle.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/FencedDeleter.cpp",
|
|
|
|
"src/dawn_native/vulkan/FencedDeleter.h",
|
|
|
|
"src/dawn_native/vulkan/Forward.h",
|
|
|
|
"src/dawn_native/vulkan/NativeSwapChainImplVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/NativeSwapChainImplVk.h",
|
|
|
|
"src/dawn_native/vulkan/PipelineLayoutVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/PipelineLayoutVk.h",
|
|
|
|
"src/dawn_native/vulkan/QueueVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/QueueVk.h",
|
|
|
|
"src/dawn_native/vulkan/RenderPassCache.cpp",
|
|
|
|
"src/dawn_native/vulkan/RenderPassCache.h",
|
|
|
|
"src/dawn_native/vulkan/RenderPipelineVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/RenderPipelineVk.h",
|
2019-10-24 21:24:27 +00:00
|
|
|
"src/dawn_native/vulkan/ResourceHeapVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/ResourceHeapVk.h",
|
|
|
|
"src/dawn_native/vulkan/ResourceMemoryAllocatorVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/ResourceMemoryAllocatorVk.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/SamplerVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/SamplerVk.h",
|
|
|
|
"src/dawn_native/vulkan/ShaderModuleVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/ShaderModuleVk.h",
|
2019-02-06 18:10:12 +00:00
|
|
|
"src/dawn_native/vulkan/StagingBufferVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/StagingBufferVk.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/SwapChainVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/SwapChainVk.h",
|
|
|
|
"src/dawn_native/vulkan/TextureVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/TextureVk.h",
|
2019-01-04 04:56:08 +00:00
|
|
|
"src/dawn_native/vulkan/UtilsVulkan.cpp",
|
|
|
|
"src/dawn_native/vulkan/UtilsVulkan.h",
|
2019-01-04 10:18:40 +00:00
|
|
|
"src/dawn_native/vulkan/VulkanError.cpp",
|
|
|
|
"src/dawn_native/vulkan/VulkanError.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/vulkan/VulkanFunctions.cpp",
|
|
|
|
"src/dawn_native/vulkan/VulkanFunctions.h",
|
|
|
|
"src/dawn_native/vulkan/VulkanInfo.cpp",
|
|
|
|
"src/dawn_native/vulkan/VulkanInfo.h",
|
2019-08-10 03:17:52 +00:00
|
|
|
"src/dawn_native/vulkan/external_memory/MemoryService.h",
|
|
|
|
"src/dawn_native/vulkan/external_semaphore/SemaphoreService.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
2019-08-10 03:17:52 +00:00
|
|
|
|
2019-11-21 16:02:10 +00:00
|
|
|
if (is_chromeos) {
|
|
|
|
sources += [
|
|
|
|
"src/dawn_native/vulkan/external_memory/MemoryServiceDmaBuf.cpp",
|
|
|
|
"src/dawn_native/vulkan/external_semaphore/SemaphoreServiceOpaqueFD.cpp",
|
|
|
|
]
|
|
|
|
} else if (is_linux) {
|
2019-08-10 03:17:52 +00:00
|
|
|
sources += [
|
|
|
|
"src/dawn_native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp",
|
|
|
|
"src/dawn_native/vulkan/external_semaphore/SemaphoreServiceOpaqueFD.cpp",
|
|
|
|
]
|
2019-09-10 10:07:28 +00:00
|
|
|
} else if (is_fuchsia) {
|
|
|
|
sources += [
|
|
|
|
"src/dawn_native/vulkan/external_memory/MemoryServiceZirconHandle.cpp",
|
|
|
|
"src/dawn_native/vulkan/external_semaphore/SemaphoreServiceZirconHandle.cpp",
|
|
|
|
]
|
2019-08-10 03:17:52 +00:00
|
|
|
} else {
|
|
|
|
sources += [
|
|
|
|
"src/dawn_native/vulkan/external_memory/MemoryServiceNull.cpp",
|
|
|
|
"src/dawn_native/vulkan/external_semaphore/SemaphoreServiceNull.cpp",
|
|
|
|
]
|
|
|
|
}
|
Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:
- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
the Fuchsia swapchain layer and its layer extension, as well
as enabling them when creating a new VkInstance.
- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
related extension for this platform only.
- Provide a small mock GLFW library for Fuchsia under
src/utils/Glfw3Fuchsia.cpp, since the upstream project
does not support this platform at all. Its purpose is
only to allow the creation of the right VulkanBinding
instance, which depends on the creation of a display
surface for latter swapchain creation.
- Add //third_party/fuchsia-sdk:vulkan_base and
//third_party/fuchsia-sdk:vulkan_validation as
data_deps of the libdawn_native_sources target in
order to ensure that the Fuchsia package created by
the build system will include the correct Vulkan
libraries (loader and validation layers).
This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.
Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.
NOTE: All end2end tests pass using a device with
an "Intel HD Graphics 615 (Kaby Lake GT2)"
adapter. However:
- For some reason, a single test takes up
to 129 seconds to pass
(BufferSetSubDataTests.ManySetSubData/Vulkan).
- The test process crashes inside VkDestroyInstance(),
apparently inside the Fuchsia-specific imagepipe
layer (which implements swapchain support).
This is likely a bug in the layer itself, and
not Dawn.
Also, may end2end tests will crash when run inside
the Fuchsia emulator (which uses GPU virtualization
to talk to the host GPU). The crashes happen inside
libvulkan-goldfish.so, the emulator-specific Vulkan
ICD on this sytem. Not a Dawn bug either.
Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
|
|
|
if (build_with_chromium && is_fuchsia) {
|
|
|
|
# Necessary to ensure that the Vulkan libraries will be in the
|
|
|
|
# final Fuchsia package.
|
|
|
|
data_deps = [
|
|
|
|
# NOTE: The line below is a work around for http://crbug.com/1001081
|
|
|
|
"//third_party/fuchsia-sdk/sdk:trace_engine",
|
|
|
|
"//third_party/fuchsia-sdk:vulkan_base",
|
|
|
|
"//third_party/fuchsia-sdk:vulkan_validation",
|
|
|
|
]
|
|
|
|
}
|
2019-11-07 12:13:27 +00:00
|
|
|
if (dawn_enable_vulkan_validation_layers) {
|
2019-11-20 18:10:11 +00:00
|
|
|
defines += [
|
2019-11-07 12:13:27 +00:00
|
|
|
"DAWN_ENABLE_VULKAN_VALIDATION_LAYERS",
|
|
|
|
"DAWN_VK_DATA_DIR=\"$vulkan_data_subdir\"",
|
|
|
|
]
|
|
|
|
}
|
2019-11-26 18:21:51 +00:00
|
|
|
|
|
|
|
if (use_swiftshader) {
|
|
|
|
data_deps += [ "${dawn_swiftshader_dir}/src/Vulkan:icd_file" ]
|
|
|
|
defines +=
|
|
|
|
[ "DAWN_SWIFTSHADER_VK_ICD_JSON=\"${swiftshader_icd_file_name}\"" ]
|
|
|
|
}
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
# The static and shared libraries for libdawn_native. Most of the files are
|
|
|
|
# already compiled in libdawn_native_sources, but we still need to compile
|
|
|
|
# files defining exported symbols.
|
2019-01-25 03:20:20 +00:00
|
|
|
dawn_component("libdawn_native") {
|
2019-01-09 09:05:18 +00:00
|
|
|
DEFINE_PREFIX = "DAWN_NATIVE"
|
2018-08-12 19:07:46 +00:00
|
|
|
|
|
|
|
#Make headers publically visible
|
|
|
|
public_deps = [
|
|
|
|
":libdawn_native_headers",
|
|
|
|
]
|
2018-08-03 13:57:43 +00:00
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
deps = [
|
2019-01-15 20:49:53 +00:00
|
|
|
":libdawn_native_sources",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-01-09 09:05:18 +00:00
|
|
|
]
|
|
|
|
sources = [
|
|
|
|
"src/dawn_native/DawnNative.cpp",
|
|
|
|
]
|
|
|
|
configs = [ ":libdawn_native_internal" ]
|
2019-10-24 09:44:13 +00:00
|
|
|
public_configs = [ ":libdawn_native_weak_framework" ]
|
2019-01-09 09:05:18 +00:00
|
|
|
|
|
|
|
if (dawn_enable_d3d12) {
|
|
|
|
sources += [ "src/dawn_native/d3d12/D3D12Backend.cpp" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/dawn_native/metal/MetalBackend.mm" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_null) {
|
|
|
|
sources += [ "src/dawn_native/null/NullBackend.cpp" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_opengl) {
|
|
|
|
sources += [ "src/dawn_native/opengl/OpenGLBackend.cpp" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
sources += [ "src/dawn_native/vulkan/VulkanBackend.cpp" ]
|
2019-11-07 12:13:27 +00:00
|
|
|
|
|
|
|
if (dawn_enable_vulkan_validation_layers) {
|
|
|
|
data_deps = [
|
|
|
|
"${dawn_vulkan_validation_layers_dir}:vulkan_validation_layers",
|
|
|
|
]
|
|
|
|
if (!is_android) {
|
|
|
|
data_deps +=
|
|
|
|
[ "${dawn_vulkan_validation_layers_dir}:vulkan_gen_json_files" ]
|
|
|
|
}
|
|
|
|
}
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
|
|
|
|
2018-08-12 19:07:46 +00:00
|
|
|
###############################################################################
|
2019-01-09 09:05:18 +00:00
|
|
|
# libdawn_wire
|
2018-08-12 19:07:46 +00:00
|
|
|
###############################################################################
|
2018-07-31 16:50:03 +00:00
|
|
|
|
2019-06-11 18:03:05 +00:00
|
|
|
dawn_json_generator("libdawn_wire_gen") {
|
2018-07-31 16:50:03 +00:00
|
|
|
target = "dawn_wire"
|
2018-08-16 13:32:35 +00:00
|
|
|
outputs = [
|
2019-09-18 04:33:12 +00:00
|
|
|
"src/dawn_wire/WireCmd_autogen.h",
|
|
|
|
"src/dawn_wire/WireCmd_autogen.cpp",
|
|
|
|
"src/dawn_wire/client/ApiObjects_autogen.h",
|
|
|
|
"src/dawn_wire/client/ApiProcs_autogen.cpp",
|
|
|
|
"src/dawn_wire/client/ApiProcs_autogen.h",
|
|
|
|
"src/dawn_wire/client/ClientBase_autogen.h",
|
|
|
|
"src/dawn_wire/client/ClientHandlers_autogen.cpp",
|
|
|
|
"src/dawn_wire/client/ClientPrototypes_autogen.inc",
|
|
|
|
"src/dawn_wire/server/ServerBase_autogen.h",
|
|
|
|
"src/dawn_wire/server/ServerDoers_autogen.cpp",
|
|
|
|
"src/dawn_wire/server/ServerHandlers_autogen.cpp",
|
|
|
|
"src/dawn_wire/server/ServerPrototypes_autogen.inc",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-01-25 03:20:20 +00:00
|
|
|
dawn_component("libdawn_wire") {
|
2019-01-09 09:05:18 +00:00
|
|
|
DEFINE_PREFIX = "DAWN_WIRE"
|
|
|
|
|
2018-07-31 16:50:03 +00:00
|
|
|
deps = [
|
2018-08-16 13:32:35 +00:00
|
|
|
":libdawn_wire_gen",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-03-08 00:51:27 +00:00
|
|
|
"${dawn_root}/src/dawn_wire:libdawn_wire_headers",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
2018-08-12 19:07:46 +00:00
|
|
|
|
2019-03-07 01:46:39 +00:00
|
|
|
configs = [ "${dawn_root}/src/common:dawn_internal" ]
|
2018-08-16 13:32:35 +00:00
|
|
|
sources = get_target_outputs(":libdawn_wire_gen")
|
2019-01-15 20:49:53 +00:00
|
|
|
sources += [
|
2019-02-11 21:50:16 +00:00
|
|
|
"src/dawn_wire/WireClient.cpp",
|
2019-01-15 20:49:53 +00:00
|
|
|
"src/dawn_wire/WireDeserializeAllocator.cpp",
|
|
|
|
"src/dawn_wire/WireDeserializeAllocator.h",
|
2019-02-11 21:50:16 +00:00
|
|
|
"src/dawn_wire/WireServer.cpp",
|
2019-01-16 02:18:06 +00:00
|
|
|
"src/dawn_wire/client/ApiObjects.h",
|
|
|
|
"src/dawn_wire/client/ApiProcs.cpp",
|
|
|
|
"src/dawn_wire/client/Buffer.cpp",
|
|
|
|
"src/dawn_wire/client/Buffer.h",
|
|
|
|
"src/dawn_wire/client/Client.cpp",
|
|
|
|
"src/dawn_wire/client/Client.h",
|
2019-01-30 03:00:17 +00:00
|
|
|
"src/dawn_wire/client/ClientDoers.cpp",
|
2019-07-19 16:01:48 +00:00
|
|
|
"src/dawn_wire/client/ClientInlineMemoryTransferService.cpp",
|
2019-01-30 02:31:37 +00:00
|
|
|
"src/dawn_wire/client/Device.cpp",
|
|
|
|
"src/dawn_wire/client/Device.h",
|
2019-01-16 02:18:06 +00:00
|
|
|
"src/dawn_wire/client/Fence.cpp",
|
|
|
|
"src/dawn_wire/client/Fence.h",
|
|
|
|
"src/dawn_wire/client/ObjectAllocator.h",
|
2019-01-30 02:20:58 +00:00
|
|
|
"src/dawn_wire/server/ObjectStorage.h",
|
|
|
|
"src/dawn_wire/server/Server.cpp",
|
|
|
|
"src/dawn_wire/server/Server.h",
|
|
|
|
"src/dawn_wire/server/ServerBuffer.cpp",
|
|
|
|
"src/dawn_wire/server/ServerDevice.cpp",
|
|
|
|
"src/dawn_wire/server/ServerFence.cpp",
|
2019-07-19 16:01:48 +00:00
|
|
|
"src/dawn_wire/server/ServerInlineMemoryTransferService.cpp",
|
2019-01-30 02:20:58 +00:00
|
|
|
"src/dawn_wire/server/ServerQueue.cpp",
|
2019-01-15 20:49:53 +00:00
|
|
|
]
|
2018-08-16 13:32:35 +00:00
|
|
|
|
2018-11-14 21:04:26 +00:00
|
|
|
# Make headers publically visible
|
|
|
|
public_deps = [
|
2019-03-08 00:51:27 +00:00
|
|
|
"${dawn_root}/src/dawn_wire:libdawn_wire_headers",
|
2018-11-14 21:04:26 +00:00
|
|
|
]
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:
- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
the Fuchsia swapchain layer and its layer extension, as well
as enabling them when creating a new VkInstance.
- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
related extension for this platform only.
- Provide a small mock GLFW library for Fuchsia under
src/utils/Glfw3Fuchsia.cpp, since the upstream project
does not support this platform at all. Its purpose is
only to allow the creation of the right VulkanBinding
instance, which depends on the creation of a display
surface for latter swapchain creation.
- Add //third_party/fuchsia-sdk:vulkan_base and
//third_party/fuchsia-sdk:vulkan_validation as
data_deps of the libdawn_native_sources target in
order to ensure that the Fuchsia package created by
the build system will include the correct Vulkan
libraries (loader and validation layers).
This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.
Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.
NOTE: All end2end tests pass using a device with
an "Intel HD Graphics 615 (Kaby Lake GT2)"
adapter. However:
- For some reason, a single test takes up
to 129 seconds to pass
(BufferSetSubDataTests.ManySetSubData/Vulkan).
- The test process crashes inside VkDestroyInstance(),
apparently inside the Fuchsia-specific imagepipe
layer (which implements swapchain support).
This is likely a bug in the layer itself, and
not Dawn.
Also, may end2end tests will crash when run inside
the Fuchsia emulator (which uses GPU virtualization
to talk to the host GPU). The crashes happen inside
libvulkan-goldfish.so, the emulator-specific Vulkan
ICD on this sytem. Not a Dawn bug either.
Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
|
|
|
###############################################################################
|
|
|
|
# GLFW wrapping target
|
|
|
|
###############################################################################
|
|
|
|
|
2019-09-11 16:53:46 +00:00
|
|
|
# GLFW does not support ChromeOS, Android or Fuchsia, so provide a small mock
|
|
|
|
# library that can be linked into the Dawn tests on these platforms. Otherwise,
|
|
|
|
# use the real library from third_party/.
|
2019-09-12 16:33:31 +00:00
|
|
|
if (is_win || (is_linux && !is_chromeos) || is_mac) {
|
2019-09-11 16:53:46 +00:00
|
|
|
group("dawn_glfw") {
|
|
|
|
public_deps = [
|
|
|
|
"third_party:glfw",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
} else if (is_fuchsia) {
|
|
|
|
# The mock implementation of GLFW on Fuchsia
|
Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:
- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
the Fuchsia swapchain layer and its layer extension, as well
as enabling them when creating a new VkInstance.
- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
related extension for this platform only.
- Provide a small mock GLFW library for Fuchsia under
src/utils/Glfw3Fuchsia.cpp, since the upstream project
does not support this platform at all. Its purpose is
only to allow the creation of the right VulkanBinding
instance, which depends on the creation of a display
surface for latter swapchain creation.
- Add //third_party/fuchsia-sdk:vulkan_base and
//third_party/fuchsia-sdk:vulkan_validation as
data_deps of the libdawn_native_sources target in
order to ensure that the Fuchsia package created by
the build system will include the correct Vulkan
libraries (loader and validation layers).
This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.
Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.
NOTE: All end2end tests pass using a device with
an "Intel HD Graphics 615 (Kaby Lake GT2)"
adapter. However:
- For some reason, a single test takes up
to 129 seconds to pass
(BufferSetSubDataTests.ManySetSubData/Vulkan).
- The test process crashes inside VkDestroyInstance(),
apparently inside the Fuchsia-specific imagepipe
layer (which implements swapchain support).
This is likely a bug in the layer itself, and
not Dawn.
Also, may end2end tests will crash when run inside
the Fuchsia emulator (which uses GPU virtualization
to talk to the host GPU). The crashes happen inside
libvulkan-goldfish.so, the emulator-specific Vulkan
ICD on this sytem. Not a Dawn bug either.
Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
|
|
|
config("dawn_glfw_public_config") {
|
|
|
|
# Allow inclusion of <GLFW/glfw3.h>
|
2019-09-12 12:50:31 +00:00
|
|
|
include_dirs = [ "${dawn_glfw_dir}/include" ]
|
|
|
|
|
Enable Vulkan for Chromium Fuchsia build.
Enable the Vulkan backend when building Dawn with
the Chromium build system for Fuchsia. To make this
work properly the following is required:
- Modify VulkanInfo.cpp and BackendVk.cpp to correctly probe
the Fuchsia swapchain layer and its layer extension, as well
as enabling them when creating a new VkInstance.
- Modify VulkanFunctions.cpp to load the Fuchsia swapchain
related extension for this platform only.
- Provide a small mock GLFW library for Fuchsia under
src/utils/Glfw3Fuchsia.cpp, since the upstream project
does not support this platform at all. Its purpose is
only to allow the creation of the right VulkanBinding
instance, which depends on the creation of a display
surface for latter swapchain creation.
- Add //third_party/fuchsia-sdk:vulkan_base and
//third_party/fuchsia-sdk:vulkan_validation as
data_deps of the libdawn_native_sources target in
order to ensure that the Fuchsia package created by
the build system will include the correct Vulkan
libraries (loader and validation layers).
This builds correctly, and both dawn_unittests and
dawn_end2end_tests will run on a real Fuchsia device
or inside the Fuchsia emulator, using either GPU
virtualization or a software-based renderer.
Note: dawn_unittests will also run inside QEMU, but
not dawn_end2end_tests, since the latter requires
proper GPU emulation which is not available in this
environment.
NOTE: All end2end tests pass using a device with
an "Intel HD Graphics 615 (Kaby Lake GT2)"
adapter. However:
- For some reason, a single test takes up
to 129 seconds to pass
(BufferSetSubDataTests.ManySetSubData/Vulkan).
- The test process crashes inside VkDestroyInstance(),
apparently inside the Fuchsia-specific imagepipe
layer (which implements swapchain support).
This is likely a bug in the layer itself, and
not Dawn.
Also, may end2end tests will crash when run inside
the Fuchsia emulator (which uses GPU virtualization
to talk to the host GPU). The crashes happen inside
libvulkan-goldfish.so, the emulator-specific Vulkan
ICD on this sytem. Not a Dawn bug either.
Bug=dawn:221
Change-Id: Id3598b673e8c6393f24db728b8da49fdde3cac76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8963
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2019-09-09 10:52:08 +00:00
|
|
|
# The GLFW/glfw3.h header includes <GL/gl.h> by default, but the latter
|
|
|
|
# does not exist on Fuchsia. Defining GLFW_INCLUDE_NONE helps work around
|
|
|
|
# the issue, but it needs to be defined for any file that includes the
|
|
|
|
# header.
|
|
|
|
defines = [
|
|
|
|
"GLFW_INCLUDE_NONE",
|
|
|
|
"GLFW_INCLUDE_VULKAN",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
static_library("dawn_glfw") {
|
|
|
|
sources = [
|
|
|
|
# NOTE: The header below is required to pass "gn check".
|
|
|
|
"${dawn_glfw_dir}/include/GLFW/glfw3.h",
|
|
|
|
"src/utils/Glfw3Fuchsia.cpp",
|
|
|
|
]
|
|
|
|
public_configs = [ ":dawn_glfw_public_config" ]
|
|
|
|
deps = [
|
|
|
|
"${dawn_root}/src/common",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
} else {
|
2019-09-11 16:53:46 +00:00
|
|
|
# Just skip GLFW on other systems
|
|