Fix RPDesc::occlusionQuerySet not defaulting to nullptr
The default value for optional object structure members wasn't set correctly for C++ structures. Bug: dawn:22 Change-Id: I09e7f3675f6e0b5990ddcf03601b3b91cd25f553 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31200 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Shaobo Yan <shaobo.yan@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
dbc916c6f6
commit
b0789fde61
|
@ -644,7 +644,7 @@
|
|||
"name": "create swap chain",
|
||||
"returns": "swap chain",
|
||||
"args": [
|
||||
{"name": "surface", "type": "surface", "optional": "true"},
|
||||
{"name": "surface", "type": "surface"},
|
||||
{"name": "descriptor", "type": "swap chain descriptor", "annotation": "const*"}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace dawn_native {
|
|||
{% macro render_cpp_default_value(member) -%}
|
||||
{%- if member.annotation in ["*", "const*", "const*const*"] and member.optional -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category == "object" and member.optional -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category in ["enum", "bitmask"] and member.default_value != None -%}
|
||||
{{" "}}= wgpu::{{as_cppType(member.type.name)}}::{{as_cppEnum(Name(member.default_value))}}
|
||||
{%- elif member.type.category == "native" and member.default_value != None -%}
|
||||
|
|
|
@ -143,6 +143,8 @@ namespace wgpu {
|
|||
{% macro render_cpp_default_value(member) -%}
|
||||
{%- if member.annotation in ["*", "const*", "const*const*"] and member.optional -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category == "object" and member.optional -%}
|
||||
{{" "}}= nullptr
|
||||
{%- elif member.type.category in ["enum", "bitmask"] and member.default_value != None -%}
|
||||
{{" "}}= {{as_cppType(member.type.name)}}::{{as_cppEnum(Name(member.default_value))}}
|
||||
{%- elif member.type.category == "native" and member.default_value != None -%}
|
||||
|
|
Loading…
Reference in New Issue