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-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")
|
2019-03-06 23:17:39 +00:00
|
|
|
import("generator/dawn_generator.gni")
|
2018-12-08 10:35:53 +00:00
|
|
|
|
|
|
|
import("//testing/test.gni")
|
2018-07-31 16:50:03 +00:00
|
|
|
|
2018-11-30 12:17:29 +00:00
|
|
|
# Use Chromium's dcheck_always_on when available so that we respect it when
|
|
|
|
# running tests on the GPU builders
|
|
|
|
if (build_with_chromium) {
|
|
|
|
import("//build/config/dcheck_always_on.gni")
|
|
|
|
} else {
|
|
|
|
dcheck_always_on = false
|
|
|
|
}
|
|
|
|
|
2018-07-31 16:50:03 +00:00
|
|
|
###############################################################################
|
2018-08-03 13:57:43 +00:00
|
|
|
# Common dawn libraries and configs
|
2018-07-31 16:50:03 +00:00
|
|
|
###############################################################################
|
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
config("dawn_public") {
|
2018-07-31 16:50:03 +00:00
|
|
|
include_dirs = [
|
|
|
|
target_gen_dir,
|
|
|
|
"src/include",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
config("dawn_internal") {
|
|
|
|
include_dirs = [ "src" ]
|
|
|
|
|
|
|
|
defines = []
|
2018-11-30 12:17:29 +00:00
|
|
|
if (dawn_always_assert || dcheck_always_on || is_debug) {
|
2018-07-31 16:50:03 +00:00
|
|
|
defines += [ "DAWN_ENABLE_ASSERTS" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_d3d12) {
|
|
|
|
defines += [ "DAWN_ENABLE_BACKEND_D3D12" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
defines += [ "DAWN_ENABLE_BACKEND_METAL" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_null) {
|
|
|
|
defines += [ "DAWN_ENABLE_BACKEND_NULL" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_opengl) {
|
|
|
|
defines += [ "DAWN_ENABLE_BACKEND_OPENGL" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
defines += [ "DAWN_ENABLE_BACKEND_VULKAN" ]
|
|
|
|
}
|
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
configs = [ ":dawn_public" ]
|
2018-08-13 06:23:27 +00:00
|
|
|
|
|
|
|
# Only internal Dawn targets can use this config, this means only targets in
|
|
|
|
# this BUILD.gn file.
|
|
|
|
visibility = [ ":*" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static_library("dawn_common") {
|
|
|
|
sources = [
|
|
|
|
"src/common/Assert.cpp",
|
|
|
|
"src/common/Assert.h",
|
|
|
|
"src/common/BitSetIterator.h",
|
|
|
|
"src/common/Compiler.h",
|
|
|
|
"src/common/DynamicLib.cpp",
|
|
|
|
"src/common/DynamicLib.h",
|
|
|
|
"src/common/HashUtils.h",
|
|
|
|
"src/common/Math.cpp",
|
|
|
|
"src/common/Math.h",
|
|
|
|
"src/common/Platform.h",
|
|
|
|
"src/common/Result.h",
|
|
|
|
"src/common/Serial.h",
|
2018-11-28 17:30:12 +00:00
|
|
|
"src/common/SerialMap.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/common/SerialQueue.h",
|
2018-11-28 17:30:12 +00:00
|
|
|
"src/common/SerialStorage.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/common/SwapChainUtils.h",
|
|
|
|
"src/common/vulkan_platform.h",
|
|
|
|
"src/common/windows_with_undefs.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [ ":dawn_internal" ]
|
2018-08-12 19:07:46 +00:00
|
|
|
deps = [
|
|
|
|
":dawn_headers",
|
|
|
|
]
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
###############################################################################
|
2019-01-09 09:05:18 +00:00
|
|
|
# Dawn headers
|
2018-08-03 13:57:43 +00:00
|
|
|
###############################################################################
|
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
dawn_generator("dawn_headers_gen") {
|
2018-08-03 13:57:43 +00:00
|
|
|
target = "dawn_headers"
|
2018-08-16 13:32:35 +00:00
|
|
|
outputs = [
|
|
|
|
"dawn/dawncpp.h",
|
|
|
|
"dawn/dawn.h",
|
|
|
|
"dawn/dawncpp_traits.h",
|
|
|
|
]
|
|
|
|
}
|
2018-08-03 13:57:43 +00:00
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
source_set("dawn_headers") {
|
2019-01-09 09:05:18 +00:00
|
|
|
public_configs = [ ":dawn_public" ]
|
2018-08-16 13:32:35 +00:00
|
|
|
deps = [
|
|
|
|
":dawn_headers_gen",
|
|
|
|
]
|
|
|
|
|
|
|
|
sources = get_target_outputs(":dawn_headers_gen")
|
|
|
|
sources += [
|
2018-08-12 19:07:46 +00:00
|
|
|
"src/include/dawn/EnumClassBitmasks.h",
|
|
|
|
"src/include/dawn/dawn_export.h",
|
|
|
|
"src/include/dawn/dawn_wsi.h",
|
|
|
|
]
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
###############################################################################
|
|
|
|
# libdawn
|
|
|
|
###############################################################################
|
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
dawn_generator("libdawn_gen") {
|
2018-08-03 13:57:43 +00:00
|
|
|
target = "libdawn"
|
2018-08-16 13:32:35 +00:00
|
|
|
outputs = [
|
|
|
|
"dawn/dawncpp.cpp",
|
|
|
|
"dawn/dawn.c",
|
|
|
|
]
|
|
|
|
}
|
2018-08-03 13:57:43 +00:00
|
|
|
|
2019-01-25 03:20:20 +00:00
|
|
|
dawn_component("libdawn") {
|
2019-01-09 09:05:18 +00:00
|
|
|
DEFINE_PREFIX = "DAWN"
|
2018-11-14 21:04:26 +00:00
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
public_deps = [
|
|
|
|
":dawn_headers",
|
|
|
|
]
|
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
deps = [
|
|
|
|
":libdawn_gen",
|
|
|
|
]
|
|
|
|
sources = get_target_outputs(":libdawn_gen")
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
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") {
|
|
|
|
configs = [ ":dawn_internal" ]
|
|
|
|
|
|
|
|
# Suppress warnings that Metal isn't in the deployment target of Chrome
|
|
|
|
if (is_mac) {
|
|
|
|
cflags_objcc = [ "-Wno-unguarded-availability" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
dawn_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 = [
|
|
|
|
"dawn_native/ProcTable.cpp",
|
|
|
|
"dawn_native/dawn_structs_autogen.h",
|
|
|
|
"dawn_native/dawn_structs_autogen.cpp",
|
|
|
|
"dawn_native/ValidationUtils_autogen.h",
|
|
|
|
"dawn_native/ValidationUtils_autogen.cpp",
|
2018-07-31 16:50:03 +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 = [
|
|
|
|
":dawn_headers",
|
|
|
|
]
|
2019-01-09 09:05:18 +00:00
|
|
|
public_configs = [ ":dawn_public" ]
|
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 = [
|
|
|
|
":dawn_common",
|
2019-01-09 09:05:18 +00:00
|
|
|
":libdawn_native_headers",
|
2018-08-16 13:32:35 +00:00
|
|
|
":libdawn_native_utils_gen",
|
2018-09-06 15:25:46 +00:00
|
|
|
"${dawn_spirv_tools_dir}:spvtools_val",
|
2018-08-13 06:31:17 +00:00
|
|
|
"third_party:spirv_cross",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
2018-08-12 19:07:46 +00:00
|
|
|
|
2018-11-14 21:04:26 +00:00
|
|
|
configs += [ ":libdawn_native_internal" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
libs = []
|
|
|
|
|
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",
|
|
|
|
"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",
|
|
|
|
"src/dawn_native/Buffer.cpp",
|
|
|
|
"src/dawn_native/Buffer.h",
|
|
|
|
"src/dawn_native/Builder.cpp",
|
|
|
|
"src/dawn_native/Builder.h",
|
|
|
|
"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",
|
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",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Error.cpp",
|
|
|
|
"src/dawn_native/Error.h",
|
|
|
|
"src/dawn_native/ErrorData.cpp",
|
|
|
|
"src/dawn_native/ErrorData.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",
|
2018-07-31 16:50:03 +00:00
|
|
|
"src/dawn_native/Forward.h",
|
|
|
|
"src/dawn_native/InputState.cpp",
|
|
|
|
"src/dawn_native/InputState.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",
|
|
|
|
"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",
|
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-01-29 00:10:07 +00:00
|
|
|
"src/dawn_native/RingBuffer.cpp",
|
|
|
|
"src/dawn_native/RingBuffer.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",
|
|
|
|
"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",
|
|
|
|
"src/dawn_native/d3d12/ComputePipelineD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/ComputePipelineD3D12.h",
|
|
|
|
"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",
|
|
|
|
"src/dawn_native/d3d12/InputStateD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/InputStateD3D12.h",
|
|
|
|
"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",
|
|
|
|
"src/dawn_native/d3d12/RenderPipelineD3D12.cpp",
|
|
|
|
"src/dawn_native/d3d12/RenderPipelineD3D12.h",
|
|
|
|
"src/dawn_native/d3d12/ResourceAllocator.cpp",
|
|
|
|
"src/dawn_native/d3d12/ResourceAllocator.h",
|
|
|
|
"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 += [
|
|
|
|
"Metal.framework",
|
|
|
|
"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/InputStateMTL.h",
|
|
|
|
"src/dawn_native/metal/InputStateMTL.mm",
|
|
|
|
"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) {
|
2018-08-13 06:31:17 +00:00
|
|
|
deps += [ "third_party:glad" ]
|
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",
|
|
|
|
"src/dawn_native/opengl/InputStateGL.cpp",
|
|
|
|
"src/dawn_native/opengl/InputStateGL.h",
|
|
|
|
"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",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_vulkan) {
|
2018-08-13 06:31:17 +00:00
|
|
|
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",
|
|
|
|
"src/dawn_native/vulkan/ComputePipelineVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/ComputePipelineVk.h",
|
|
|
|
"src/dawn_native/vulkan/DeviceVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/DeviceVk.h",
|
|
|
|
"src/dawn_native/vulkan/FencedDeleter.cpp",
|
|
|
|
"src/dawn_native/vulkan/FencedDeleter.h",
|
|
|
|
"src/dawn_native/vulkan/Forward.h",
|
|
|
|
"src/dawn_native/vulkan/InputStateVk.cpp",
|
|
|
|
"src/dawn_native/vulkan/InputStateVk.h",
|
|
|
|
"src/dawn_native/vulkan/MemoryAllocator.cpp",
|
|
|
|
"src/dawn_native/vulkan/MemoryAllocator.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",
|
|
|
|
"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-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 = [
|
|
|
|
":dawn_common",
|
2019-01-15 20:49:53 +00:00
|
|
|
":libdawn_native_sources",
|
2019-01-09 09:05:18 +00:00
|
|
|
]
|
|
|
|
sources = [
|
|
|
|
"src/dawn_native/DawnNative.cpp",
|
|
|
|
]
|
|
|
|
configs = [ ":libdawn_native_internal" ]
|
|
|
|
|
|
|
|
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" ]
|
|
|
|
deps += [ "third_party:glad" ]
|
|
|
|
}
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
sources += [ "src/dawn_native/vulkan/VulkanBackend.cpp" ]
|
|
|
|
deps += [ "third_party:vulkan_headers" ]
|
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
|
|
|
|
2018-08-12 19:07:46 +00:00
|
|
|
# Public libdawn_wire headers so they can be publically visible for
|
|
|
|
# dependencies of libdawn_wire
|
|
|
|
source_set("libdawn_wire_headers") {
|
|
|
|
public_deps = [
|
|
|
|
":dawn_headers",
|
|
|
|
]
|
2019-01-09 09:05:18 +00:00
|
|
|
public_configs = [ ":dawn_public" ]
|
2018-07-31 16:50:03 +00:00
|
|
|
sources = [
|
2018-08-12 19:07:46 +00:00
|
|
|
"src/include/dawn_wire/Wire.h",
|
2019-02-11 21:50:16 +00:00
|
|
|
"src/include/dawn_wire/WireClient.h",
|
|
|
|
"src/include/dawn_wire/WireServer.h",
|
2018-08-12 19:07:46 +00:00
|
|
|
"src/include/dawn_wire/dawn_wire_export.h",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-08-16 13:32:35 +00:00
|
|
|
dawn_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-01-08 17:58:38 +00:00
|
|
|
"dawn_wire/TypeTraits_autogen.h",
|
2018-08-16 13:32:35 +00:00
|
|
|
"dawn_wire/WireCmd_autogen.h",
|
|
|
|
"dawn_wire/WireCmd_autogen.cpp",
|
2019-01-16 02:18:06 +00:00
|
|
|
"dawn_wire/client/ApiObjects_autogen.h",
|
|
|
|
"dawn_wire/client/ApiProcs_autogen.cpp",
|
|
|
|
"dawn_wire/client/ApiProcs_autogen.h",
|
2019-01-30 02:31:37 +00:00
|
|
|
"dawn_wire/client/ClientBase_autogen.h",
|
2019-01-30 03:00:17 +00:00
|
|
|
"dawn_wire/client/ClientDoers_autogen.cpp",
|
2019-01-16 02:18:06 +00:00
|
|
|
"dawn_wire/client/ClientHandlers_autogen.cpp",
|
|
|
|
"dawn_wire/client/ClientPrototypes_autogen.inl",
|
2019-01-30 02:20:58 +00:00
|
|
|
"dawn_wire/server/ServerBase_autogen.h",
|
|
|
|
"dawn_wire/server/ServerCallbacks_autogen.cpp",
|
2019-02-11 19:39:46 +00:00
|
|
|
"dawn_wire/server/ServerDoers_autogen.cpp",
|
2019-01-30 02:20:58 +00:00
|
|
|
"dawn_wire/server/ServerHandlers_autogen.cpp",
|
|
|
|
"dawn_wire/server/ServerPrototypes_autogen.inl",
|
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
|
|
|
":dawn_common",
|
|
|
|
":libdawn_wire_gen",
|
|
|
|
":libdawn_wire_headers",
|
2018-07-31 16:50:03 +00:00
|
|
|
]
|
2018-08-12 19:07:46 +00:00
|
|
|
|
2019-01-09 09:05:18 +00:00
|
|
|
configs = [ ":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-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",
|
|
|
|
"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 = [
|
|
|
|
":libdawn_wire_headers",
|
|
|
|
]
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Utils for tests and samples
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
static_library("dawn_utils") {
|
|
|
|
configs += [ ":dawn_internal" ]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/utils/BackendBinding.cpp",
|
|
|
|
"src/utils/BackendBinding.h",
|
2018-12-10 19:47:22 +00:00
|
|
|
"src/utils/ComboRenderPipelineDescriptor.cpp",
|
|
|
|
"src/utils/ComboRenderPipelineDescriptor.h",
|
2018-08-03 13:57:43 +00:00
|
|
|
"src/utils/DawnHelpers.cpp",
|
|
|
|
"src/utils/DawnHelpers.h",
|
|
|
|
"src/utils/SystemUtils.cpp",
|
|
|
|
"src/utils/SystemUtils.h",
|
|
|
|
"src/utils/TerribleCommandBuffer.cpp",
|
|
|
|
"src/utils/TerribleCommandBuffer.h",
|
|
|
|
]
|
2019-02-13 18:42:38 +00:00
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
":dawn_headers_gen",
|
|
|
|
]
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
deps = [
|
|
|
|
":dawn_common",
|
|
|
|
":libdawn_native",
|
2018-08-12 19:07:46 +00:00
|
|
|
":libdawn_wire",
|
2018-10-04 17:17:57 +00:00
|
|
|
"${dawn_shaderc_dir}:libshaderc",
|
2018-10-09 00:31:58 +00:00
|
|
|
"third_party:glfw",
|
2018-08-03 13:57:43 +00:00
|
|
|
]
|
2018-08-16 13:32:35 +00:00
|
|
|
libs = []
|
2018-08-03 13:57:43 +00:00
|
|
|
|
|
|
|
if (dawn_enable_d3d12) {
|
|
|
|
sources += [ "src/utils/D3D12Binding.cpp" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/utils/MetalBinding.mm" ]
|
|
|
|
libs += [
|
|
|
|
"Metal.framework",
|
|
|
|
"QuartzCore.framework",
|
|
|
|
]
|
|
|
|
|
|
|
|
# Suppress warnings that Metal isn't in the deployment target of Chrome
|
|
|
|
if (is_mac) {
|
|
|
|
cflags_objcc = [ "-Wno-unguarded-availability" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_null) {
|
|
|
|
sources += [ "src/utils/NullBinding.cpp" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_opengl) {
|
|
|
|
sources += [ "src/utils/OpenGLBinding.cpp" ]
|
2018-08-13 06:31:17 +00:00
|
|
|
deps += [ "third_party:glad" ]
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
sources += [ "src/utils/VulkanBinding.cpp" ]
|
2018-08-13 06:31:17 +00:00
|
|
|
deps += [ "third_party:vulkan_headers" ]
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Dawn test targets
|
|
|
|
###############################################################################
|
|
|
|
|
2018-12-08 10:35:53 +00:00
|
|
|
dawn_generator("mock_dawn_gen") {
|
|
|
|
target = "mock_dawn"
|
|
|
|
outputs = [
|
|
|
|
"mock/mock_dawn.h",
|
|
|
|
"mock/mock_dawn.cpp",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
test("dawn_unittests") {
|
|
|
|
configs += [ ":dawn_internal" ]
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
deps = [
|
2018-12-08 10:35:53 +00:00
|
|
|
":dawn_common",
|
|
|
|
":dawn_headers",
|
|
|
|
":dawn_utils",
|
|
|
|
":libdawn",
|
2019-01-09 09:05:18 +00:00
|
|
|
":libdawn_native",
|
2019-01-15 20:49:53 +00:00
|
|
|
":libdawn_native_sources",
|
2018-12-08 10:35:53 +00:00
|
|
|
":libdawn_wire",
|
|
|
|
":mock_dawn_gen",
|
|
|
|
"third_party:gmock_and_gtest",
|
2018-08-03 13:57:43 +00:00
|
|
|
]
|
2018-12-08 10:35:53 +00:00
|
|
|
|
|
|
|
# Add internal Dawn Native headers and config for internal unittests.
|
|
|
|
deps += [ ":libdawn_native_headers" ]
|
|
|
|
configs += [ ":libdawn_native_internal" ]
|
|
|
|
|
|
|
|
sources = get_target_outputs(":mock_dawn_gen")
|
|
|
|
sources += [
|
|
|
|
"src/tests/unittests/BitSetIteratorTests.cpp",
|
|
|
|
"src/tests/unittests/CommandAllocatorTests.cpp",
|
|
|
|
"src/tests/unittests/EnumClassBitmasksTests.cpp",
|
|
|
|
"src/tests/unittests/ErrorTests.cpp",
|
|
|
|
"src/tests/unittests/MathTests.cpp",
|
|
|
|
"src/tests/unittests/ObjectBaseTests.cpp",
|
|
|
|
"src/tests/unittests/PerStageTests.cpp",
|
|
|
|
"src/tests/unittests/RefCountedTests.cpp",
|
|
|
|
"src/tests/unittests/ResultTests.cpp",
|
2019-01-29 00:10:07 +00:00
|
|
|
"src/tests/unittests/RingBufferTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/SerialMapTests.cpp",
|
|
|
|
"src/tests/unittests/SerialQueueTests.cpp",
|
|
|
|
"src/tests/unittests/ToBackendTests.cpp",
|
|
|
|
"src/tests/unittests/validation/BindGroupValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/BufferValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/CommandBufferValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/ComputeValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/CopyCommandsValidationTests.cpp",
|
2019-02-20 20:21:00 +00:00
|
|
|
"src/tests/unittests/validation/DebugMarkerValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/DynamicStateCommandValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/FenceValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/InputStateValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/PushConstantsValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/QueueSubmitValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/RenderPipelineValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/ShaderModuleValidationTests.cpp",
|
2018-12-12 09:27:16 +00:00
|
|
|
"src/tests/unittests/validation/TextureValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/TextureViewValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/ValidationTest.cpp",
|
|
|
|
"src/tests/unittests/validation/ValidationTest.h",
|
|
|
|
"src/tests/unittests/validation/VertexBufferValidationTests.cpp",
|
2019-02-14 18:47:07 +00:00
|
|
|
"src/tests/unittests/wire/WireArgumentTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireBasicTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireBufferMappingTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireCallbackTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireFenceTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireOptionalTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireTest.cpp",
|
|
|
|
"src/tests/unittests/wire/WireTest.h",
|
2018-12-08 10:35:53 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if (dawn_enable_d3d12) {
|
|
|
|
sources += [ "src/tests/unittests/d3d12/CopySplitTests.cpp" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
# When building inside Chromium, use their gtest main function because it is
|
|
|
|
# needed to run in swarming correctly.
|
|
|
|
if (build_with_chromium) {
|
|
|
|
sources += [ "//gpu/dawn_unittests_main.cc" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "src/tests/UnittestsMain.cpp" ]
|
|
|
|
}
|
2018-08-03 13:57:43 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 10:35:53 +00:00
|
|
|
test("dawn_end2end_tests") {
|
|
|
|
configs += [ ":dawn_internal" ]
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
deps = [
|
2018-12-08 10:35:53 +00:00
|
|
|
":dawn_common",
|
|
|
|
":dawn_utils",
|
|
|
|
":libdawn",
|
|
|
|
":libdawn_native",
|
|
|
|
":libdawn_wire",
|
|
|
|
"third_party:glfw",
|
|
|
|
"third_party:gmock_and_gtest",
|
2018-08-03 13:57:43 +00:00
|
|
|
]
|
2018-12-08 10:35:53 +00:00
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/tests/DawnTest.cpp",
|
|
|
|
"src/tests/DawnTest.h",
|
|
|
|
"src/tests/end2end/BasicTests.cpp",
|
|
|
|
"src/tests/end2end/BindGroupTests.cpp",
|
|
|
|
"src/tests/end2end/BufferTests.cpp",
|
2019-02-16 02:27:30 +00:00
|
|
|
"src/tests/end2end/ColorStateTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/ComputeCopyStorageBufferTests.cpp",
|
|
|
|
"src/tests/end2end/CopyTests.cpp",
|
2019-02-20 20:21:00 +00:00
|
|
|
"src/tests/end2end/DebugMarkerTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/DepthStencilStateTests.cpp",
|
2018-12-13 01:05:26 +00:00
|
|
|
"src/tests/end2end/DrawIndexedTests.cpp",
|
2019-01-30 09:01:08 +00:00
|
|
|
"src/tests/end2end/DrawTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/FenceTests.cpp",
|
|
|
|
"src/tests/end2end/IndexFormatTests.cpp",
|
|
|
|
"src/tests/end2end/InputStateTests.cpp",
|
|
|
|
"src/tests/end2end/PrimitiveTopologyTests.cpp",
|
|
|
|
"src/tests/end2end/PushConstantTests.cpp",
|
|
|
|
"src/tests/end2end/RenderPassLoadOpTests.cpp",
|
2019-02-15 10:55:08 +00:00
|
|
|
"src/tests/end2end/RenderPassTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/SamplerTests.cpp",
|
|
|
|
"src/tests/end2end/ScissorTests.cpp",
|
|
|
|
"src/tests/end2end/TextureViewTests.cpp",
|
|
|
|
"src/tests/end2end/ViewportOrientationTests.cpp",
|
|
|
|
]
|
|
|
|
|
2019-03-01 12:01:18 +00:00
|
|
|
libs = []
|
|
|
|
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/tests/end2end/IOSurfaceWrappingTests.cpp" ]
|
|
|
|
|
|
|
|
libs += [ "IOSurface.framework" ]
|
|
|
|
}
|
|
|
|
|
2018-12-08 10:35:53 +00:00
|
|
|
# When building inside Chromium, use their gtest main function because it is
|
|
|
|
# needed to run in swarming correctly.
|
|
|
|
if (build_with_chromium) {
|
|
|
|
sources += [ "//gpu/dawn_end2end_tests_main.cc" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "src/tests/End2EndTestsMain.cpp" ]
|
|
|
|
}
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
2018-08-13 06:23:27 +00:00
|
|
|
|
2018-12-10 16:45:24 +00:00
|
|
|
# Temporary groups to make a 5-way patch to fix crbug.com/913171
|
|
|
|
group("dawn_unittests_temp_group") {
|
|
|
|
testonly = true
|
2018-12-12 09:27:16 +00:00
|
|
|
deps = [
|
|
|
|
":dawn_unittests",
|
|
|
|
]
|
2018-12-10 16:45:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group("dawn_end2end_tests_temp_group") {
|
|
|
|
testonly = true
|
2018-12-12 09:27:16 +00:00
|
|
|
deps = [
|
|
|
|
":dawn_end2end_tests",
|
|
|
|
]
|
2018-12-10 16:45:24 +00:00
|
|
|
}
|
|
|
|
|
2018-08-13 06:23:27 +00:00
|
|
|
###############################################################################
|
|
|
|
# Dawn samples, only in standalone builds
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
if (dawn_standalone) {
|
|
|
|
# Static library to contain code and dependencies common to all samples
|
|
|
|
static_library("dawn_sample_utils") {
|
|
|
|
sources = [
|
|
|
|
"examples/SampleUtils.cpp",
|
|
|
|
"examples/SampleUtils.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
# Export all of these as public deps so that `gn check` allows includes
|
|
|
|
public_deps = [
|
|
|
|
":dawn_common",
|
|
|
|
":dawn_utils",
|
|
|
|
":libdawn",
|
|
|
|
":libdawn_native",
|
|
|
|
":libdawn_wire",
|
|
|
|
"third_party:glfw",
|
|
|
|
]
|
|
|
|
public_configs = [ ":dawn_internal" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Template for samples to avoid listing dawn_sample_utils as a dep every time
|
|
|
|
template("dawn_sample") {
|
|
|
|
executable(target_name) {
|
|
|
|
deps = [
|
|
|
|
":dawn_sample_utils",
|
|
|
|
]
|
|
|
|
forward_variables_from(invoker, "*", [ "deps" ])
|
|
|
|
|
|
|
|
if (defined(invoker.deps)) {
|
|
|
|
deps += invoker.deps
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("CppHelloTriangle") {
|
|
|
|
sources = [
|
|
|
|
"examples/CppHelloTriangle.cpp",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("CHelloTriangle") {
|
|
|
|
sources = [
|
|
|
|
"examples/CHelloTriangle.cpp",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("ComputeBoids") {
|
|
|
|
sources = [
|
|
|
|
"examples/ComputeBoids.cpp",
|
|
|
|
]
|
|
|
|
deps = [
|
|
|
|
"third_party:glm",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("Animometer") {
|
|
|
|
sources = [
|
|
|
|
"examples/Animometer.cpp",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("CubeReflection") {
|
|
|
|
sources = [
|
|
|
|
"examples/CubeReflection.cpp",
|
|
|
|
]
|
|
|
|
deps = [
|
|
|
|
"third_party:glm",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
dawn_sample("glTFViewer") {
|
|
|
|
sources = [
|
|
|
|
"examples/glTFViewer/Camera.inl",
|
|
|
|
"examples/glTFViewer/glTFViewer.cpp",
|
|
|
|
]
|
|
|
|
deps = [
|
|
|
|
"third_party:glm",
|
|
|
|
"third_party:tiny_gltf_loader",
|
|
|
|
]
|
|
|
|
}
|
2018-09-20 21:17:14 +00:00
|
|
|
|
|
|
|
group("dawn_samples") {
|
|
|
|
deps = [
|
2018-10-04 16:59:05 +00:00
|
|
|
":Animometer",
|
2018-09-20 21:17:14 +00:00
|
|
|
":CHelloTriangle",
|
|
|
|
":ComputeBoids",
|
2018-10-04 16:59:05 +00:00
|
|
|
":CppHelloTriangle",
|
2018-09-20 21:17:14 +00:00
|
|
|
":CubeReflection",
|
|
|
|
":glTFViewer",
|
|
|
|
]
|
|
|
|
}
|
2018-08-13 06:23:27 +00:00
|
|
|
}
|
Add fuzzers for SPIRV-Cross
This CL adds in fuzzers for SPIRV-Cross for HLSL, GLSL, and MSL
outputs. These fuzzers live in Dawn because there is not appropriate
location in the Chromium source repo for them and it is unlikely they
would be land-able in the SPIRV-Cross repo, because it is not coupled
with Chromium's build system and thus Clusterfuzz so would be
effectively dead code. Dawn depends on this code, but it is also
integrated into the Chromium build system, so this was the best place
I could find for them
The code under fuzz unfortunately uses exceptions/aborting as its
error reporting mechanism. This is an acknowledge short coming and
there are efforts to remove this behaviour. To work around this and
reduce the number of false positives found by the fuzzers, a signal
trap has been implemented which will be removed once the code under
fuzz has been updated.
The trap replaces the existing signal handler and silencing signals
while running the code under test. This allows the code under test to
call abort() and not crash the fuzzing process. Theoretically, only
SIGABRT should need to be trapped, but something is causing the signal
from abort() to be converted to SIGSEGV when running under ASAN.
This signal trap has been tested with the fuzzing/sanitizers by
intentionally inserting bad calls that will occur after a few thousand
test cases. It was confirmed that the fuzzer detected the issue and
stops fuzzing.
The alternate to implementing this signal trap would be to turn on
exceptions for the fuzzer. This was attempted, but proved to be
fruitless due to what was reported as an ODR issue, but couldn't
couldn't be silenced. The likely underlying issue was a pre-built
library or other object being built without exceptions was causing
different versions of symbols or the exception version of the standard
library not being instrumented by ASAN. Given the majority of Chromium
eco-system turns off exceptions, fixing this issue would not be
helpful to the larger community and was looking like it would require
significant effort.
BUG=chromium:903380
Change-Id: I63a5595383f99b7a0e150d72bb04c89b8d722631
Reviewed-on: https://dawn-review.googlesource.com/c/2260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-12 12:20:21 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Fuzzers
|
|
|
|
###############################################################################
|
|
|
|
|
2018-11-12 18:09:56 +00:00
|
|
|
group("dawn_fuzzers") {
|
|
|
|
testonly = true
|
|
|
|
deps = [
|
|
|
|
"src/fuzzers:dawn_spirv_cross_glsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_glsl_full_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_hlsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_hlsl_full_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_msl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_msl_full_fuzzer",
|
|
|
|
"src/fuzzers:dawn_wire_server_and_frontend_fuzzer",
|
|
|
|
]
|
Add fuzzers for SPIRV-Cross
This CL adds in fuzzers for SPIRV-Cross for HLSL, GLSL, and MSL
outputs. These fuzzers live in Dawn because there is not appropriate
location in the Chromium source repo for them and it is unlikely they
would be land-able in the SPIRV-Cross repo, because it is not coupled
with Chromium's build system and thus Clusterfuzz so would be
effectively dead code. Dawn depends on this code, but it is also
integrated into the Chromium build system, so this was the best place
I could find for them
The code under fuzz unfortunately uses exceptions/aborting as its
error reporting mechanism. This is an acknowledge short coming and
there are efforts to remove this behaviour. To work around this and
reduce the number of false positives found by the fuzzers, a signal
trap has been implemented which will be removed once the code under
fuzz has been updated.
The trap replaces the existing signal handler and silencing signals
while running the code under test. This allows the code under test to
call abort() and not crash the fuzzing process. Theoretically, only
SIGABRT should need to be trapped, but something is causing the signal
from abort() to be converted to SIGSEGV when running under ASAN.
This signal trap has been tested with the fuzzing/sanitizers by
intentionally inserting bad calls that will occur after a few thousand
test cases. It was confirmed that the fuzzer detected the issue and
stops fuzzing.
The alternate to implementing this signal trap would be to turn on
exceptions for the fuzzer. This was attempted, but proved to be
fruitless due to what was reported as an ODR issue, but couldn't
couldn't be silenced. The likely underlying issue was a pre-built
library or other object being built without exceptions was causing
different versions of symbols or the exception version of the standard
library not being instrumented by ASAN. Given the majority of Chromium
eco-system turns off exceptions, fixing this issue would not be
helpful to the larger community and was looking like it would require
significant effort.
BUG=chromium:903380
Change-Id: I63a5595383f99b7a0e150d72bb04c89b8d722631
Reviewed-on: https://dawn-review.googlesource.com/c/2260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2018-11-12 12:20:21 +00:00
|
|
|
}
|