Adds To/FromAPI calls for wgpu (C++) namespace structs.
Note that the objects do not have them added in this change because they are a bit more complicated w.r.t whether we should add a refcount or not. Change-Id: Ie832e8923821d06d0dfcbd6a5bfdc9b2cb89dab5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119820 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Loko Kung <lokokung@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
e4039c76c7
commit
25669a6bd3
|
@ -48,6 +48,23 @@ namespace {{native_namespace}} {
|
||||||
inline {{as_cppType(type.name)}}* FromAPI({{as_cType(type.name)}}* rhs) {
|
inline {{as_cppType(type.name)}}* FromAPI({{as_cType(type.name)}}* rhs) {
|
||||||
return reinterpret_cast<{{as_cppType(type.name)}}*>(rhs);
|
return reinterpret_cast<{{as_cppType(type.name)}}*>(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const {{metadata.namespace}}::{{as_cppType(type.name)}}* ToCppAPI(const {{as_cppType(type.name)}}* rhs) {
|
||||||
|
return reinterpret_cast<const {{metadata.namespace}}::{{as_cppType(type.name)}}*>(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline {{metadata.namespace}}::{{as_cppType(type.name)}}* ToCppAPI({{as_cppType(type.name)}}* rhs) {
|
||||||
|
return reinterpret_cast<{{metadata.namespace}}::{{as_cppType(type.name)}}*>(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const {{as_cppType(type.name)}}* FromCppAPI(const {{metadata.namespace}}::{{as_cppType(type.name)}}* rhs) {
|
||||||
|
return reinterpret_cast<const {{as_cppType(type.name)}}*>(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline {{as_cppType(type.name)}}* FromCppAPI({{metadata.namespace}}::{{as_cppType(type.name)}}* rhs) {
|
||||||
|
return reinterpret_cast<{{as_cppType(type.name)}}*>(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for type in by_category["object"] %}
|
{% for type in by_category["object"] %}
|
||||||
|
@ -87,6 +104,6 @@ namespace {{native_namespace}} {
|
||||||
return static_cast<{{namespace}}::{{as_cppType(type.name)}}>(rhs);
|
return static_cast<{{namespace}}::{{as_cppType(type.name)}}>(rhs);
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
} // namespace {{native_namespace}}
|
||||||
|
|
||||||
#endif // {{NATIVE_DIR}}_{{PREFIX}}_PLATFORM_AUTOGEN_H_
|
#endif // {{NATIVE_DIR}}_{{PREFIX}}_PLATFORM_AUTOGEN_H_
|
||||||
|
|
Loading…
Reference in New Issue