mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 15:46:28 +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
@@ -125,6 +125,12 @@ namespace wgpu {
|
||||
|
||||
{% endfor %}
|
||||
|
||||
Instance CreateInstance(const InstanceDescriptor* descriptor) {
|
||||
const WGPUInstanceDescriptor* cDescriptor =
|
||||
reinterpret_cast<const WGPUInstanceDescriptor*>(descriptor);
|
||||
return Instance::Acquire(wgpuCreateInstance(cDescriptor));
|
||||
}
|
||||
|
||||
Proc GetProcAddress(Device const& device, const char* procName) {
|
||||
return reinterpret_cast<Proc>(wgpuGetProcAddress(device.Get(), procName));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user