mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +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:
@@ -140,7 +140,7 @@ namespace {{metadata.namespace}} {
|
||||
};
|
||||
|
||||
{% macro render_cpp_default_value(member, is_struct=True) -%}
|
||||
{%- if member.annotation in ["*", "const*"] and member.optional -%}
|
||||
{%- if member.annotation in ["*", "const*"] and member.optional or member.default_value == "nullptr" -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category == "object" and member.optional and is_struct -%}
|
||||
{{" "}}= nullptr
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
namespace dawn_native {
|
||||
|
||||
{% macro render_cpp_default_value(member) -%}
|
||||
{%- if member.annotation in ["*", "const*"] and member.optional -%}
|
||||
{%- if member.annotation in ["*", "const*"] and member.optional or member.default_value == "nullptr" -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category == "object" and member.optional -%}
|
||||
{{" "}}= nullptr
|
||||
|
||||
Reference in New Issue
Block a user