mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-07 13:45:51 +00:00
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 <stdint.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
#include "src/tint/reflection.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
||||||
/// OverrideId is a numerical identifier for an override variable, unique per program.
|
/// OverrideId is a numerical identifier for an override variable, unique per program.
|
||||||
struct OverrideId {
|
struct OverrideId {
|
||||||
uint16_t value = 0;
|
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
|
/// Equality operator for OverrideId
|
||||||
|
@ -59,7 +59,10 @@ group("abseil") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config("internal") {
|
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") {
|
config("weak_framework") {
|
||||||
|
@ -76,10 +76,7 @@ void stream::Stream<tint::transform::SubstituteOverride::Config>::Write(
|
|||||||
// static
|
// static
|
||||||
template <>
|
template <>
|
||||||
void stream::Stream<tint::OverrideId>::Write(stream::Sink* sink, const tint::OverrideId& id) {
|
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.
|
StreamInTintObject(id, sink);
|
||||||
static_assert(offsetof(tint::OverrideId, value) == 0,
|
|
||||||
"Please update serialization for tint::OverrideId");
|
|
||||||
StreamIn(sink, id.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
Loading…
x
Reference in New Issue
Block a user