Declare nextInChain as ChainedStructOut when extensible is out
This patch changes the type of the structure member nextInChain in AdapterProperties and SupportedLimits as "ChainedStructOut *" instead of "ChainedStruct * const" as all members of these structures should be writable when they are used as the outputs of Dawn APIs. Bug: dawn:1516 Change-Id: I185a0b5846ac6009717ac722df67bf7170354947 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101802 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
278f071c68
commit
1b02102e2b
|
@ -49,9 +49,15 @@ namespace {{native_namespace}} {
|
||||||
{{namespace}}::SType sType = {{namespace}}::SType::Invalid;
|
{{namespace}}::SType sType = {{namespace}}::SType::Invalid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ChainedStructOut {
|
||||||
|
ChainedStructOut * nextInChain = nullptr;
|
||||||
|
{{namespace}}::SType sType = {{namespace}}::SType::Invalid;
|
||||||
|
};
|
||||||
|
|
||||||
{% for type in by_category["structure"] %}
|
{% for type in by_category["structure"] %}
|
||||||
{% if type.chained %}
|
{% if type.chained %}
|
||||||
struct {{as_cppType(type.name)}} : ChainedStruct {
|
{% set chainedStructType = "ChainedStructOut" if type.chained == "out" else "ChainedStruct" %}
|
||||||
|
struct {{as_cppType(type.name)}} : {{chainedStructType}} {
|
||||||
{{as_cppType(type.name)}}() {
|
{{as_cppType(type.name)}}() {
|
||||||
sType = {{namespace}}::SType::{{type.name.CamelCase()}};
|
sType = {{namespace}}::SType::{{type.name.CamelCase()}};
|
||||||
}
|
}
|
||||||
|
@ -59,7 +65,8 @@ namespace {{native_namespace}} {
|
||||||
struct {{as_cppType(type.name)}} {
|
struct {{as_cppType(type.name)}} {
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if type.extensible %}
|
{% if type.extensible %}
|
||||||
ChainedStruct const * nextInChain = nullptr;
|
{% set chainedStructType = "ChainedStructOut" if type.output else "ChainedStruct const" %}
|
||||||
|
{{chainedStructType}} * nextInChain = nullptr;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for member in type.members %}
|
{% for member in type.members %}
|
||||||
{% set member_declaration = as_annotated_frontendType(member) + render_cpp_default_value(member) %}
|
{% set member_declaration = as_annotated_frontendType(member) + render_cpp_default_value(member) %}
|
||||||
|
|
Loading…
Reference in New Issue