mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Add Instance and CreateInstance to webgpu.h
This is the first step in making the API before WGPUDevice creation match webgpu.h and is necessary to implement WGPUSwapChain. BUG=dawn:269 Change-Id: If92ced42d7683d79e67c02738949ff8b483d22c4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14061 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
e6441b604f
commit
5fc2c82c11
@@ -80,12 +80,14 @@ namespace dawn_native {
|
||||
|
||||
// Instance
|
||||
|
||||
Instance::Instance() : mImpl(new InstanceBase()) {
|
||||
Instance::Instance() : mImpl(InstanceBase::Create()) {
|
||||
}
|
||||
|
||||
Instance::~Instance() {
|
||||
delete mImpl;
|
||||
mImpl = nullptr;
|
||||
if (mImpl != nullptr) {
|
||||
mImpl->Release();
|
||||
mImpl = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Instance::DiscoverDefaultAdapters() {
|
||||
@@ -121,6 +123,10 @@ namespace dawn_native {
|
||||
mImpl->SetPlatform(platform);
|
||||
}
|
||||
|
||||
WGPUInstance Instance::Get() const {
|
||||
return reinterpret_cast<WGPUInstance>(mImpl);
|
||||
}
|
||||
|
||||
size_t GetLazyClearCountForTesting(WGPUDevice device) {
|
||||
dawn_native::DeviceBase* deviceBase = reinterpret_cast<dawn_native::DeviceBase*>(device);
|
||||
return deviceBase->GetLazyClearCountForTesting();
|
||||
|
||||
Reference in New Issue
Block a user