Loko Kung 14ed533565 Updates DawnInstanceDescriptor to pass in the Platform.
Notes:
- Separates ChainedStruct to be reusable without cpp header. (Also
  updates native structs to directly use it.)
- Manually implements the descriptor in DawnNative.
- Reworks ChainUtils with mapping from struct to STypes.
- Updates the tests to use either SetPlatformForTesting which is still
  required because DawnTest uses a "global" instance for all tests and
  some tests require setting (and cleaning up) a test specific platform.

Bug: dawn:1374
Change-Id: I078c78f22c5137030cf3cf0e8358fe4373ee9c6c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132268
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
2023-05-16 04:50:32 +00:00

72 lines
2.1 KiB
Plaintext

# Copyright 2019 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.
import("../../scripts/dawn_overrides_with_defaults.gni")
import("${dawn_root}/generator/dawn_generator.gni")
import("${dawn_root}/scripts/dawn_component.gni")
###############################################################################
# Dawn headers
###############################################################################
dawn_json_generator("headers_gen") {
target = "headers"
outputs = [
"include/dawn/dawn_proc_table.h",
"include/dawn/webgpu.h",
]
}
source_set("headers") {
all_dependent_configs = [ ":public" ]
public_deps = [ ":headers_gen" ]
sources = get_target_outputs(":headers_gen")
}
###############################################################################
# Dawn C++ headers
###############################################################################
dawn_json_generator("cpp_headers_gen") {
target = "cpp_headers"
outputs = [
"include/dawn/webgpu_cpp.h",
"include/dawn/webgpu_cpp_chained_struct.h",
"include/dawn/webgpu_cpp_print.h",
]
}
source_set("cpp_headers") {
public_deps = [
":cpp_headers_gen",
":headers",
]
sources = get_target_outputs(":cpp_headers_gen")
sources += [ "${dawn_root}/include/dawn/EnumClassBitmasks.h" ]
}
###############################################################################
# Dawn public include directories
###############################################################################
config("public") {
include_dirs = [
"${target_gen_dir}/../../include",
"${dawn_root}/include",
]
}