Fixes a crash on macOS when calling (some?) extensible getters (e.g. Adapter.properties). It seems to work fine on Windows without this patch, maybe Swift runtime does something differently on other platforms, not sure.
Extensible getters create the associated C struct (e.g. WGPUAdapterProperties), but it does not reset their nextInChain property to nil, so Dawn crashes thinking that it's pointing to some real thing.
According to Xcode docs, Swift will zero all values after allocating an imported C struct, but apparently it doesn't always do that.
Fixes a crash on macOS when calling (some?) extensible getters (e.g.
Adapter.properties
). It seems to work fine on Windows without this patch, maybe Swift runtime does something differently on other platforms, not sure.Extensible getters create the associated C struct (e.g.
WGPUAdapterProperties
), but it does not reset theirnextInChain
property tonil
, so Dawn crashes thinking that it's pointing to some real thing.According to Xcode docs, Swift will zero all values after allocating an imported C struct, but apparently it doesn't always do that.