summaryrefslogtreecommitdiff
path: root/source/slang/slang-state-serialize.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-10-23 13:25:58 -0400
committerGitHub <noreply@github.com>2019-10-23 13:25:58 -0400
commit73dcec672a2be0082945b71fc7848d9be0233f56 (patch)
treeb628912a14463457c45d1f442be993dafe2b68be /source/slang/slang-state-serialize.h
parent85f858c6d1b91fd2ed89844aae7535a48e51a4c8 (diff)
Version information on repro binary format. (#1090)
* * Added semantic versioning and hashing test on repro data. * Added RiffSemanticVersion type * Fix linux build warning.
Diffstat (limited to 'source/slang/slang-state-serialize.h')
-rw-r--r--source/slang/slang-state-serialize.h21
1 files changed, 12 insertions, 9 deletions
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<OutputState> outputStates;
};
- struct FileReference
- {
- Relative32Ptr<RelativeString> name;
- Relative32Ptr<FileState> file;
- };
-
struct StringPair
{
Relative32Ptr<RelativeString> first;