mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
Add basic or stub implementations of upstream instance/adapter APIs
Adds upstream instance/adapter APIs. In dawn_native, the basic APIs to get limits and properties are implemented, but requestAdapter and requestDevice are not. In dawn_wire, nothing is implemented, but the stub definitions are put in place, as well the mechanism to inject WGPUInstance into the wire. There is a lifetime concern with WGPUInstance and WGPUAdapter on the wire in that we need to ensure that the client cannot free the instance or adapter while they are in use. In the near term, this is not a problem because Chromium will always hold ownership of the instance and adapters outside of the wire - i.e. it won't inject and then release ownership. Bug: dawn:160, dawn:689 Change-Id: Id904272983f23babc9177bc163d78c4fa1044da0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71520 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "dawn/webgpu_cpp.h"
|
||||
#include "dawn_native/DawnNative.h"
|
||||
|
||||
namespace dawn_native {
|
||||
@@ -50,6 +51,7 @@ namespace dawn_native {
|
||||
|
||||
void EnableFeature(Feature feature);
|
||||
bool IsEnabled(Feature feature) const;
|
||||
bool IsEnabled(wgpu::FeatureName feature) const;
|
||||
std::vector<const char*> GetEnabledFeatureNames() const;
|
||||
void InitializeDeviceProperties(WGPUDeviceProperties* properties) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user