Use TINT_REFLECT for OverrideId
Adds tint_public_config to Dawn's internal config so Tint headers can be included. Fixed: dawn:1594 Change-Id: I4068fd95b6eae3138fbcc04f29f054c7cffdcf12 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111260 Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Shrek Shao <shrekshao@google.com> Commit-Queue: Austin Eng <enga@chromium.org> Kokoro: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
f9c6633006
commit
c982cd45c4
|
@ -18,11 +18,16 @@
|
|||
#include <stdint.h>
|
||||
#include <functional>
|
||||
|
||||
#include "src/tint/reflection.h"
|
||||
|
||||
namespace tint {
|
||||
|
||||
/// OverrideId is a numerical identifier for an override variable, unique per program.
|
||||
struct OverrideId {
|
||||
uint16_t value = 0;
|
||||
|
||||
/// Reflect the fields of this struct so that it can be used by tint::ForeachField()
|
||||
TINT_REFLECT(value);
|
||||
};
|
||||
|
||||
/// Equality operator for OverrideId
|
||||
|
|
|
@ -59,7 +59,10 @@ group("abseil") {
|
|||
}
|
||||
|
||||
config("internal") {
|
||||
configs = [ "${dawn_root}/src/dawn/common:internal_config" ]
|
||||
configs = [
|
||||
"${dawn_root}/src/dawn/common:internal_config",
|
||||
"${dawn_root}/src/tint:tint_public_config",
|
||||
]
|
||||
}
|
||||
|
||||
config("weak_framework") {
|
||||
|
|
|
@ -76,10 +76,7 @@ void stream::Stream<tint::transform::SubstituteOverride::Config>::Write(
|
|||
// static
|
||||
template <>
|
||||
void stream::Stream<tint::OverrideId>::Write(stream::Sink* sink, const tint::OverrideId& id) {
|
||||
// TODO(tint:1640): fix the include build issues and use StreamInTintObject instead.
|
||||
static_assert(offsetof(tint::OverrideId, value) == 0,
|
||||
"Please update serialization for tint::OverrideId");
|
||||
StreamIn(sink, id.value);
|
||||
StreamInTintObject(id, sink);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
Loading…
Reference in New Issue