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-05-22 17:18:52 +00:00
|
|
|
import("generator/dawn_generator.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
|
|
|
|
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
|
|
|
|
###############################################################################
|
|
|
|
|
2020-01-15 13:14:12 +00:00
|
|
|
supports_glfw_for_windowing = is_win || (is_linux && !is_chromeos) || is_mac
|
|
|
|
|
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/.
|
2020-01-15 13:14:12 +00:00
|
|
|
if (supports_glfw_for_windowing) {
|
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
|
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
|
|
|
group("dawn_glfw") {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
###############################################################################
|
|
|
|
# Utils for tests and samples
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
static_library("dawn_utils") {
|
2019-03-07 01:46:39 +00:00
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
2018-08-03 13:57:43 +00:00
|
|
|
|
|
|
|
sources = [
|
2019-08-13 22:12:54 +00:00
|
|
|
"src/utils/ComboRenderBundleEncoderDescriptor.cpp",
|
|
|
|
"src/utils/ComboRenderBundleEncoderDescriptor.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/SystemUtils.cpp",
|
|
|
|
"src/utils/SystemUtils.h",
|
|
|
|
"src/utils/TerribleCommandBuffer.cpp",
|
|
|
|
"src/utils/TerribleCommandBuffer.h",
|
2020-03-17 10:28:07 +00:00
|
|
|
"src/utils/TextureFormatUtils.cpp",
|
|
|
|
"src/utils/TextureFormatUtils.h",
|
2019-08-28 23:18:10 +00:00
|
|
|
"src/utils/Timer.h",
|
2019-10-25 11:36:47 +00:00
|
|
|
"src/utils/WGPUHelpers.cpp",
|
|
|
|
"src/utils/WGPUHelpers.h",
|
2018-08-03 13:57:43 +00:00
|
|
|
]
|
2020-01-15 13:14:12 +00:00
|
|
|
deps = [
|
|
|
|
"${dawn_root}/src/common",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2020-01-15 13:14:12 +00:00
|
|
|
"${dawn_shaderc_dir}:libshaderc",
|
|
|
|
]
|
|
|
|
libs = []
|
2019-02-13 18:42:38 +00:00
|
|
|
|
2019-08-28 23:18:10 +00:00
|
|
|
if (is_win) {
|
|
|
|
sources += [ "src/utils/WindowsTimer.cpp" ]
|
|
|
|
} else if (is_mac) {
|
2020-01-15 13:14:12 +00:00
|
|
|
sources += [
|
|
|
|
"src/utils/OSXTimer.cpp",
|
|
|
|
"src/utils/ObjCUtils.h",
|
|
|
|
"src/utils/ObjCUtils.mm",
|
|
|
|
]
|
|
|
|
libs += [ "QuartzCore.framework" ]
|
2019-08-28 23:18:10 +00:00
|
|
|
} else {
|
|
|
|
sources += [ "src/utils/PosixTimer.cpp" ]
|
|
|
|
}
|
|
|
|
|
2020-01-15 13:14:12 +00:00
|
|
|
if (supports_glfw_for_windowing) {
|
|
|
|
sources += [
|
|
|
|
"src/utils/GLFWUtils.cpp",
|
|
|
|
"src/utils/GLFWUtils.h",
|
|
|
|
]
|
|
|
|
deps += [ ":dawn_glfw" ]
|
|
|
|
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/utils/GLFWUtils_metal.mm" ]
|
|
|
|
libs += [ "Metal.framework" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-13 18:42:38 +00:00
|
|
|
public_deps = [
|
2019-10-16 10:26:01 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp_headers",
|
2019-02-13 18:42:38 +00:00
|
|
|
]
|
2019-08-13 21:45:44 +00:00
|
|
|
}
|
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
###############################################################################
|
|
|
|
# Dawn test targets
|
|
|
|
###############################################################################
|
|
|
|
|
2019-10-28 22:15:47 +00:00
|
|
|
dawn_json_generator("mock_webgpu_gen") {
|
|
|
|
target = "mock_webgpu"
|
2018-12-08 10:35:53 +00:00
|
|
|
outputs = [
|
2019-10-28 22:15:47 +00:00
|
|
|
"src/dawn/mock_webgpu.h",
|
|
|
|
"src/dawn/mock_webgpu.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
test("dawn_unittests") {
|
2019-03-07 01:46:39 +00:00
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
2018-12-08 10:35:53 +00:00
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
deps = [
|
2018-12-08 10:35:53 +00:00
|
|
|
":dawn_utils",
|
2019-10-28 22:15:47 +00:00
|
|
|
":mock_webgpu_gen",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
|
|
|
"${dawn_root}/src/dawn_native:dawn_native_sources",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2018-12-08 10:35:53 +00:00
|
|
|
"third_party:gmock_and_gtest",
|
2018-08-03 13:57:43 +00:00
|
|
|
]
|
2018-12-08 10:35:53 +00:00
|
|
|
|
2020-04-07 07:44:00 +00:00
|
|
|
# Add internal dawn_native config for internal unittests.
|
|
|
|
configs += [ "${dawn_root}/src/dawn_native:dawn_native_internal" ]
|
2018-12-08 10:35:53 +00:00
|
|
|
|
2019-10-28 22:15:47 +00:00
|
|
|
sources = get_target_outputs(":mock_webgpu_gen")
|
2019-07-19 16:16:58 +00:00
|
|
|
sources += [
|
|
|
|
"src/dawn_wire/client/ClientMemoryTransferService_mock.cpp",
|
|
|
|
"src/dawn_wire/client/ClientMemoryTransferService_mock.h",
|
|
|
|
"src/dawn_wire/server/ServerMemoryTransferService_mock.cpp",
|
|
|
|
"src/dawn_wire/server/ServerMemoryTransferService_mock.h",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/BitSetIteratorTests.cpp",
|
2019-07-30 16:46:10 +00:00
|
|
|
"src/tests/unittests/BuddyAllocatorTests.cpp",
|
2019-10-03 18:17:31 +00:00
|
|
|
"src/tests/unittests/BuddyMemoryAllocatorTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/CommandAllocatorTests.cpp",
|
|
|
|
"src/tests/unittests/EnumClassBitmasksTests.cpp",
|
|
|
|
"src/tests/unittests/ErrorTests.cpp",
|
2019-08-02 00:06:38 +00:00
|
|
|
"src/tests/unittests/ExtensionTests.cpp",
|
2019-10-15 12:08:48 +00:00
|
|
|
"src/tests/unittests/GetProcAddressTests.cpp",
|
2020-03-05 09:54:06 +00:00
|
|
|
"src/tests/unittests/LinkedListTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/MathTests.cpp",
|
|
|
|
"src/tests/unittests/ObjectBaseTests.cpp",
|
|
|
|
"src/tests/unittests/PerStageTests.cpp",
|
2020-03-04 17:48:24 +00:00
|
|
|
"src/tests/unittests/PlacementAllocatedTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/RefCountedTests.cpp",
|
|
|
|
"src/tests/unittests/ResultTests.cpp",
|
2019-09-18 22:06:41 +00:00
|
|
|
"src/tests/unittests/RingBufferAllocatorTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/SerialMapTests.cpp",
|
|
|
|
"src/tests/unittests/SerialQueueTests.cpp",
|
2020-03-04 17:48:24 +00:00
|
|
|
"src/tests/unittests/SlabAllocatorTests.cpp",
|
2019-11-07 12:13:27 +00:00
|
|
|
"src/tests/unittests/SystemUtilsTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/ToBackendTests.cpp",
|
|
|
|
"src/tests/unittests/validation/BindGroupValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/BufferValidationTests.cpp",
|
|
|
|
"src/tests/unittests/validation/CommandBufferValidationTests.cpp",
|
2019-06-10 20:56:27 +00:00
|
|
|
"src/tests/unittests/validation/ComputeIndirectValidationTests.cpp",
|
2019-10-22 17:28:20 +00:00
|
|
|
"src/tests/unittests/validation/ComputePassValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"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",
|
2019-06-10 20:56:27 +00:00
|
|
|
"src/tests/unittests/validation/DrawIndirectValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/DynamicStateCommandValidationTests.cpp",
|
2019-09-10 23:19:11 +00:00
|
|
|
"src/tests/unittests/validation/ErrorScopeValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/FenceValidationTests.cpp",
|
2019-11-22 17:02:22 +00:00
|
|
|
"src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/QueueSubmitValidationTests.cpp",
|
2019-08-13 22:12:54 +00:00
|
|
|
"src/tests/unittests/validation/RenderBundleValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/RenderPassDescriptorValidationTests.cpp",
|
2019-03-28 15:28:01 +00:00
|
|
|
"src/tests/unittests/validation/RenderPassValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/RenderPipelineValidationTests.cpp",
|
2020-03-27 15:52:50 +00:00
|
|
|
"src/tests/unittests/validation/ResourceUsageTrackingTests.cpp",
|
2019-05-22 17:18:52 +00:00
|
|
|
"src/tests/unittests/validation/SamplerValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/ShaderModuleValidationTests.cpp",
|
2020-03-11 01:28:48 +00:00
|
|
|
"src/tests/unittests/validation/StorageTextureValidationTests.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",
|
2019-04-26 07:52:57 +00:00
|
|
|
"src/tests/unittests/validation/ToggleValidationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/unittests/validation/ValidationTest.cpp",
|
|
|
|
"src/tests/unittests/validation/ValidationTest.h",
|
|
|
|
"src/tests/unittests/validation/VertexBufferValidationTests.cpp",
|
2019-11-07 22:23:29 +00:00
|
|
|
"src/tests/unittests/validation/VertexStateValidationTests.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",
|
2019-03-28 17:12:47 +00:00
|
|
|
"src/tests/unittests/wire/WireErrorCallbackTests.cpp",
|
2020-04-03 17:37:48 +00:00
|
|
|
"src/tests/unittests/wire/WireExtensionTests.cpp",
|
2019-02-14 18:47:07 +00:00
|
|
|
"src/tests/unittests/wire/WireFenceTests.cpp",
|
2019-03-28 12:57:11 +00:00
|
|
|
"src/tests/unittests/wire/WireInjectTextureTests.cpp",
|
2019-07-19 16:16:58 +00:00
|
|
|
"src/tests/unittests/wire/WireMemoryTransferServiceTests.cpp",
|
2019-02-14 18:47:07 +00:00
|
|
|
"src/tests/unittests/wire/WireOptionalTests.cpp",
|
|
|
|
"src/tests/unittests/wire/WireTest.cpp",
|
|
|
|
"src/tests/unittests/wire/WireTest.h",
|
2019-10-24 22:27:27 +00:00
|
|
|
"src/tests/unittests/wire/WireWGPUDevicePropertiesTests.cpp",
|
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
|
|
|
}
|
|
|
|
|
2019-08-10 03:17:52 +00:00
|
|
|
source_set("dawn_end2end_tests_sources") {
|
2019-03-07 01:46:39 +00:00
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
2019-08-10 03:17:52 +00:00
|
|
|
testonly = true
|
2018-12-08 10:35:53 +00:00
|
|
|
|
2018-08-03 13:57:43 +00:00
|
|
|
deps = [
|
2018-12-08 10:35:53 +00:00
|
|
|
":dawn_utils",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2018-12-08 10:35:53 +00:00
|
|
|
"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.h",
|
|
|
|
"src/tests/end2end/BasicTests.cpp",
|
|
|
|
"src/tests/end2end/BindGroupTests.cpp",
|
|
|
|
"src/tests/end2end/BufferTests.cpp",
|
2019-03-27 00:01:33 +00:00
|
|
|
"src/tests/end2end/ClipSpaceTests.cpp",
|
2019-02-16 02:27:30 +00:00
|
|
|
"src/tests/end2end/ColorStateTests.cpp",
|
2019-07-02 23:55:55 +00:00
|
|
|
"src/tests/end2end/CompressedTextureFormatTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/ComputeCopyStorageBufferTests.cpp",
|
2019-06-10 20:56:27 +00:00
|
|
|
"src/tests/end2end/ComputeIndirectTests.cpp",
|
2019-04-26 02:08:12 +00:00
|
|
|
"src/tests/end2end/ComputeSharedMemoryTests.cpp",
|
2019-10-22 17:28:20 +00:00
|
|
|
"src/tests/end2end/ComputeStorageBufferBarrierTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/CopyTests.cpp",
|
2019-07-06 00:11:10 +00:00
|
|
|
"src/tests/end2end/CullingTests.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",
|
2019-03-27 22:04:10 +00:00
|
|
|
"src/tests/end2end/DestroyTests.cpp",
|
2020-01-15 19:02:13 +00:00
|
|
|
"src/tests/end2end/DeviceLostTests.cpp",
|
2019-06-10 20:56:27 +00:00
|
|
|
"src/tests/end2end/DrawIndexedIndirectTests.cpp",
|
2018-12-13 01:05:26 +00:00
|
|
|
"src/tests/end2end/DrawIndexedTests.cpp",
|
2019-06-10 20:56:27 +00:00
|
|
|
"src/tests/end2end/DrawIndirectTests.cpp",
|
2019-01-30 09:01:08 +00:00
|
|
|
"src/tests/end2end/DrawTests.cpp",
|
2019-05-23 00:45:12 +00:00
|
|
|
"src/tests/end2end/DynamicBufferOffsetTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/FenceTests.cpp",
|
2019-11-18 04:28:24 +00:00
|
|
|
"src/tests/end2end/GpuMemorySynchronizationTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/IndexFormatTests.cpp",
|
2019-03-28 14:18:11 +00:00
|
|
|
"src/tests/end2end/MultisampledRenderingTests.cpp",
|
2019-05-11 00:21:50 +00:00
|
|
|
"src/tests/end2end/NonzeroTextureCreationTests.cpp",
|
2019-05-01 12:57:27 +00:00
|
|
|
"src/tests/end2end/ObjectCachingTests.cpp",
|
2019-08-02 18:15:08 +00:00
|
|
|
"src/tests/end2end/OpArrayLengthTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/PrimitiveTopologyTests.cpp",
|
2019-08-14 02:01:14 +00:00
|
|
|
"src/tests/end2end/RenderBundleTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"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",
|
2020-03-16 10:53:36 +00:00
|
|
|
"src/tests/end2end/StorageTextureTests.cpp",
|
2019-07-01 09:58:07 +00:00
|
|
|
"src/tests/end2end/TextureFormatTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/TextureViewTests.cpp",
|
2019-06-11 18:11:05 +00:00
|
|
|
"src/tests/end2end/TextureZeroInitTests.cpp",
|
2019-04-26 15:25:18 +00:00
|
|
|
"src/tests/end2end/VertexFormatTests.cpp",
|
2019-11-07 22:23:29 +00:00
|
|
|
"src/tests/end2end/VertexStateTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
"src/tests/end2end/ViewportOrientationTests.cpp",
|
2019-07-16 19:27:09 +00:00
|
|
|
"src/tests/end2end/ViewportTests.cpp",
|
2018-12-08 10:35:53 +00:00
|
|
|
]
|
|
|
|
|
2020-01-23 17:20:38 +00:00
|
|
|
# Validation tests that need OS windows live in end2end tests.
|
|
|
|
sources += [
|
|
|
|
"src/tests/unittests/validation/ValidationTest.cpp",
|
|
|
|
"src/tests/unittests/validation/ValidationTest.h",
|
|
|
|
]
|
|
|
|
|
2019-03-01 12:01:18 +00:00
|
|
|
libs = []
|
|
|
|
|
2019-09-02 19:19:34 +00:00
|
|
|
if (dawn_enable_d3d12) {
|
|
|
|
sources += [ "src/tests/end2end/D3D12ResourceWrappingTests.cpp" ]
|
|
|
|
libs += [
|
|
|
|
"d3d11.lib",
|
|
|
|
"dxgi.lib",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-01-15 13:14:12 +00:00
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/tests/end2end/IOSurfaceWrappingTests.cpp" ]
|
|
|
|
libs += [ "IOSurface.framework" ]
|
|
|
|
}
|
|
|
|
|
2019-08-13 21:45:44 +00:00
|
|
|
if (dawn_enable_opengl) {
|
2020-01-15 13:14:12 +00:00
|
|
|
assert(supports_glfw_for_windowing)
|
|
|
|
}
|
|
|
|
|
|
|
|
if (supports_glfw_for_windowing) {
|
2020-01-23 17:20:38 +00:00
|
|
|
sources += [
|
2020-03-20 17:07:20 +00:00
|
|
|
"src/tests/end2end/SwapChainTests.cpp",
|
2020-01-23 17:20:38 +00:00
|
|
|
"src/tests/end2end/SwapChainValidationTests.cpp",
|
|
|
|
"src/tests/end2end/WindowSurfaceTests.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
|
|
|
deps += [ ":dawn_glfw" ]
|
2019-08-13 21:45:44 +00:00
|
|
|
}
|
2019-08-10 03:17:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
source_set("dawn_white_box_tests_sources") {
|
2020-04-07 07:44:00 +00:00
|
|
|
configs += [ "${dawn_root}/src/dawn_native:dawn_native_internal" ]
|
2019-08-10 03:17:52 +00:00
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":dawn_utils",
|
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native:dawn_native_sources",
|
2020-04-07 07:29:45 +00:00
|
|
|
|
2020-04-07 07:44:00 +00:00
|
|
|
# Static because the tests both link against and have dawn_native
|
2020-04-07 07:29:45 +00:00
|
|
|
# sources. MSVC errors when both importing and exporting symbols.
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native:dawn_native_static",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2019-08-10 03:17:52 +00:00
|
|
|
"third_party:gmock_and_gtest",
|
|
|
|
]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/tests/DawnTest.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
deps += [ "third_party:vulkan_headers" ]
|
|
|
|
|
2020-02-20 19:19:13 +00:00
|
|
|
if (is_chromeos) {
|
|
|
|
sources += [ "src/tests/white_box/VulkanImageWrappingTestsDmaBuf.cpp" ]
|
|
|
|
} else if (is_linux) {
|
|
|
|
sources += [ "src/tests/white_box/VulkanImageWrappingTestsOpaqueFD.cpp" ]
|
2019-08-10 03:17:52 +00:00
|
|
|
}
|
2019-12-17 00:47:40 +00:00
|
|
|
|
|
|
|
if (dawn_enable_error_injection) {
|
|
|
|
sources += [ "src/tests/white_box/VulkanErrorInjectorTests.cpp" ]
|
|
|
|
}
|
2019-08-10 03:17:52 +00:00
|
|
|
}
|
|
|
|
|
2019-11-05 19:34:45 +00:00
|
|
|
if (dawn_enable_d3d12) {
|
2020-02-27 01:14:22 +00:00
|
|
|
sources += [
|
|
|
|
"src/tests/white_box/D3D12DescriptorHeapTests.cpp",
|
|
|
|
"src/tests/white_box/D3D12SmallTextureTests.cpp",
|
|
|
|
]
|
2019-11-05 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
2020-01-15 18:22:53 +00:00
|
|
|
if (dawn_enable_metal) {
|
|
|
|
sources += [ "src/tests/white_box/MetalAutoreleasePoolTests.mm" ]
|
|
|
|
}
|
|
|
|
|
2019-08-13 21:45:44 +00:00
|
|
|
if (dawn_enable_opengl) {
|
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
|
|
|
deps += [ ":dawn_glfw" ]
|
2019-08-13 21:45:44 +00:00
|
|
|
}
|
|
|
|
|
2019-08-10 03:17:52 +00:00
|
|
|
libs = []
|
|
|
|
}
|
|
|
|
|
|
|
|
test("dawn_end2end_tests") {
|
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":dawn_end2end_tests_sources",
|
|
|
|
":dawn_utils",
|
|
|
|
":dawn_white_box_tests_sources",
|
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2019-08-10 03:17:52 +00:00
|
|
|
"third_party:gmock_and_gtest",
|
|
|
|
]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/tests/DawnTest.cpp",
|
|
|
|
"src/tests/DawnTest.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
libs = []
|
2019-03-01 12:01:18 +00:00
|
|
|
|
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" ]
|
|
|
|
}
|
2019-08-13 21:45:44 +00:00
|
|
|
|
|
|
|
if (dawn_enable_opengl) {
|
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
|
|
|
deps += [ ":dawn_glfw" ]
|
2019-08-13 21:45:44 +00:00
|
|
|
}
|
2020-02-20 19:19:13 +00:00
|
|
|
|
|
|
|
if (is_chromeos) {
|
|
|
|
libs += [ "gbm" ]
|
|
|
|
}
|
2018-07-31 16:50:03 +00:00
|
|
|
}
|
2018-08-13 06:23:27 +00:00
|
|
|
|
2019-08-28 23:18:10 +00:00
|
|
|
test("dawn_perf_tests") {
|
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":dawn_utils",
|
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
2020-04-07 07:29:45 +00:00
|
|
|
"${dawn_root}/src/dawn_platform",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_wire",
|
2019-08-28 23:18:10 +00:00
|
|
|
"third_party:gmock_and_gtest",
|
|
|
|
]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/tests/DawnTest.cpp",
|
|
|
|
"src/tests/DawnTest.h",
|
|
|
|
"src/tests/ParamGenerator.h",
|
|
|
|
"src/tests/perf_tests/BufferUploadPerf.cpp",
|
|
|
|
"src/tests/perf_tests/DawnPerfTest.cpp",
|
|
|
|
"src/tests/perf_tests/DawnPerfTest.h",
|
2019-10-17 19:00:32 +00:00
|
|
|
"src/tests/perf_tests/DawnPerfTestPlatform.cpp",
|
|
|
|
"src/tests/perf_tests/DawnPerfTestPlatform.h",
|
2019-10-31 03:20:31 +00:00
|
|
|
"src/tests/perf_tests/DrawCallPerf.cpp",
|
2019-08-28 23:18:10 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
libs = []
|
|
|
|
|
|
|
|
# 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_perf_tests_main.cc" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "src/tests/PerfTestsMain.cpp" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_metal) {
|
|
|
|
libs += [ "IOSurface.framework" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_opengl) {
|
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
|
|
|
deps += [ ":dawn_glfw" ]
|
2019-08-28 23:18:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-13 06:23:27 +00:00
|
|
|
###############################################################################
|
|
|
|
# Dawn samples, only in standalone builds
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
if (dawn_standalone) {
|
2019-11-19 18:58:50 +00:00
|
|
|
# Library to handle the interaction of Dawn with GLFW windows in samples
|
|
|
|
static_library("dawn_bindings") {
|
|
|
|
configs += [ "${dawn_root}/src/common:dawn_internal" ]
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
"src/utils/BackendBinding.cpp",
|
|
|
|
"src/utils/BackendBinding.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
public_deps = [
|
|
|
|
"${dawn_root}/src/dawn:dawn_headers",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":dawn_glfw",
|
|
|
|
"${dawn_root}/src/common",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
2019-11-19 18:58:50 +00:00
|
|
|
]
|
|
|
|
libs = []
|
|
|
|
|
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dawn_enable_vulkan) {
|
|
|
|
sources += [ "src/utils/VulkanBinding.cpp" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-13 06:23:27 +00:00
|
|
|
# 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 = [
|
2019-08-13 21:45:44 +00:00
|
|
|
":dawn_bindings",
|
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
|
|
|
":dawn_glfw",
|
2018-08-13 06:23:27 +00:00
|
|
|
":dawn_utils",
|
2019-03-07 01:46:39 +00:00
|
|
|
"${dawn_root}/src/common",
|
2019-10-15 11:44:38 +00:00
|
|
|
"${dawn_root}/src/dawn:dawncpp",
|
|
|
|
"${dawn_root}/src/dawn:libdawn_proc",
|
2020-04-07 07:44:00 +00:00
|
|
|
"${dawn_root}/src/dawn_native",
|
|
|
|
"${dawn_root}/src/dawn_wire",
|
2018-08-13 06:23:27 +00:00
|
|
|
]
|
2019-03-07 01:46:39 +00:00
|
|
|
public_configs = [ "${dawn_root}/src/common:dawn_internal" ]
|
2018-08-13 06:23:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# 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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-03-20 17:07:20 +00:00
|
|
|
dawn_sample("ManualSwapChainTest") {
|
|
|
|
sources = [
|
|
|
|
"examples/ManualSwapChainTest.cpp",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
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 = [
|
2019-11-27 20:56:14 +00:00
|
|
|
"src/fuzzers:dawn_spirv_cross_glsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_hlsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spirv_cross_msl_fast_fuzzer",
|
2019-12-11 19:03:01 +00:00
|
|
|
"src/fuzzers:dawn_spvc_glsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spvc_hlsl_fast_fuzzer",
|
|
|
|
"src/fuzzers:dawn_spvc_msl_fast_fuzzer",
|
2018-11-12 18:09:56 +00:00
|
|
|
"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
|
|
|
}
|
2020-04-07 07:29:45 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Temporary groups
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Temporary groups to make a 5-way patch to fix crbug.com/913171
|
|
|
|
group("dawn_unittests_temp_group") {
|
|
|
|
testonly = true
|
2020-04-07 16:16:37 +00:00
|
|
|
public_deps = [
|
2020-04-07 07:29:45 +00:00
|
|
|
":dawn_unittests",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
group("dawn_end2end_tests_temp_group") {
|
|
|
|
testonly = true
|
2020-04-07 16:16:37 +00:00
|
|
|
public_deps = [
|
2020-04-07 07:29:45 +00:00
|
|
|
":dawn_end2end_tests",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
group("dawn_perf_tests_temp_group") {
|
|
|
|
testonly = true
|
2020-04-07 16:16:37 +00:00
|
|
|
public_deps = [
|
2020-04-07 07:29:45 +00:00
|
|
|
":dawn_perf_tests",
|
|
|
|
]
|
|
|
|
data_deps = [
|
|
|
|
":dawn_perf_tests",
|
|
|
|
]
|
|
|
|
}
|