mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 03:11:29 +00:00
In the webgpu-headers PR it was decided that in the C header WGPUChainedStruct would be included as a member instead of members being inlined. See https://github.com/webgpu-native/webgpu-headers/pull/30 Bug: dawn:160 Change-Id: I8caf91f3106578077c80778621a632411da44423 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15441 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
47 lines
2.1 KiB
C++
47 lines
2.1 KiB
C++
//* Copyright 2018 The Dawn Authors
|
|
//*
|
|
//* Licensed under the Apache License, Version 2.0 (the "License");
|
|
//* you may not use this file except in compliance with the License.
|
|
//* You may obtain a copy of the License at
|
|
//*
|
|
//* http://www.apache.org/licenses/LICENSE-2.0
|
|
//*
|
|
//* Unless required by applicable law or agreed to in writing, software
|
|
//* distributed under the License is distributed on an "AS IS" BASIS,
|
|
//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
//* See the License for the specific language governing permissions and
|
|
//* limitations under the License.
|
|
|
|
#include "dawn_native/wgpu_structs_autogen.h"
|
|
|
|
namespace dawn_native {
|
|
|
|
static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct),
|
|
"sizeof mismatch for ChainedStruct");
|
|
static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct),
|
|
"alignof mismatch for ChainedStruct");
|
|
static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next),
|
|
"offsetof mismatch for ChainedStruct::nextInChain");
|
|
static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType),
|
|
"offsetof mismatch for ChainedStruct::sType");
|
|
|
|
{% for type in by_category["structure"] %}
|
|
{% set CppType = as_cppType(type.name) %}
|
|
{% set CType = as_cType(type.name) %}
|
|
|
|
static_assert(sizeof({{CppType}}) == sizeof({{CType}}), "sizeof mismatch for {{CppType}}");
|
|
static_assert(alignof({{CppType}}) == alignof({{CType}}), "alignof mismatch for {{CppType}}");
|
|
|
|
{% if type.extensible %}
|
|
static_assert(offsetof({{CppType}}, nextInChain) == offsetof({{CType}}, nextInChain),
|
|
"offsetof mismatch for {{CppType}}::nextInChain");
|
|
{% endif %}
|
|
{% for member in type.members %}
|
|
{% set memberName = member.name.camelCase() %}
|
|
static_assert(offsetof({{CppType}}, {{memberName}}) == offsetof({{CType}}, {{memberName}}),
|
|
"offsetof mismatch for {{CppType}}::{{memberName}}");
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
}
|