From 84d836295eb5f7af9fe845cee2e433954412b6aa Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Fri, 6 Dec 2019 08:34:49 +0000 Subject: [PATCH] Remove generation of proxy dawn.h and dawncpp.h BUG=dawn:22 Change-Id: Iee8b93fddf2f4aced72bb12062ffae6dddc336ee Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14260 Reviewed-by: Austin Eng Reviewed-by: Kai Ninomiya Commit-Queue: Corentin Wallez --- generator/dawn_json_generator.py | 2 -- generator/templates/dawn.h | 61 -------------------------------- generator/templates/dawncpp.h | 54 ---------------------------- src/dawn/BUILD.gn | 2 -- 4 files changed, 119 deletions(-) delete mode 100644 generator/templates/dawn.h delete mode 100644 generator/templates/dawncpp.h diff --git a/generator/dawn_json_generator.py b/generator/dawn_json_generator.py index e769858b1b..3a67951b00 100644 --- a/generator/dawn_json_generator.py +++ b/generator/dawn_json_generator.py @@ -529,12 +529,10 @@ class MultiGeneratorFromDawnJSON(Generator): if 'dawn_headers' in targets: renders.append(FileRender('webgpu.h', 'src/include/dawn/webgpu.h', [base_params, api_params])) - renders.append(FileRender('dawn.h', 'src/include/dawn/dawn.h', [base_params, api_params])) renders.append(FileRender('dawn_proc_table.h', 'src/include/dawn/dawn_proc_table.h', [base_params, api_params])) if 'dawncpp_headers' in targets: renders.append(FileRender('webgpu_cpp.h', 'src/include/dawn/webgpu_cpp.h', [base_params, api_params])) - renders.append(FileRender('dawncpp.h', 'src/include/dawn/dawncpp.h', [base_params, api_params])) if 'dawn_proc' in targets: renders.append(FileRender('dawn_proc.c', 'src/dawn/dawn_proc.c', [base_params, api_params])) diff --git a/generator/templates/dawn.h b/generator/templates/dawn.h deleted file mode 100644 index bc78835006..0000000000 --- a/generator/templates/dawn.h +++ /dev/null @@ -1,61 +0,0 @@ -//* Copyright 2017 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. - -// This temporary header translates all the previous Dawn C API to the webgpu.h -// API so that during a small transition period both headers are supported. - -#ifndef DAWN_DAWN_H_ -#define DAWN_DAWN_H_ - -#include "webgpu.h" - -#define DAWN_WHOLE_SIZE WGPU_WHOLE_SIZE - -{% for type in by_category["object"] %} - typedef {{as_cType(type.name)}} {{as_cTypeDawn(type.name)}}; - typedef {{as_cType(type.name)}}Impl {{as_cTypeDawn(type.name)}}Impl; - {% for method in c_methods(type) %} - typedef {{as_cProc(type.name, method.name)}} {{as_cProcDawn(type.name, method.name)}}; - #define {{as_cMethodDawn(type.name, method.name)}} {{as_cMethod(type.name, method.name)}} - {% endfor %} -{% endfor %} - -{% for type in by_category["enum"] + by_category["bitmask"] %} - typedef {{as_cType(type.name)}} {{as_cTypeDawn(type.name)}}; - {% if type.category == "bitmask" %} - typedef {{as_cType(type.name)}}Flags {{as_cTypeDawn(type.name)}}Flags; - {% endif %} - - {% for value in type.values %} - #define {{as_cEnumDawn(type.name, value.name)}} {{as_cEnum(type.name, value.name)}} - {% endfor %} - #define {{as_cEnumDawn(type.name, Name("force32"))}} {{as_cEnum(type.name, Name("force32"))}} -{% endfor %} - -{% for type in by_category["structure"] %} - typedef {{as_cType(type.name)}} {{as_cTypeDawn(type.name)}}; -{% endfor %} - -typedef WGPUBufferCreateMappedCallback DawnBufferCreateMappedCallback; -typedef WGPUBufferMapReadCallback DawnBufferMapReadCallback; -typedef WGPUBufferMapWriteCallback DawnBufferMapWriteCallback; -typedef WGPUFenceOnCompletionCallback DawnFenceOnCompletionCallback; -typedef WGPUErrorCallback DawnErrorCallback; - -typedef WGPUProc DawnProc; - -typedef WGPUProcGetProcAddress DawnProcGetProcAddress; -#define DawnGetProcAddress WGPUGetProcAddress - -#endif // DAWN_DAWN_H_ diff --git a/generator/templates/dawncpp.h b/generator/templates/dawncpp.h deleted file mode 100644 index a944e581a0..0000000000 --- a/generator/templates/dawncpp.h +++ /dev/null @@ -1,54 +0,0 @@ -//* Copyright 2017 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. - -// This temporary header translates all the previous Dawn C++ API to the webgpu_cpp.h -// API so that during a small transition period both headers are supported. - -#ifndef DAWN_DAWNCPP_H_ -#define DAWN_DAWNCPP_H_ - -#include "dawn/dawn.h" -#include "dawn/webgpu_cpp.h" - -namespace dawn { - - static constexpr uint64_t kWholeSize = wgpu::kWholeSize; - - {% for type in by_category["enum"] %} - using {{as_cppType(type.name)}} = wgpu::{{as_cppType(type.name)}}; - {% endfor %} - - {% for type in by_category["bitmask"] %} - using {{as_cppType(type.name)}} = wgpu::{{as_cppType(type.name)}}; - {% endfor %} - - using Proc = wgpu::Proc; - {% for type in by_category["natively defined"] %} - using {{as_cppType(type.name)}} = wgpu::{{as_cppType(type.name)}}; - {% endfor %} - - {% for type in by_category["object"] %} - using {{as_cppType(type.name)}} = wgpu::{{as_cppType(type.name)}}; - {% endfor %} - - {% for type in by_category["structure"] %} - using {{as_cppType(type.name)}} = wgpu::{{as_cppType(type.name)}}; - {% endfor %} - - static inline Proc GetProcAddress(Device const& device, const char* procName) { - return wgpu::GetProcAddress(device, procName); - } -} // namespace dawn - -#endif // DAWN_DAWNCPP_H_ diff --git a/src/dawn/BUILD.gn b/src/dawn/BUILD.gn index 2ee0996b9f..dd6e890abf 100644 --- a/src/dawn/BUILD.gn +++ b/src/dawn/BUILD.gn @@ -32,7 +32,6 @@ group("libdawn") { dawn_json_generator("dawn_headers_gen") { target = "dawn_headers" outputs = [ - "src/include/dawn/dawn.h", "src/include/dawn/dawn_proc_table.h", "src/include/dawn/webgpu.h", ] @@ -55,7 +54,6 @@ source_set("dawn_headers") { dawn_json_generator("dawncpp_headers_gen") { target = "dawncpp_headers" outputs = [ - "src/include/dawn/dawncpp.h", "src/include/dawn/webgpu_cpp.h", ] }