tint->dawn: Move examples -> samples/dawn

Bug: dawn:1275
Change-Id: I4824aaabc2c2b55a609a6e1370959394b93463b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79103
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-02-04 18:35:55 +00:00 committed by Dawn LUCI CQ
parent 9fb7a5146a
commit a6750751c7
13 changed files with 22 additions and 24 deletions

View File

@ -22,7 +22,7 @@ group("all") {
"src/tests:dawn_tests",
]
if (dawn_standalone) {
deps += [ "examples:dawn_samples" ]
deps += [ "samples/dawn:samples" ]
}
}

View File

@ -78,7 +78,7 @@ set(ENABLE_OPENGLES OFF)
set(ENABLE_DESKTOP_GL OFF)
set(ENABLE_VULKAN OFF)
set(USE_X11 OFF)
set(BUILD_EXAMPLE OFF)
set(BUILD_SAMPLES OFF)
if (WIN32)
set(ENABLE_D3D12 ON)
if (NOT WINDOWS_STORE)
@ -102,7 +102,7 @@ endif()
# Current examples are depend on GLFW
if (DAWN_SUPPORTS_GLFW_FOR_WINDOWING)
set(BUILD_EXAMPLE ON)
set(BUILD_SAMPLES ON)
endif()
option_if_not_defined(DAWN_ENABLE_D3D12 "Enable compilation of the D3D12 backend" ${ENABLE_D3D12})
@ -114,7 +114,7 @@ option_if_not_defined(DAWN_ENABLE_VULKAN "Enable compilation of the Vulkan backe
option_if_not_defined(DAWN_ALWAYS_ASSERT "Enable assertions on all build types" OFF)
option_if_not_defined(DAWN_USE_X11 "Enable support for X11 surface" ${USE_X11})
option_if_not_defined(DAWN_BUILD_EXAMPLES "Enables building Dawn's exmaples" ${BUILD_EXAMPLE})
option_if_not_defined(DAWN_BUILD_SAMPLES "Enables building Dawn's samples" ${BUILD_SAMPLES})
option_if_not_defined(DAWN_BUILD_NODE_BINDINGS "Enables building Dawn's NodeJS bindings" OFF)
option_if_not_defined(DAWN_ENABLE_PIC "Build with Position-Independent-Code enabled" OFF)
@ -220,10 +220,10 @@ add_subdirectory(src/dawn/wire)
# TODO(dawn:269): Remove once the implementation-based swapchains are removed.
add_subdirectory(src/dawn/utils)
if (DAWN_BUILD_EXAMPLES)
if (DAWN_BUILD_SAMPLES)
#TODO(dawn:269): Add this once implementation-based swapchains are removed.
#add_subdirectory(src/dawn/utils)
add_subdirectory(examples)
add_subdirectory(samples/dawn)
endif()
if (DAWN_BUILD_NODE_BINDINGS)

View File

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("../scripts/dawn_overrides_with_defaults.gni")
import("../../scripts/dawn_overrides_with_defaults.gni")
group("dawn_samples") {
group("samples") {
deps = [
":Animometer",
":CHelloTriangle",
@ -25,7 +25,7 @@ group("dawn_samples") {
}
# Static library to contain code and dependencies common to all samples
static_library("dawn_sample_utils") {
static_library("utils") {
sources = [
"SampleUtils.cpp",
"SampleUtils.h",
@ -34,7 +34,6 @@ static_library("dawn_sample_utils") {
# Export all of these as public deps so that `gn check` allows includes
public_deps = [
"${dawn_root}/src/dawn:cpp",
"${dawn_root}/src/dawn:proc",
"${dawn_root}/src/dawn/common",
"${dawn_root}/src/dawn/native",
"${dawn_root}/src/dawn/utils",
@ -45,10 +44,10 @@ static_library("dawn_sample_utils") {
public_configs = [ "${dawn_root}/src/dawn/common:internal_config" ]
}
# Template for samples to avoid listing dawn_sample_utils as a dep every time
template("dawn_sample") {
# Template for samples to avoid listing utils as a dep every time
template("sample") {
executable(target_name) {
deps = [ ":dawn_sample_utils" ]
deps = [ ":utils" ]
forward_variables_from(invoker, "*", [ "deps" ])
if (defined(invoker.deps)) {
@ -57,22 +56,22 @@ template("dawn_sample") {
}
}
dawn_sample("CppHelloTriangle") {
sample("CppHelloTriangle") {
sources = [ "CppHelloTriangle.cpp" ]
}
dawn_sample("CHelloTriangle") {
sample("CHelloTriangle") {
sources = [ "CHelloTriangle.cpp" ]
}
dawn_sample("ComputeBoids") {
sample("ComputeBoids") {
sources = [ "ComputeBoids.cpp" ]
}
dawn_sample("Animometer") {
sample("Animometer") {
sources = [ "Animometer.cpp" ]
}
dawn_sample("ManualSwapChainTest") {
sample("ManualSwapChainTest") {
sources = [ "ManualSwapChainTest.cpp" ]
}

View File

@ -14,21 +14,20 @@
#include "SampleUtils.h"
#include "GLFW/glfw3.h"
#include "dawn/common/Assert.h"
#include "dawn/common/Log.h"
#include "dawn/common/Platform.h"
#include "dawn/common/SystemUtils.h"
#include "dawn/dawn_proc.h"
#include "dawn/dawn_wsi.h"
#include "dawn/native/DawnNative.h"
#include "dawn/utils/BackendBinding.h"
#include "dawn/utils/GLFWUtils.h"
#include "dawn/utils/TerribleCommandBuffer.h"
#include "dawn/wire/WireClient.h"
#include "dawn/wire/WireServer.h"
#include <dawn/dawn_proc.h>
#include <dawn/dawn_wsi.h>
#include <dawn/native/DawnNative.h>
#include "GLFW/glfw3.h"
#include <algorithm>
#include <cstring>

View File

@ -85,7 +85,7 @@ config("internal_config") {
# Only internal Dawn targets can use this config, this means only targets in
# this BUILD.gn file and related subdirs.
visibility = [
"${dawn_root}/examples/*",
"${dawn_root}/samples/dawn/*",
"${dawn_root}/src/*",
"${dawn_root}/src/dawn/*",
]