From 73dcec672a2be0082945b71fc7848d9be0233f56 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 23 Oct 2019 13:25:58 -0400 Subject: Version information on repro binary format. (#1090) * * Added semantic versioning and hashing test on repro data. * Added RiffSemanticVersion type * Fix linux build warning. --- source/slang/slang-state-serialize.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'source/slang/slang-state-serialize.h') diff --git a/source/slang/slang-state-serialize.h b/source/slang/slang-state-serialize.h index dbd1e3992..42edd4080 100644 --- a/source/slang/slang-state-serialize.h +++ b/source/slang/slang-state-serialize.h @@ -16,12 +16,21 @@ namespace Slang { struct StateSerializeUtil { + enum + { + kMajorVersion = 0, + kMinorVersion = 0, + kPatchVersion = 0, + }; + static const uint32_t kSlangStateFourCC = SLANG_FOUR_CC('S', 'L', 'S', 'T'); ///< Holds all the slang specific chunks - + static const RiffSemanticVersion g_semanticVersion; + struct Header { - RiffChunk m_chunk; - uint32_t m_compressionType; ///< Holds the compression type used (if used at all) + RiffChunk m_chunk; ///< The chunk + RiffSemanticVersion m_semanticVersion; ///< The semantic version + uint32_t m_typeHash; ///< A hash based on the binary representation. If doesn't match then not binary compatible (extra check over semantic versioning) }; struct FileState @@ -73,12 +82,6 @@ struct StateSerializeUtil Relative32Array outputStates; }; - struct FileReference - { - Relative32Ptr name; - Relative32Ptr file; - }; - struct StringPair { Relative32Ptr first; -- cgit v1.2.3