From 72ef43b96965e18ffe56a4b06dcee009191fcdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20G=2E=20Chajdas?= Date: Mon, 21 Aug 2017 11:27:57 +0200 Subject: [PATCH] Add a new Uuid type to store unique identifiers. --- renderdoc/api/replay/data_types.h | 16 ++++++++++++++++ renderdoc/core/replay_proxy.cpp | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 241e02514..32fe2b88b 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -878,6 +878,22 @@ with software rendering, or with some functionality disabled due to lack of supp DECLARE_REFLECTION_STRUCT(APIProperties); +DOCUMENT("A 128-bit Uuid.") +struct Uuid +{ + Uuid(uint32_t a, uint32_t b, uint32_t c, uint32_t d) + { + bytes[0] = a; + bytes[1] = b; + bytes[2] = c; + bytes[3] = d; + } + + Uuid() { bytes[0] = bytes[1] = bytes[2] = bytes[3] = 0; } + DOCUMENT("The Uuid bytes.") + uint32_t bytes[4]; +}; + DOCUMENT("Describes a GPU counter's purpose and result value."); struct CounterDescription { diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index 36de6e88d..2a5b8ddb5 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -1584,6 +1584,14 @@ void Serialiser::Serialise(const char *name, MeshFormat &el) SIZE_CHECK(88); } +template <> +void Serialiser::Serialise(const char *name, Uuid &el) +{ + SerialisePODArray<4>("", el.bytes); + + SIZE_CHECK(16); +} + template <> void Serialiser::Serialise(const char *name, CounterDescription &el) {