dawn_native: Prefix all API methods with API

This means that calling wgpu::Object::DoStuff will translate to a call
to dawn_native::ObjectBase::APIDoStuff. This will clarify the
difference between reentrant calls and internal calls in dawn_native.
Avoiding issues in the future.

This CL only changes the code generator to prefix with "API", performs
renames needed to make the code compile, and adds TODOs for things that
should be fixed in follow-up CLs.

Bug: dawn:723

Change-Id: Ie24471fa093adc4179d33d13323429847d076ecb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45921
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Corentin Wallez
2021-03-29 14:02:05 +00:00
committed by Commit Bot service account
parent b745df8537
commit 2ce4b905b2
46 changed files with 464 additions and 390 deletions

View File

@@ -73,6 +73,14 @@ void RefCounted::Release() {
}
}
void RefCounted::APIReference() {
Reference();
}
void RefCounted::APIRelease() {
Release();
}
void RefCounted::DeleteThis() {
delete this;
}

View File

@@ -27,10 +27,12 @@ class RefCounted {
uint64_t GetRefCountForTesting() const;
uint64_t GetRefCountPayload() const;
// Dawn API
void Reference();
void Release();
void APIReference();
void APIRelease();
protected:
virtual ~RefCounted() = default;
// A Derived class may override this if they require a custom deleter.