mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
Split the libdawn target in components with a single purpose.
The functionality of the dawn_headers and libdawn targets are split into the following targets: - dawn_headers: the new version only exposes the "dawn.h" C API and no longer includes the C++ API. - dawncpp: the header and implementation of the C++ API that wraps the C API. This is unbundled from the rest so the C++ API can be used with libdawn_proc or other libraries implementing the C API. - libdawn_proc: A DawnProcTable-backend implementation of the C API. This is needed because in follow-up commit there will be three libraries implementing the C API: libdawn_proc that trampolines where we want, and libdawn_native/wire that don't have trampolines for better perf. BUG=dawn:22 Change-Id: I5d941f0d98e5a4b633e14d67eb5269f7924f0647 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12160 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
1093c4de2c
commit
96496828a0
36
src/include/dawn/dawn_proc.h
Normal file
36
src/include/dawn/dawn_proc.h
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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.
|
||||
|
||||
#ifndef DAWN_DAWN_PROC_H_
|
||||
#define DAWN_DAWN_PROC_H_
|
||||
|
||||
#include "dawn/dawn.h"
|
||||
#include "dawn/dawn_proc_table.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Sets the static proctable used by libdawn_proc to implement the Dawn entrypoints. Passing NULL
|
||||
// for `procs` sets up the null proctable that contains only null function pointers. It is the
|
||||
// default value of the proctable. Setting the proctable back to null is good practice when you
|
||||
// are done using libdawn_proc since further usage will cause a segfault instead of calling an
|
||||
// unexpected function.
|
||||
DAWN_EXPORT void dawnProcSetProcs(const DawnProcTable* procs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // DAWN_DAWN_PROC_H_
|
||||
@@ -16,6 +16,7 @@
|
||||
#define DAWNNATIVE_DAWNNATIVE_H_
|
||||
|
||||
#include <dawn/dawn.h>
|
||||
#include <dawn/dawn_proc_table.h>
|
||||
#include <dawn_native/dawn_native_export.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
#ifndef DAWNWIRE_WIRECLIENT_H_
|
||||
#define DAWNWIRE_WIRECLIENT_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "dawn/dawn_proc_table.h"
|
||||
#include "dawn_wire/Wire.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace dawn_wire {
|
||||
|
||||
namespace client {
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "dawn_wire/Wire.h"
|
||||
|
||||
struct DawnProcTable;
|
||||
|
||||
namespace dawn_wire {
|
||||
|
||||
namespace server {
|
||||
|
||||
Reference in New Issue
Block a user