From a63e99177da69b07d193ad345cbada9935e73cfa Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 27 Sep 2017 14:56:28 +0100 Subject: [PATCH] Add serialisation for public interface structs --- renderdoc/CMakeLists.txt | 1 + renderdoc/api/replay/capture_options.h | 2 + renderdoc/api/replay/data_types.h | 7 + renderdoc/api/replay/replay_enums.h | 85 +- renderdoc/api/replay/structured_data.h | 4 +- renderdoc/core/core.cpp | 2 + renderdoc/core/core.h | 2 + renderdoc/renderdoc.vcxproj | 1 + renderdoc/renderdoc.vcxproj.filters | 3 + renderdoc/replay/renderdoc_serialise.inl | 2269 ++++++++++++++++++++++ 10 files changed, 2374 insertions(+), 2 deletions(-) create mode 100644 renderdoc/replay/renderdoc_serialise.inl diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt index 987a16a8f..91a40e286 100644 --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt @@ -114,6 +114,7 @@ set(sources replay/app_api.cpp replay/basic_types_tests.cpp replay/capture_options.cpp + replay/renderdoc_serialise.inl replay/capture_file.cpp replay/entry_points.cpp replay/replay_driver.cpp diff --git a/renderdoc/api/replay/capture_options.h b/renderdoc/api/replay/capture_options.h index a7386d868..92be74ea8 100644 --- a/renderdoc/api/replay/capture_options.h +++ b/renderdoc/api/replay/capture_options.h @@ -177,3 +177,5 @@ Default - enabled )"); bool DebugOutputMute; }; + +DECLARE_REFLECTION_STRUCT(CaptureOptions); diff --git a/renderdoc/api/replay/data_types.h b/renderdoc/api/replay/data_types.h index 35d679e59..5c97cb466 100644 --- a/renderdoc/api/replay/data_types.h +++ b/renderdoc/api/replay/data_types.h @@ -145,6 +145,8 @@ struct TextureFilter FilterFunc func = FilterFunc::Normal; }; +DECLARE_REFLECTION_STRUCT(TextureFilter); + DOCUMENT("A description of a buffer resource."); struct BufferDescription { @@ -300,6 +302,7 @@ enum class BucketRecordType : int Linear, Pow2, }; +DECLARE_REFLECTION_ENUM(BucketRecordType); DOCUMENT(R"(Contains the statistics for constant binds in a frame. @@ -907,6 +910,8 @@ struct Uuid uint32_t bytes[4]; }; +DECLARE_REFLECTION_STRUCT(Uuid); + DOCUMENT("Describes a GPU counter's purpose and result value."); struct CounterDescription { @@ -956,6 +961,8 @@ union CounterValue uint64_t u64; }; +DECLARE_REFLECTION_STRUCT(CounterValue); + DOCUMENT("The resulting value from a counter at an event."); struct CounterResult { diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 49f49cec2..6f20aa95d 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -69,6 +69,7 @@ enum class PathProperty : uint32_t }; BITMASK_OPERATORS(PathProperty); +DECLARE_REFLECTION_ENUM(PathProperty); // replay_shader.h @@ -103,6 +104,8 @@ enum class VarType : uint32_t Unknown = ~0U, }; +DECLARE_REFLECTION_ENUM(VarType); + DOCUMENT(R"(Represents the component type of a channel in a texture or element in a structure. .. data:: Typeless @@ -174,6 +177,8 @@ enum class CompType : uint8_t Double, }; +DECLARE_REFLECTION_ENUM(CompType); + DOCUMENT(R"(A single source component for a destination texture swizzle. .. data:: Red @@ -210,6 +215,8 @@ enum class TextureSwizzle : uint32_t One, }; +DECLARE_REFLECTION_ENUM(TextureSwizzle); + DOCUMENT(R"(A texture addressing mode in a single direction (U,V or W). .. data:: Wrap @@ -243,6 +250,8 @@ enum class AddressMode : uint32_t ClampBorder, }; +DECLARE_REFLECTION_ENUM(AddressMode); + DOCUMENT(R"(The dimensionality of a texture binding. .. data:: Unknown @@ -312,6 +321,7 @@ enum class TextureDim : uint32_t }; ITERABLE_OPERATORS(TextureDim); +DECLARE_REFLECTION_ENUM(TextureDim); DOCUMENT(R"(The type of a shader resource bind. @@ -374,6 +384,8 @@ enum class BindType : uint32_t InputAttachment, }; +DECLARE_REFLECTION_ENUM(BindType); + DOCUMENT2(R"(Annotates a particular built-in input or output from a shader with a special meaning to the hardware or API. @@ -584,6 +596,7 @@ enum class ShaderBuiltin : uint32_t }; ITERABLE_OPERATORS(ShaderBuiltin); +DECLARE_REFLECTION_ENUM(ShaderBuiltin); // replay_render.h @@ -609,6 +622,8 @@ enum class ReplayOutputType : uint32_t Mesh, }; +DECLARE_REFLECTION_ENUM(ReplayOutputType); + DOCUMENT(R"(Describes a particular stage in the geometry transformation pipeline. .. data:: Unknown @@ -637,6 +652,8 @@ enum class MeshDataStage : uint32_t GSOut, }; +DECLARE_REFLECTION_ENUM(MeshDataStage); + DOCUMENT(R"(The type of overlay image to render on top of an existing texture view, for debugging purposes. @@ -763,6 +780,8 @@ enum class DebugOverlay : uint32_t TriangleSizeDraw, }; +DECLARE_REFLECTION_ENUM(DebugOverlay); + DOCUMENT(R"(The format of an image file .. data:: DDS @@ -807,6 +826,7 @@ enum class FileType : uint32_t }; ITERABLE_OPERATORS(FileType); +DECLARE_REFLECTION_ENUM(FileType); DOCUMENT(R"(What to do with the alpha channel from a texture while saving out to a file. @@ -839,6 +859,7 @@ enum class AlphaMapping : uint32_t }; ITERABLE_OPERATORS(AlphaMapping); +DECLARE_REFLECTION_ENUM(AlphaMapping); DOCUMENT(R"(A resource format's particular type. This accounts for either block-compressed textures or formats that don't have equal byte-multiple sizes for each channel. @@ -1011,6 +1032,8 @@ enum class ResourceFormatType : uint8_t PVRTC, }; +DECLARE_REFLECTION_ENUM(ResourceFormatType); + DOCUMENT(R"(An API specific hint for a certain behaviour. A legacy concept in OpenGL that controls hints to the implementation where there is room for interpretation within the range of valid behaviour. @@ -1034,6 +1057,8 @@ enum class QualityHint : uint32_t Fastest, }; +DECLARE_REFLECTION_ENUM(QualityHint); + DOCUMENT(R"(Identifies a Graphics API. .. data:: D3D11 @@ -1061,6 +1086,8 @@ enum class GraphicsAPI : uint32_t Vulkan, }; +DECLARE_REFLECTION_ENUM(GraphicsAPI); + DOCUMENT(R"(Check if an API is D3D or not :param GraphicsAPI api: The graphics API in question @@ -1303,6 +1330,8 @@ enum class Topology : uint32_t PatchList_32CPs, }; +DECLARE_REFLECTION_ENUM(Topology); + DOCUMENT(R"(Return the patch list ``Topology`` with N control points ``N`` must be between 1 and 32 inclusive. @@ -1381,6 +1410,7 @@ enum class BufferCategory : uint32_t }; BITMASK_OPERATORS(BufferCategory); +DECLARE_REFLECTION_ENUM(BufferCategory); DOCUMENT(R"(A set of flags for D3D buffer view properties. @@ -1409,6 +1439,7 @@ enum class D3DBufferViewFlags : uint32_t }; BITMASK_OPERATORS(D3DBufferViewFlags); +DECLARE_REFLECTION_ENUM(D3DBufferViewFlags); DOCUMENT(R"(A set of flags describing how this texture may be used @@ -1447,6 +1478,7 @@ enum class TextureCategory : uint32_t }; BITMASK_OPERATORS(TextureCategory); +DECLARE_REFLECTION_ENUM(TextureCategory); DOCUMENT(R"(The stage in a pipeline where a shader runs @@ -1508,6 +1540,7 @@ enum class ShaderStage : uint32_t }; ITERABLE_OPERATORS(ShaderStage); +DECLARE_REFLECTION_ENUM(ShaderStage); template constexpr inline ShaderStage StageFromIndex(integer stage) @@ -1577,6 +1610,7 @@ enum class ShaderStageMask : uint32_t }; BITMASK_OPERATORS(ShaderStageMask); +DECLARE_REFLECTION_ENUM(ShaderStageMask); DOCUMENT(R"(Calculate the corresponding flag for a shader stage @@ -1611,6 +1645,7 @@ enum class ShaderEvents : uint32_t }; BITMASK_OPERATORS(ShaderEvents); +DECLARE_REFLECTION_ENUM(ShaderEvents); DOCUMENT(R"(The type of issue that a debug message is about. @@ -1693,6 +1728,8 @@ enum class MessageCategory : uint32_t Performance, }; +DECLARE_REFLECTION_ENUM(MessageCategory); + DOCUMENT(R"(How serious a debug message is .. data:: High @@ -1719,6 +1756,8 @@ enum class MessageSeverity : uint32_t Info, }; +DECLARE_REFLECTION_ENUM(MessageSeverity); + DOCUMENT(R"(Where a debug message was reported from .. data:: API @@ -1767,6 +1806,8 @@ enum class MessageSource : uint32_t UnsupportedConfiguration, }; +DECLARE_REFLECTION_ENUM(MessageSource); + DOCUMENT(R"(How a resource is being used in the pipeline at a particular point. Note that a resource may be used for more than one thing in one event, see :class:`EventUsage`. @@ -1992,6 +2033,8 @@ enum class ResourceUsage : uint32_t Barrier, }; +DECLARE_REFLECTION_ENUM(ResourceUsage); + template constexpr inline ResourceUsage CBUsage(integer stage) { @@ -2181,6 +2224,7 @@ enum class DrawFlags : uint32_t }; BITMASK_OPERATORS(DrawFlags); +DECLARE_REFLECTION_ENUM(DrawFlags); DOCUMENT(R"(What kind of solid shading to use when rendering a mesh. @@ -2210,6 +2254,8 @@ enum class SolidShade : uint32_t Count, }; +DECLARE_REFLECTION_ENUM(SolidShade); + DOCUMENT(R"(The fill mode for polygons. .. data:: Solid @@ -2231,6 +2277,8 @@ enum class FillMode : uint32_t Point, }; +DECLARE_REFLECTION_ENUM(FillMode); + DOCUMENT(R"(The culling mode for polygons. .. data:: NoCull @@ -2257,6 +2305,8 @@ enum class CullMode : uint32_t FrontAndBack, }; +DECLARE_REFLECTION_ENUM(CullMode); + DOCUMENT(R"(The texture filtering mode for a given direction (minification, magnification, or between mips). @@ -2290,6 +2340,8 @@ enum class FilterMode : uint32_t Anisotropic, }; +DECLARE_REFLECTION_ENUM(FilterMode); + DOCUMENT(R"(The function used to process the returned value after interpolation. .. data:: Normal @@ -2323,6 +2375,8 @@ enum class FilterFunc : uint32_t Maximum, }; +DECLARE_REFLECTION_ENUM(FilterFunc); + DOCUMENT(R"(A comparison function to return a ``bool`` result from two inputs ``A`` and ``B``. .. data:: Never @@ -2370,6 +2424,8 @@ enum class CompareFunc : uint32_t NotEqual, }; +DECLARE_REFLECTION_ENUM(CompareFunc); + DOCUMENT(R"(A stencil operation to apply in stencil processing. .. data:: Keep @@ -2416,6 +2472,8 @@ enum class StencilOp : uint32_t Invert, }; +DECLARE_REFLECTION_ENUM(StencilOp); + DOCUMENT(R"(A multiplier on one component in the blend equation. .. note:: The "source" value is the value written out by the shader. @@ -2531,6 +2589,8 @@ enum class BlendMultiplier : uint32_t InvSrc1Alpha, }; +DECLARE_REFLECTION_ENUM(BlendMultiplier); + DOCUMENT(R"(A blending operation to apply in colour blending. .. note:: The "source" value is the value written out by the shader. @@ -2568,6 +2628,8 @@ enum class BlendOp : uint32_t Maximum, }; +DECLARE_REFLECTION_ENUM(BlendOp); + DOCUMENT(R"(A logical operation to apply when writing texture values to an output. .. note:: The "source" value is the value written out by the shader. @@ -2663,6 +2725,8 @@ enum class LogicOp : uint32_t OrInverted, }; +DECLARE_REFLECTION_ENUM(LogicOp); + DOCUMENT(R"(Pre-defined GPU counters that can be supported by a given implementation. GPU counters actually available can be queried by :meth:`ReplayController.EnumerateCounters`. If any @@ -2792,6 +2856,7 @@ enum class GPUCounter : uint32_t }; ITERABLE_OPERATORS(GPUCounter); +DECLARE_REFLECTION_ENUM(GPUCounter); DOCUMENT(R"(Check whether or not this is an AMD private counter. @@ -2862,6 +2927,8 @@ enum class CounterUnit : uint32_t Cycles, }; +DECLARE_REFLECTION_ENUM(CounterUnit); + DOCUMENT(R"(The type of camera controls for an :class:`Camera`. .. data:: Arcball @@ -2878,6 +2945,8 @@ enum class CameraType : uint32_t FPSLook, }; +DECLARE_REFLECTION_ENUM(CameraType); + DOCUMENT(R"(How supported a given API is on a particular replay instance. .. data:: Unsupported @@ -2900,6 +2969,8 @@ enum class ReplaySupport : uint32_t SuggestRemote, }; +DECLARE_REFLECTION_ENUM(ReplaySupport); + DOCUMENT(R"(The status of a high-level replay operation such as opening a capture or connecting to a remote server. @@ -2992,6 +3063,8 @@ enum class ReplayStatus : uint32_t APIHardwareUnsupported, }; +DECLARE_REFLECTION_ENUM(ReplayStatus); + DOCUMENT(R"(The type of message received from or sent to an application target control connection. .. data:: Unknown @@ -3038,6 +3111,8 @@ enum class TargetControlMessageType : uint32_t NewChild, }; +DECLARE_REFLECTION_ENUM(TargetControlMessageType); + DOCUMENT(R"(How to modify an environment variable. .. data:: Set @@ -3059,6 +3134,8 @@ enum class EnvMod : uint32_t Prepend, }; +DECLARE_REFLECTION_ENUM(EnvMod); + DOCUMENT(R"(The separator to use if needed when modifying an environment variable. .. data:: Platform @@ -3088,6 +3165,8 @@ enum class EnvSep : uint32_t NoSep, }; +DECLARE_REFLECTION_ENUM(EnvSep); + DOCUMENT(R"(The type of a log message .. data:: Debug @@ -3120,6 +3199,8 @@ enum class LogType : int32_t Count, }; +DECLARE_REFLECTION_ENUM(LogType); + DOCUMENT(R"(A set of flags giving details of the current status of vulkan layer registration. .. data:: NoFlags @@ -3170,6 +3251,7 @@ enum class VulkanLayerFlags : uint32_t }; BITMASK_OPERATORS(VulkanLayerFlags); +DECLARE_REFLECTION_ENUM(VulkanLayerFlags); DOCUMENT(R"(A set of flags giving details of the current status of Android tracability. @@ -3210,4 +3292,5 @@ enum class AndroidFlags : uint32_t Unfixable = 0x10, }; -BITMASK_OPERATORS(AndroidFlags); \ No newline at end of file +BITMASK_OPERATORS(AndroidFlags); +DECLARE_REFLECTION_ENUM(AndroidFlags); \ No newline at end of file diff --git a/renderdoc/api/replay/structured_data.h b/renderdoc/api/replay/structured_data.h index f7d3064e1..d8930124e 100644 --- a/renderdoc/api/replay/structured_data.h +++ b/renderdoc/api/replay/structured_data.h @@ -98,7 +98,7 @@ enum class SDBasic : uint32_t Character, }; -DECLARE_STRINGISE_TYPE(SDBasic); +DECLARE_REFLECTION_ENUM(SDBasic); DOCUMENT(R"(Bitfield flags that could be applied to a type. @@ -135,6 +135,7 @@ enum class SDTypeFlags : uint32_t }; BITMASK_OPERATORS(SDTypeFlags); +DECLARE_REFLECTION_ENUM(SDTypeFlags); struct SDObject; struct SDChunk; @@ -195,6 +196,7 @@ enum class SDChunkFlags : uint64_t }; BITMASK_OPERATORS(SDChunkFlags); +DECLARE_REFLECTION_ENUM(SDChunkFlags); DOCUMENT("The metadata that goes along with a :class:`SDChunk` to detail how it was recorded."); struct SDChunkMetaData diff --git a/renderdoc/core/core.cpp b/renderdoc/core/core.cpp index 13b6b60e3..5d8e0f815 100644 --- a/renderdoc/core/core.cpp +++ b/renderdoc/core/core.cpp @@ -38,6 +38,8 @@ #include "api/replay/renderdoc_tostr.inl" +#include "replay/renderdoc_serialise.inl" + template <> std::string DoStringise(const ResourceId &el) { diff --git a/renderdoc/core/core.h b/renderdoc/core/core.h index 4e4fbeaef..4fc101998 100644 --- a/renderdoc/core/core.h +++ b/renderdoc/core/core.h @@ -123,6 +123,8 @@ enum RDCDriver RDC_Custom9, }; +DECLARE_REFLECTION_ENUM(RDCDriver); + namespace DXBC { class DXBCFile; diff --git a/renderdoc/renderdoc.vcxproj b/renderdoc/renderdoc.vcxproj index b2f95a02a..2a1f3e737 100644 --- a/renderdoc/renderdoc.vcxproj +++ b/renderdoc/renderdoc.vcxproj @@ -443,6 +443,7 @@ + diff --git a/renderdoc/renderdoc.vcxproj.filters b/renderdoc/renderdoc.vcxproj.filters index 8a359dce0..2cb99ccfd 100644 --- a/renderdoc/renderdoc.vcxproj.filters +++ b/renderdoc/renderdoc.vcxproj.filters @@ -724,6 +724,9 @@ API\Replay + + Replay + diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl new file mode 100644 index 000000000..c37edcdc6 --- /dev/null +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -0,0 +1,2269 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +// these macros do compile time asserts on the size of the structure, to +// help prevent the structure changing without these functions being updated. +// This isn't perfect as a new variable could be added in padding space, or +// one removed and leaves padding. Most variables are 4 bytes in size though +// so it should be fairly reliable and it's better than nothing! +// Since structures contain pointers and vary in size, we do this only on +// x64 since that's the commonly built target. + +#ifndef ENABLED +#define ENABLED(...) 0 +#endif + +#if ENABLED(RDOC_WIN32) && ENABLED(RDOC_X64) && ENABLED(RDOC_DEVEL) +template +class oversized +{ + int check[int(actual) - int(expected) + 1]; +}; +template +class undersized +{ + int check[int(expected) - int(actual) + 1]; +}; + +#define SIZE_CHECK(expected) \ + undersized(); \ + oversized(); +#else +#define SIZE_CHECK(expected) +#endif + +template +void DoSerialise(SerialiserType &ser, PathEntry &el) +{ + SERIALISE_MEMBER(filename); + SERIALISE_MEMBER(flags); + SERIALISE_MEMBER(lastmod); + SERIALISE_MEMBER(size); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, EnvironmentModification &el) +{ + SERIALISE_MEMBER(mod); + SERIALISE_MEMBER(sep); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(value); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, CaptureOptions &el) +{ + SERIALISE_MEMBER(AllowVSync); + SERIALISE_MEMBER(AllowFullscreen); + SERIALISE_MEMBER(APIValidation); + SERIALISE_MEMBER(CaptureCallstacks); + SERIALISE_MEMBER(CaptureCallstacksOnlyDraws); + SERIALISE_MEMBER(DelayForDebugger); + SERIALISE_MEMBER(VerifyMapWrites); + SERIALISE_MEMBER(HookIntoChildren); + SERIALISE_MEMBER(RefAllResources); + SERIALISE_MEMBER(SaveAllInitials); + SERIALISE_MEMBER(CaptureAllCmdLists); + SERIALISE_MEMBER(DebugOutputMute); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, ResourceFormat &el) +{ + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(compCount); + SERIALISE_MEMBER(compByteWidth); + SERIALISE_MEMBER(compType); + SERIALISE_MEMBER(bgraOrder); + SERIALISE_MEMBER(srgbCorrected); + + SIZE_CHECK(6); +} + +template +void DoSerialise(SerialiserType &ser, BindpointMap &el) +{ + SERIALISE_MEMBER(bindset); + SERIALISE_MEMBER(bind); + SERIALISE_MEMBER(used); + SERIALISE_MEMBER(arraySize); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, ShaderBindpointMapping &el) +{ + SERIALISE_MEMBER(InputAttributes); + SERIALISE_MEMBER(ConstantBlocks); + SERIALISE_MEMBER(Samplers); + SERIALISE_MEMBER(ReadOnlyResources); + SERIALISE_MEMBER(ReadWriteResources); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, SigParameter &el) +{ + SERIALISE_MEMBER(varName); + SERIALISE_MEMBER(semanticName); + SERIALISE_MEMBER(semanticIndex); + SERIALISE_MEMBER(semanticIdxName); + SERIALISE_MEMBER(needSemanticIndex); + SERIALISE_MEMBER(regIndex); + SERIALISE_MEMBER(systemValue); + SERIALISE_MEMBER(compType); + SERIALISE_MEMBER(regChannelMask); + SERIALISE_MEMBER(channelUsedMask); + SERIALISE_MEMBER(compCount); + SERIALISE_MEMBER(stream); + SERIALISE_MEMBER(arrayIndex); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, ShaderVariableType &el) +{ + SERIALISE_MEMBER(descriptor.name); + SERIALISE_MEMBER(descriptor.type); + SERIALISE_MEMBER(descriptor.rows); + SERIALISE_MEMBER(descriptor.cols); + SERIALISE_MEMBER(descriptor.elements); + SERIALISE_MEMBER(descriptor.rowMajorStorage); + SERIALISE_MEMBER(descriptor.arrayStride); + SERIALISE_MEMBER(members); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, ShaderConstant &el) +{ + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(reg.vec); + SERIALISE_MEMBER(reg.comp); + SERIALISE_MEMBER(defaultValue); + SERIALISE_MEMBER(type); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, ConstantBlock &el) +{ + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(variables); + SERIALISE_MEMBER(bufferBacked); + SERIALISE_MEMBER(bindPoint); + SERIALISE_MEMBER(byteSize); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, ShaderSampler &el) +{ + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(bindPoint); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, ShaderResource &el) +{ + SERIALISE_MEMBER(IsTexture); + SERIALISE_MEMBER(IsReadOnly); + SERIALISE_MEMBER(resType); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(variableType); + SERIALISE_MEMBER(bindPoint); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, ShaderCompileFlags &el) +{ + SERIALISE_MEMBER(flags); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, ShaderDebugChunk &el) +{ + SERIALISE_MEMBER(compileFlags); + SERIALISE_MEMBER(files); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, ShaderReflection &el) +{ + SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(EntryPoint); + + SERIALISE_MEMBER(DebugInfo); + + SERIALISE_MEMBER(DispatchThreadsDimension); + + SERIALISE_MEMBER(RawBytes); + + SERIALISE_MEMBER(InputSig); + SERIALISE_MEMBER(OutputSig); + + SERIALISE_MEMBER(ConstantBlocks); + + SERIALISE_MEMBER(Samplers); + + SERIALISE_MEMBER(ReadOnlyResources); + SERIALISE_MEMBER(ReadWriteResources); + + SERIALISE_MEMBER(Interfaces); + + SIZE_CHECK(200); +} + +template +void DoSerialise(SerialiserType &ser, ShaderVariable &el) +{ + SERIALISE_MEMBER(rows); + SERIALISE_MEMBER(columns); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(type); + + SERIALISE_MEMBER(value.dv); + + SERIALISE_MEMBER(isStruct); + + SERIALISE_MEMBER(members); + + SIZE_CHECK(184); +} + +template +void DoSerialise(SerialiserType &ser, ShaderDebugState &el) +{ + SERIALISE_MEMBER(registers); + SERIALISE_MEMBER(outputs); + SERIALISE_MEMBER(indexableTemps); + SERIALISE_MEMBER(nextInstruction); + SERIALISE_MEMBER(flags); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, ShaderDebugTrace &el) +{ + SERIALISE_MEMBER(inputs); + SERIALISE_MEMBER(cbuffers); + SERIALISE_MEMBER(states); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, TextureFilter &el) +{ + SERIALISE_MEMBER(minify); + SERIALISE_MEMBER(magnify); + SERIALISE_MEMBER(mip); + SERIALISE_MEMBER(func); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, TextureDescription &el) +{ + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(format); + SERIALISE_MEMBER(dimension); + SERIALISE_MEMBER(resType); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + SERIALISE_MEMBER(depth); + SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(cubemap); + SERIALISE_MEMBER(mips); + SERIALISE_MEMBER(arraysize); + SERIALISE_MEMBER(creationFlags); + SERIALISE_MEMBER(msQual); + SERIALISE_MEMBER(msSamp); + SERIALISE_MEMBER(byteSize); + + SIZE_CHECK(88); +} + +template +void DoSerialise(SerialiserType &ser, BufferDescription &el) +{ + SERIALISE_MEMBER(ID); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(creationFlags); + SERIALISE_MEMBER(length); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, APIProperties &el) +{ + SERIALISE_MEMBER(pipelineType); + SERIALISE_MEMBER(localRenderer); + SERIALISE_MEMBER(degraded); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, DebugMessage &el) +{ + SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(category); + SERIALISE_MEMBER(severity); + SERIALISE_MEMBER(source); + SERIALISE_MEMBER(messageID); + SERIALISE_MEMBER(description); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, APIEvent &el) +{ + SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(callstack); + SERIALISE_MEMBER(eventDesc); + SERIALISE_MEMBER(fileOffset); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, DrawcallDescription &el) +{ + SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(drawcallID); + + SERIALISE_MEMBER(name); + + SERIALISE_MEMBER(flags); + + SERIALISE_MEMBER(markerColor); + + SERIALISE_MEMBER(numIndices); + SERIALISE_MEMBER(numInstances); + SERIALISE_MEMBER(baseVertex); + SERIALISE_MEMBER(indexOffset); + SERIALISE_MEMBER(vertexOffset); + SERIALISE_MEMBER(instanceOffset); + + SERIALISE_MEMBER(dispatchDimension); + SERIALISE_MEMBER(dispatchThreadsDimension); + + SERIALISE_MEMBER(indexByteWidth); + SERIALISE_MEMBER(topology); + + SERIALISE_MEMBER(copySource); + SERIALISE_MEMBER(copyDestination); + + SERIALISE_MEMBER(parent); + SERIALISE_MEMBER(previous); + SERIALISE_MEMBER(next); + + SERIALISE_MEMBER(outputs); + SERIALISE_MEMBER(depthOut); + + SERIALISE_MEMBER(events); + SERIALISE_MEMBER(children); + + SIZE_CHECK(248); +} + +template +void DoSerialise(SerialiserType &ser, ConstantBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(bindslots); + SERIALISE_MEMBER(sizes); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, SamplerBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(bindslots); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, ResourceBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(types); + SERIALISE_MEMBER(bindslots); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, ResourceUpdateStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(clients); + SERIALISE_MEMBER(servers); + SERIALISE_MEMBER(types); + SERIALISE_MEMBER(sizes); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, DrawcallStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(instanced); + SERIALISE_MEMBER(indirect); + SERIALISE_MEMBER(counts); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, DispatchStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(indirect); + + SIZE_CHECK(8); +} + +template +void DoSerialise(SerialiserType &ser, IndexBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, VertexBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(bindslots); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, LayoutBindStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, ShaderChangeStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(redundants); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, BlendStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(redundants); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, DepthStencilStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(redundants); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, RasterizationStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(redundants); + SERIALISE_MEMBER(viewports); + SERIALISE_MEMBER(rects); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, OutputTargetStats &el) +{ + SERIALISE_MEMBER(calls); + SERIALISE_MEMBER(sets); + SERIALISE_MEMBER(nulls); + SERIALISE_MEMBER(bindslots); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, FrameStatistics &el) +{ + SERIALISE_MEMBER(recorded); + SERIALISE_MEMBER(constants); + SERIALISE_MEMBER(samplers); + SERIALISE_MEMBER(resources); + SERIALISE_MEMBER(updates); + SERIALISE_MEMBER(draws); + SERIALISE_MEMBER(dispatches); + SERIALISE_MEMBER(indices); + SERIALISE_MEMBER(vertices); + SERIALISE_MEMBER(layouts); + SERIALISE_MEMBER(shaders); + SERIALISE_MEMBER(blends); + SERIALISE_MEMBER(depths); + SERIALISE_MEMBER(rasters); + SERIALISE_MEMBER(outputs); + + SIZE_CHECK(1136); +} + +template +void DoSerialise(SerialiserType &ser, FrameDescription &el) +{ + SERIALISE_MEMBER(frameNumber); + SERIALISE_MEMBER(fileOffset); + SERIALISE_MEMBER(uncompressedFileSize); + SERIALISE_MEMBER(compressedFileSize); + SERIALISE_MEMBER(persistentSize); + SERIALISE_MEMBER(initDataSize); + SERIALISE_MEMBER(captureTime); + SERIALISE_MEMBER(stats); + SERIALISE_MEMBER(debugMessages); + + SIZE_CHECK(1208); +} + +template +void DoSerialise(SerialiserType &ser, FrameRecord &el) +{ + SERIALISE_MEMBER(frameInfo); + SERIALISE_MEMBER(drawcallList); + + SIZE_CHECK(1224); +} + +template +void DoSerialise(SerialiserType &ser, MeshFormat &el) +{ + SERIALISE_MEMBER(idxbuf); + SERIALISE_MEMBER(idxoffs); + SERIALISE_MEMBER(idxByteWidth); + SERIALISE_MEMBER(baseVertex); + SERIALISE_MEMBER(buf); + SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(stride); + SERIALISE_MEMBER(fmt); + SERIALISE_MEMBER(meshColor); + SERIALISE_MEMBER(showAlpha); + SERIALISE_MEMBER(topo); + SERIALISE_MEMBER(numVerts); + SERIALISE_MEMBER(unproject); + SERIALISE_MEMBER(nearPlane); + SERIALISE_MEMBER(farPlane); + + SIZE_CHECK(88); +} + +template +void DoSerialise(SerialiserType &ser, FloatVector &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(z); + SERIALISE_MEMBER(w); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, Uuid &el) +{ + SERIALISE_MEMBER(bytes); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, CounterDescription &el) +{ + SERIALISE_MEMBER(counterID); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(description); + SERIALISE_MEMBER(resultType); + SERIALISE_MEMBER(resultByteWidth); + SERIALISE_MEMBER(unit); + SERIALISE_MEMBER(category); + SERIALISE_MEMBER(uuid); + + SIZE_CHECK(88); +} + +template +void DoSerialise(SerialiserType &ser, PixelValue &el) +{ + SERIALISE_MEMBER(value_u); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, PixelModification &el) +{ + SERIALISE_MEMBER(eventID); + + SERIALISE_MEMBER(directShaderWrite); + SERIALISE_MEMBER(unboundPS); + + SERIALISE_MEMBER(fragIndex); + SERIALISE_MEMBER(primitiveID); + + SERIALISE_MEMBER(preMod.col.value_u); + SERIALISE_MEMBER(preMod.depth); + SERIALISE_MEMBER(preMod.stencil); + SERIALISE_MEMBER(shaderOut.col.value_u); + SERIALISE_MEMBER(shaderOut.depth); + SERIALISE_MEMBER(shaderOut.stencil); + SERIALISE_MEMBER(postMod.col.value_u); + SERIALISE_MEMBER(postMod.depth); + SERIALISE_MEMBER(postMod.stencil); + + SERIALISE_MEMBER(sampleMasked); + SERIALISE_MEMBER(backfaceCulled); + SERIALISE_MEMBER(depthClipped); + SERIALISE_MEMBER(viewClipped); + SERIALISE_MEMBER(scissorClipped); + SERIALISE_MEMBER(shaderDiscarded); + SERIALISE_MEMBER(depthTestFailed); + SERIALISE_MEMBER(stencilTestFailed); + + SIZE_CHECK(96); +} + +template +void DoSerialise(SerialiserType &ser, EventUsage &el) +{ + SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(usage); + SERIALISE_MEMBER(view); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, CounterResult &el) +{ + SERIALISE_MEMBER(eventID); + SERIALISE_MEMBER(counterID); + SERIALISE_MEMBER(value); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, CounterValue &el) +{ + SERIALISE_MEMBER(u64); + + SIZE_CHECK(8); +} + +#pragma region D3D11 pipeline state + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Layout &el) +{ + SERIALISE_MEMBER(SemanticName); + SERIALISE_MEMBER(SemanticIndex); + SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(InputSlot); + SERIALISE_MEMBER(ByteOffset); + SERIALISE_MEMBER(PerInstance); + SERIALISE_MEMBER(InstanceDataStepRate); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::VB &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Stride); + SERIALISE_MEMBER(Offset); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::IB &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::IA &el) +{ + SERIALISE_MEMBER(layouts); + SERIALISE_MEMBER(layout); + + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(name); + + SERIALISE_MEMBER(vbuffers); + SERIALISE_MEMBER(ibuffer); + + if(ser.IsReading()) + el.Bytecode = NULL; + + SIZE_CHECK(88); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::View &el) +{ + SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(Resource); + SERIALISE_MEMBER(Type); + SERIALISE_MEMBER(Format); + + SERIALISE_MEMBER(Structured); + SERIALISE_MEMBER(BufferStructCount); + SERIALISE_MEMBER(FirstElement); + SERIALISE_MEMBER(NumElements); + + SERIALISE_MEMBER(Flags); + SERIALISE_MEMBER(HighestMip); + SERIALISE_MEMBER(NumMipLevels); + SERIALISE_MEMBER(ArraySize); + SERIALISE_MEMBER(FirstArraySlice); + + SIZE_CHECK(64); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Sampler &el) +{ + SERIALISE_MEMBER(Samp); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(AddressU); + SERIALISE_MEMBER(AddressV); + SERIALISE_MEMBER(AddressW); + SERIALISE_MEMBER(BorderColor); + SERIALISE_MEMBER(Comparison); + SERIALISE_MEMBER(Filter); + SERIALISE_MEMBER(MaxAniso); + SERIALISE_MEMBER(MaxLOD); + SERIALISE_MEMBER(MinLOD); + SERIALISE_MEMBER(MipLODBias); + + SIZE_CHECK(96); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::CBuffer &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(VecOffset); + SERIALISE_MEMBER(VecCount); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Shader &el) +{ + SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(stage); + SERIALISE_MEMBER(SRVs); + SERIALISE_MEMBER(UAVs); + SERIALISE_MEMBER(Samplers); + SERIALISE_MEMBER(ConstantBuffers); + SERIALISE_MEMBER(ClassInstances); + + if(ser.IsReading()) + el.ShaderDetails = NULL; + SERIALISE_MEMBER(BindpointMapping); + + SIZE_CHECK(208); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::SOBind &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::SO &el) +{ + SERIALISE_MEMBER(Outputs); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Viewport &el) +{ + SERIALISE_MEMBER(X); + SERIALISE_MEMBER(Y); + SERIALISE_MEMBER(Width); + SERIALISE_MEMBER(Height); + SERIALISE_MEMBER(MinDepth); + SERIALISE_MEMBER(MaxDepth); + SERIALISE_MEMBER(Enabled); + + SIZE_CHECK(28); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Scissor &el) +{ + SERIALISE_MEMBER(left); + SERIALISE_MEMBER(top); + SERIALISE_MEMBER(right); + SERIALISE_MEMBER(bottom); + SERIALISE_MEMBER(Enabled); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::RasterizerState &el) +{ + SERIALISE_MEMBER(State); + SERIALISE_MEMBER(fillMode); + SERIALISE_MEMBER(cullMode); + SERIALISE_MEMBER(FrontCCW); + SERIALISE_MEMBER(DepthBias); + SERIALISE_MEMBER(DepthBiasClamp); + SERIALISE_MEMBER(SlopeScaledDepthBias); + SERIALISE_MEMBER(DepthClip); + SERIALISE_MEMBER(ScissorEnable); + SERIALISE_MEMBER(MultisampleEnable); + SERIALISE_MEMBER(AntialiasedLineEnable); + SERIALISE_MEMBER(ForcedSampleCount); + SERIALISE_MEMBER(ConservativeRasterization); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Rasterizer &el) +{ + SERIALISE_MEMBER(Viewports); + SERIALISE_MEMBER(Scissors); + SERIALISE_MEMBER(m_State); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::StencilFace &el) +{ + SERIALISE_MEMBER(FailOp); + SERIALISE_MEMBER(DepthFailOp); + SERIALISE_MEMBER(PassOp); + SERIALISE_MEMBER(Func); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::DepthStencilState &el) +{ + SERIALISE_MEMBER(State); + SERIALISE_MEMBER(DepthEnable); + SERIALISE_MEMBER(DepthFunc); + SERIALISE_MEMBER(DepthWrites); + SERIALISE_MEMBER(StencilEnable); + SERIALISE_MEMBER(StencilReadMask); + SERIALISE_MEMBER(StencilWriteMask); + SERIALISE_MEMBER(m_FrontFace); + SERIALISE_MEMBER(m_BackFace); + SERIALISE_MEMBER(StencilRef); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::BlendEquation &el) +{ + SERIALISE_MEMBER(Source); + SERIALISE_MEMBER(Destination); + SERIALISE_MEMBER(Operation); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::Blend &el) +{ + SERIALISE_MEMBER(m_Blend); + SERIALISE_MEMBER(m_AlphaBlend); + + SERIALISE_MEMBER(Logic); + + SERIALISE_MEMBER(Enabled); + SERIALISE_MEMBER(LogicEnabled); + SERIALISE_MEMBER(WriteMask); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::BlendState &el) +{ + SERIALISE_MEMBER(State); + SERIALISE_MEMBER(AlphaToCoverage); + SERIALISE_MEMBER(IndependentBlend); + SERIALISE_MEMBER(Blends); + SERIALISE_MEMBER(BlendFactor); + + SERIALISE_MEMBER(SampleMask); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::OM &el) +{ + SERIALISE_MEMBER(m_State); + SERIALISE_MEMBER(m_BlendState); + SERIALISE_MEMBER(RenderTargets); + SERIALISE_MEMBER(UAVStartSlot); + SERIALISE_MEMBER(UAVs); + SERIALISE_MEMBER(DepthTarget); + SERIALISE_MEMBER(DepthReadOnly); + SERIALISE_MEMBER(StencilReadOnly); + + SIZE_CHECK(224); +} + +template +void DoSerialise(SerialiserType &ser, D3D11Pipe::State &el) +{ + SERIALISE_MEMBER(m_IA); + + SERIALISE_MEMBER(m_VS); + SERIALISE_MEMBER(m_HS); + SERIALISE_MEMBER(m_DS); + SERIALISE_MEMBER(m_GS); + SERIALISE_MEMBER(m_PS); + SERIALISE_MEMBER(m_CS); + + SERIALISE_MEMBER(m_SO); + + SERIALISE_MEMBER(m_RS); + SERIALISE_MEMBER(m_OM); + + SIZE_CHECK(1656); +} + +#pragma endregion D3D11 pipeline state + +#pragma region D3D12 pipeline state + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Layout &el) +{ + SERIALISE_MEMBER(SemanticName); + SERIALISE_MEMBER(SemanticIndex); + SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(InputSlot); + SERIALISE_MEMBER(ByteOffset); + SERIALISE_MEMBER(PerInstance); + SERIALISE_MEMBER(InstanceDataStepRate); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::VB &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Size); + SERIALISE_MEMBER(Stride); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::IB &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Size); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::IA &el) +{ + SERIALISE_MEMBER(layouts); + SERIALISE_MEMBER(vbuffers); + SERIALISE_MEMBER(ibuffer); + + SERIALISE_MEMBER(indexStripCutValue); + + SIZE_CHECK(64); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::View &el) +{ + SERIALISE_MEMBER(Immediate); + SERIALISE_MEMBER(RootElement); + SERIALISE_MEMBER(TableIndex); + SERIALISE_MEMBER(Resource); + SERIALISE_MEMBER(Type); + SERIALISE_MEMBER(Format); + + SERIALISE_MEMBER(swizzle); + SERIALISE_MEMBER(BufferFlags); + SERIALISE_MEMBER(BufferStructCount); + SERIALISE_MEMBER(ElementSize); + SERIALISE_MEMBER(FirstElement); + SERIALISE_MEMBER(NumElements); + + SERIALISE_MEMBER(CounterResource); + SERIALISE_MEMBER(CounterByteOffset); + + SERIALISE_MEMBER(HighestMip); + SERIALISE_MEMBER(NumMipLevels); + SERIALISE_MEMBER(ArraySize); + SERIALISE_MEMBER(FirstArraySlice); + + SERIALISE_MEMBER(MinLODClamp); + + SIZE_CHECK(120); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Sampler &el) +{ + SERIALISE_MEMBER(Immediate); + SERIALISE_MEMBER(RootElement); + SERIALISE_MEMBER(TableIndex); + SERIALISE_MEMBER(AddressU); + SERIALISE_MEMBER(AddressV); + SERIALISE_MEMBER(AddressW); + SERIALISE_MEMBER(BorderColor); + SERIALISE_MEMBER(Comparison); + SERIALISE_MEMBER(Filter); + SERIALISE_MEMBER(MaxAniso); + SERIALISE_MEMBER(MaxLOD); + SERIALISE_MEMBER(MinLOD); + SERIALISE_MEMBER(MipLODBias); + + SIZE_CHECK(76); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::CBuffer &el) +{ + SERIALISE_MEMBER(Immediate); + SERIALISE_MEMBER(RootElement); + SERIALISE_MEMBER(TableIndex); + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(ByteSize); + SERIALISE_MEMBER(RootValues); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::RegisterSpace &el) +{ + SERIALISE_MEMBER(ConstantBuffers); + SERIALISE_MEMBER(Samplers); + SERIALISE_MEMBER(SRVs); + SERIALISE_MEMBER(UAVs); + + SIZE_CHECK(64); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Shader &el) +{ + SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(stage); + SERIALISE_MEMBER(Spaces); + + if(ser.IsReading()) + el.ShaderDetails = NULL; + SERIALISE_MEMBER(BindpointMapping); + + SIZE_CHECK(120); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::SOBind &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Size); + SERIALISE_MEMBER(WrittenCountBuffer); + SERIALISE_MEMBER(WrittenCountOffset); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Streamout &el) +{ + SERIALISE_MEMBER(Outputs); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Viewport &el) +{ + SERIALISE_MEMBER(X); + SERIALISE_MEMBER(Y); + SERIALISE_MEMBER(Width); + SERIALISE_MEMBER(Height); + SERIALISE_MEMBER(MinDepth); + SERIALISE_MEMBER(MaxDepth); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Scissor &el) +{ + SERIALISE_MEMBER(left); + SERIALISE_MEMBER(top); + SERIALISE_MEMBER(right); + SERIALISE_MEMBER(bottom); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::RasterizerState &el) +{ + SERIALISE_MEMBER(fillMode); + SERIALISE_MEMBER(cullMode); + SERIALISE_MEMBER(FrontCCW); + SERIALISE_MEMBER(DepthBias); + SERIALISE_MEMBER(DepthBiasClamp); + SERIALISE_MEMBER(SlopeScaledDepthBias); + SERIALISE_MEMBER(DepthClip); + SERIALISE_MEMBER(MultisampleEnable); + SERIALISE_MEMBER(AntialiasedLineEnable); + SERIALISE_MEMBER(ForcedSampleCount); + SERIALISE_MEMBER(ConservativeRasterization); + + SIZE_CHECK(36); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Rasterizer &el) +{ + SERIALISE_MEMBER(SampleMask); + SERIALISE_MEMBER(Viewports); + SERIALISE_MEMBER(Scissors); + SERIALISE_MEMBER(m_State); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::StencilFace &el) +{ + SERIALISE_MEMBER(FailOp); + SERIALISE_MEMBER(DepthFailOp); + SERIALISE_MEMBER(PassOp); + SERIALISE_MEMBER(Func); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::DepthStencilState &el) +{ + SERIALISE_MEMBER(DepthEnable); + SERIALISE_MEMBER(DepthWrites); + SERIALISE_MEMBER(DepthFunc); + SERIALISE_MEMBER(StencilEnable); + SERIALISE_MEMBER(StencilReadMask); + SERIALISE_MEMBER(StencilWriteMask); + SERIALISE_MEMBER(m_FrontFace); + SERIALISE_MEMBER(m_BackFace); + SERIALISE_MEMBER(StencilRef); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::BlendEquation &el) +{ + SERIALISE_MEMBER(Source); + SERIALISE_MEMBER(Destination); + SERIALISE_MEMBER(Operation); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::Blend &el) +{ + SERIALISE_MEMBER(m_Blend); + SERIALISE_MEMBER(m_AlphaBlend); + + SERIALISE_MEMBER(Logic); + + SERIALISE_MEMBER(Enabled); + SERIALISE_MEMBER(LogicEnabled); + SERIALISE_MEMBER(WriteMask); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::BlendState &el) +{ + SERIALISE_MEMBER(AlphaToCoverage); + SERIALISE_MEMBER(IndependentBlend); + SERIALISE_MEMBER(Blends); + SERIALISE_MEMBER(BlendFactor); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::OM &el) +{ + SERIALISE_MEMBER(m_State); + SERIALISE_MEMBER(m_BlendState); + + SERIALISE_MEMBER(RenderTargets); + SERIALISE_MEMBER(DepthTarget); + SERIALISE_MEMBER(DepthReadOnly); + SERIALISE_MEMBER(StencilReadOnly); + + SERIALISE_MEMBER(multiSampleCount); + SERIALISE_MEMBER(multiSampleQuality); + + SIZE_CHECK(240); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::ResourceState &el) +{ + SERIALISE_MEMBER(name); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::ResourceData &el) +{ + SERIALISE_MEMBER(id); + SERIALISE_MEMBER(states); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, D3D12Pipe::State &el) +{ + SERIALISE_MEMBER(pipeline); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(name); + + SERIALISE_MEMBER(rootSig); + + SERIALISE_MEMBER(m_IA); + + SERIALISE_MEMBER(m_VS); + SERIALISE_MEMBER(m_HS); + SERIALISE_MEMBER(m_DS); + SERIALISE_MEMBER(m_GS); + SERIALISE_MEMBER(m_PS); + SERIALISE_MEMBER(m_CS); + + SERIALISE_MEMBER(m_SO); + + SERIALISE_MEMBER(m_RS); + + SERIALISE_MEMBER(m_OM); + + SERIALISE_MEMBER(Resources); + + SIZE_CHECK(1176); +} + +#pragma endregion D3D12 pipeline state + +#pragma region OpenGL pipeline state + +template +void DoSerialise(SerialiserType &ser, GLPipe::VertexAttribute &el) +{ + SERIALISE_MEMBER(Enabled); + SERIALISE_MEMBER(Format); + SERIALISE_MEMBER(GenericValue); + SERIALISE_MEMBER(BufferSlot); + SERIALISE_MEMBER(RelativeOffset); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::VB &el) +{ + SERIALISE_MEMBER(Buffer); + SERIALISE_MEMBER(Stride); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Divisor); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::VertexInput &el) +{ + SERIALISE_MEMBER(attributes); + SERIALISE_MEMBER(vbuffers); + SERIALISE_MEMBER(ibuffer); + SERIALISE_MEMBER(primitiveRestart); + SERIALISE_MEMBER(restartIndex); + SERIALISE_MEMBER(provokingVertexLast); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Shader &el) +{ + SERIALISE_MEMBER(Object); + + SERIALISE_MEMBER(ShaderName); + SERIALISE_MEMBER(customShaderName); + + SERIALISE_MEMBER(ProgramName); + SERIALISE_MEMBER(customProgramName); + + SERIALISE_MEMBER(PipelineActive); + SERIALISE_MEMBER(PipelineName); + SERIALISE_MEMBER(customPipelineName); + + SERIALISE_MEMBER(stage); + SERIALISE_MEMBER(Subroutines); + + if(ser.IsReading()) + el.ShaderDetails = NULL; + SERIALISE_MEMBER(BindpointMapping); + + SIZE_CHECK(192); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::FixedVertexProcessing &el) +{ + SERIALISE_MEMBER(defaultInnerLevel); + SERIALISE_MEMBER(defaultOuterLevel); + SERIALISE_MEMBER(discard); + SERIALISE_MEMBER(clipPlanes); + SERIALISE_MEMBER(clipOriginLowerLeft); + SERIALISE_MEMBER(clipNegativeOneToOne); + + SIZE_CHECK(36); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Texture &el) +{ + SERIALISE_MEMBER(Resource); + SERIALISE_MEMBER(FirstSlice); + SERIALISE_MEMBER(HighestMip); + SERIALISE_MEMBER(ResType); + SERIALISE_MEMBER(Swizzle); + SERIALISE_MEMBER(DepthReadChannel); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Sampler &el) +{ + SERIALISE_MEMBER(Samp); + SERIALISE_MEMBER(AddressS); + SERIALISE_MEMBER(AddressT); + SERIALISE_MEMBER(AddressR); + SERIALISE_MEMBER(BorderColor); + SERIALISE_MEMBER(Comparison); + SERIALISE_MEMBER(Filter); + SERIALISE_MEMBER(SeamlessCube); + SERIALISE_MEMBER(MaxAniso); + SERIALISE_MEMBER(MaxLOD); + SERIALISE_MEMBER(MinLOD); + SERIALISE_MEMBER(MipLODBias); + + SIZE_CHECK(80); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Buffer &el) +{ + SERIALISE_MEMBER(Resource); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Size); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::ImageLoadStore &el) +{ + SERIALISE_MEMBER(Resource); + SERIALISE_MEMBER(Level); + SERIALISE_MEMBER(Layered); + SERIALISE_MEMBER(Layer); + SERIALISE_MEMBER(ResType); + SERIALISE_MEMBER(readAllowed); + SERIALISE_MEMBER(writeAllowed); + SERIALISE_MEMBER(Format); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Feedback &el) +{ + SERIALISE_MEMBER(Obj); + SERIALISE_MEMBER(BufferBinding); + SERIALISE_MEMBER(Offset); + SERIALISE_MEMBER(Size); + SERIALISE_MEMBER(Active); + SERIALISE_MEMBER(Paused); + + SIZE_CHECK(112); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Viewport &el) +{ + SERIALISE_MEMBER(Left); + SERIALISE_MEMBER(Bottom); + SERIALISE_MEMBER(Width); + SERIALISE_MEMBER(Height); + SERIALISE_MEMBER(MinDepth); + SERIALISE_MEMBER(MaxDepth); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Scissor &el) +{ + SERIALISE_MEMBER(Left); + SERIALISE_MEMBER(Bottom); + SERIALISE_MEMBER(Width); + SERIALISE_MEMBER(Height); + SERIALISE_MEMBER(Enabled); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::RasterizerState &el) +{ + SERIALISE_MEMBER(fillMode); + SERIALISE_MEMBER(cullMode); + SERIALISE_MEMBER(FrontCCW); + SERIALISE_MEMBER(DepthBias); + SERIALISE_MEMBER(SlopeScaledDepthBias); + SERIALISE_MEMBER(OffsetClamp); + SERIALISE_MEMBER(DepthClamp); + + SERIALISE_MEMBER(MultisampleEnable); + SERIALISE_MEMBER(SampleShading); + SERIALISE_MEMBER(SampleMask); + SERIALISE_MEMBER(SampleMaskValue); + SERIALISE_MEMBER(SampleCoverage); + SERIALISE_MEMBER(SampleCoverageInvert); + SERIALISE_MEMBER(SampleCoverageValue); + SERIALISE_MEMBER(SampleAlphaToCoverage); + SERIALISE_MEMBER(SampleAlphaToOne); + SERIALISE_MEMBER(MinSampleShadingRate); + + SERIALISE_MEMBER(ProgrammablePointSize); + SERIALISE_MEMBER(PointSize); + SERIALISE_MEMBER(LineWidth); + SERIALISE_MEMBER(PointFadeThreshold); + SERIALISE_MEMBER(PointOriginUpperLeft); + + SIZE_CHECK(68); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Rasterizer &el) +{ + SERIALISE_MEMBER(Viewports); + SERIALISE_MEMBER(Scissors); + SERIALISE_MEMBER(m_State); + + SIZE_CHECK(104); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::DepthState &el) +{ + SERIALISE_MEMBER(DepthEnable); + SERIALISE_MEMBER(DepthFunc); + SERIALISE_MEMBER(DepthWrites); + SERIALISE_MEMBER(DepthBounds); + SERIALISE_MEMBER(NearBound); + SERIALISE_MEMBER(FarBound); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::StencilFace &el) +{ + SERIALISE_MEMBER(FailOp); + SERIALISE_MEMBER(DepthFailOp); + SERIALISE_MEMBER(PassOp); + SERIALISE_MEMBER(Func); + SERIALISE_MEMBER(Ref); + SERIALISE_MEMBER(ValueMask); + SERIALISE_MEMBER(WriteMask); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::StencilState &el) +{ + SERIALISE_MEMBER(StencilEnable); + SERIALISE_MEMBER(m_FrontFace); + SERIALISE_MEMBER(m_BackFace); + + SIZE_CHECK(44); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Attachment &el) +{ + SERIALISE_MEMBER(Obj); + SERIALISE_MEMBER(Layer); + SERIALISE_MEMBER(Mip); + SERIALISE_MEMBER(Swizzle); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::FBO &el) +{ + SERIALISE_MEMBER(Obj); + SERIALISE_MEMBER(Color); + SERIALISE_MEMBER(Depth); + SERIALISE_MEMBER(Stencil); + SERIALISE_MEMBER(DrawBuffers); + SERIALISE_MEMBER(ReadBuffer); + + SIZE_CHECK(112); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::BlendEquation &el) +{ + SERIALISE_MEMBER(Source); + SERIALISE_MEMBER(Destination); + SERIALISE_MEMBER(Operation); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Blend &el) +{ + SERIALISE_MEMBER(m_Blend); + SERIALISE_MEMBER(m_AlphaBlend); + SERIALISE_MEMBER(Logic); + SERIALISE_MEMBER(Enabled); + SERIALISE_MEMBER(WriteMask); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::BlendState &el) +{ + SERIALISE_MEMBER(BlendFactor); + SERIALISE_MEMBER(Blends); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::FrameBuffer &el) +{ + SERIALISE_MEMBER(FramebufferSRGB); + SERIALISE_MEMBER(Dither); + SERIALISE_MEMBER(m_DrawFBO); + SERIALISE_MEMBER(m_ReadFBO); + SERIALISE_MEMBER(m_Blending); + + SIZE_CHECK(264); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::Hints &el) +{ + SERIALISE_MEMBER(Derivatives); + SERIALISE_MEMBER(LineSmooth); + SERIALISE_MEMBER(PolySmooth); + SERIALISE_MEMBER(TexCompression); + SERIALISE_MEMBER(LineSmoothEnabled); + SERIALISE_MEMBER(PolySmoothEnabled); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, GLPipe::State &el) +{ + SERIALISE_MEMBER(m_VtxIn); + + SERIALISE_MEMBER(m_VS); + SERIALISE_MEMBER(m_TCS); + SERIALISE_MEMBER(m_TES); + SERIALISE_MEMBER(m_GS); + SERIALISE_MEMBER(m_FS); + SERIALISE_MEMBER(m_CS); + + SERIALISE_MEMBER(m_VtxProcess); + + SERIALISE_MEMBER(Textures); + SERIALISE_MEMBER(Samplers); + SERIALISE_MEMBER(AtomicBuffers); + SERIALISE_MEMBER(UniformBuffers); + SERIALISE_MEMBER(ShaderStorageBuffers); + SERIALISE_MEMBER(Images); + + SERIALISE_MEMBER(m_Feedback); + + SERIALISE_MEMBER(m_Rasterizer); + SERIALISE_MEMBER(m_DepthState); + SERIALISE_MEMBER(m_StencilState); + + SERIALISE_MEMBER(m_FB); + + SERIALISE_MEMBER(m_Hints); + + SIZE_CHECK(1928); +} + +#pragma endregion OpenGL pipeline state + +#pragma region Vulkan pipeline state + +template +void DoSerialise(SerialiserType &ser, VKPipe::BindingElement &el) +{ + SERIALISE_MEMBER(view); + SERIALISE_MEMBER(res); + SERIALISE_MEMBER(sampler); + SERIALISE_MEMBER(immutableSampler); + + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + + SERIALISE_MEMBER(viewfmt); + SERIALISE_MEMBER(swizzle); + SERIALISE_MEMBER(baseMip); + SERIALISE_MEMBER(baseLayer); + SERIALISE_MEMBER(numMip); + SERIALISE_MEMBER(numLayer); + + SERIALISE_MEMBER(offset); + SERIALISE_MEMBER(size); + + SERIALISE_MEMBER(Filter); + SERIALISE_MEMBER(AddressU); + SERIALISE_MEMBER(AddressV); + SERIALISE_MEMBER(AddressW); + SERIALISE_MEMBER(mipBias); + SERIALISE_MEMBER(maxAniso); + SERIALISE_MEMBER(comparison); + SERIALISE_MEMBER(minlod); + SERIALISE_MEMBER(maxlod); + SERIALISE_MEMBER(BorderColor); + SERIALISE_MEMBER(unnormalized); + + SIZE_CHECK(176); +}; + +template +void DoSerialise(SerialiserType &ser, VKPipe::DescriptorBinding &el) +{ + SERIALISE_MEMBER(descriptorCount); + SERIALISE_MEMBER(type); + SERIALISE_MEMBER(stageFlags); + + SERIALISE_MEMBER(binds); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::DescriptorSet &el) +{ + SERIALISE_MEMBER(layout); + SERIALISE_MEMBER(descset); + + SERIALISE_MEMBER(bindings); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Pipeline &el) +{ + SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(flags); + + SERIALISE_MEMBER(DescSets); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::IB &el) +{ + SERIALISE_MEMBER(buf); + SERIALISE_MEMBER(offs); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::InputAssembly &el) +{ + SERIALISE_MEMBER(primitiveRestartEnable); + SERIALISE_MEMBER(ibuffer); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::VertexAttribute &el) +{ + SERIALISE_MEMBER(location); + SERIALISE_MEMBER(binding); + SERIALISE_MEMBER(format); + SERIALISE_MEMBER(byteoffset); + + SIZE_CHECK(20); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::VertexBinding &el) +{ + SERIALISE_MEMBER(vbufferBinding); + SERIALISE_MEMBER(bytestride); + SERIALISE_MEMBER(perInstance); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::VB &el) +{ + SERIALISE_MEMBER(buffer); + SERIALISE_MEMBER(offset); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::VertexInput &el) +{ + SERIALISE_MEMBER(attrs); + SERIALISE_MEMBER(binds); + SERIALISE_MEMBER(vbuffers); + + SIZE_CHECK(48); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::SpecInfo &el) +{ + SERIALISE_MEMBER(specID); + SERIALISE_MEMBER(data); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Shader &el) +{ + SERIALISE_MEMBER(Object); + SERIALISE_MEMBER(entryPoint); + + SERIALISE_MEMBER(name); + SERIALISE_MEMBER(customName); + SERIALISE_MEMBER(stage); + SERIALISE_MEMBER(specialization); + + if(ser.IsReading()) + el.ShaderDetails = NULL; + SERIALISE_MEMBER(BindpointMapping); + + SIZE_CHECK(160); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Tessellation &el) +{ + SERIALISE_MEMBER(numControlPoints); + + SIZE_CHECK(4); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Viewport &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + SERIALISE_MEMBER(minDepth); + SERIALISE_MEMBER(maxDepth); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Scissor &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::ViewportScissor &el) +{ + SERIALISE_MEMBER(vp); + SERIALISE_MEMBER(scissor); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::ViewState &el) +{ + SERIALISE_MEMBER(viewportScissors); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Raster &el) +{ + SERIALISE_MEMBER(depthClampEnable); + SERIALISE_MEMBER(rasterizerDiscardEnable); + SERIALISE_MEMBER(FrontCCW); + SERIALISE_MEMBER(fillMode); + SERIALISE_MEMBER(cullMode); + + SERIALISE_MEMBER(depthBias); + SERIALISE_MEMBER(depthBiasClamp); + SERIALISE_MEMBER(slopeScaledDepthBias); + SERIALISE_MEMBER(lineWidth); + + SIZE_CHECK(28); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::MultiSample &el) +{ + SERIALISE_MEMBER(rasterSamples); + SERIALISE_MEMBER(sampleShadingEnable); + SERIALISE_MEMBER(minSampleShading); + SERIALISE_MEMBER(sampleMask); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::BlendEquation &el) +{ + SERIALISE_MEMBER(Source); + SERIALISE_MEMBER(Destination); + SERIALISE_MEMBER(Operation); + + SIZE_CHECK(12); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Blend &el) +{ + SERIALISE_MEMBER(blendEnable); + SERIALISE_MEMBER(blend); + SERIALISE_MEMBER(alphaBlend); + SERIALISE_MEMBER(writeMask); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::ColorBlend &el) +{ + SERIALISE_MEMBER(alphaToCoverageEnable); + SERIALISE_MEMBER(alphaToOneEnable); + SERIALISE_MEMBER(logicOpEnable); + SERIALISE_MEMBER(logic); + + SERIALISE_MEMBER(attachments); + + SERIALISE_MEMBER(blendConst); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::StencilFace &el) +{ + SERIALISE_MEMBER(FailOp); + SERIALISE_MEMBER(DepthFailOp); + SERIALISE_MEMBER(PassOp); + SERIALISE_MEMBER(Func); + SERIALISE_MEMBER(ref); + SERIALISE_MEMBER(compareMask); + SERIALISE_MEMBER(writeMask); + + SIZE_CHECK(28); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::DepthStencil &el) +{ + SERIALISE_MEMBER(depthTestEnable); + SERIALISE_MEMBER(depthWriteEnable); + SERIALISE_MEMBER(depthBoundsEnable); + SERIALISE_MEMBER(depthCompareOp); + + SERIALISE_MEMBER(stencilTestEnable); + + SERIALISE_MEMBER(front); + SERIALISE_MEMBER(back); + + SERIALISE_MEMBER(minDepthBounds); + SERIALISE_MEMBER(maxDepthBounds); + + SIZE_CHECK(76); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::RenderPass &el) +{ + SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(inputAttachments); + SERIALISE_MEMBER(colorAttachments); + SERIALISE_MEMBER(resolveAttachments); + SERIALISE_MEMBER(depthstencilAttachment); + + SIZE_CHECK(64); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Attachment &el) +{ + SERIALISE_MEMBER(view); + SERIALISE_MEMBER(img); + + SERIALISE_MEMBER(viewfmt); + SERIALISE_MEMBER(swizzle); + + SERIALISE_MEMBER(baseMip); + SERIALISE_MEMBER(baseLayer); + SERIALISE_MEMBER(numMip); + SERIALISE_MEMBER(numLayer); + + SIZE_CHECK(56); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::Framebuffer &el) +{ + SERIALISE_MEMBER(obj); + SERIALISE_MEMBER(attachments); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + SERIALISE_MEMBER(layers); + + SIZE_CHECK(40); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::RenderArea &el) +{ + SERIALISE_MEMBER(x); + SERIALISE_MEMBER(y); + SERIALISE_MEMBER(width); + SERIALISE_MEMBER(height); + + SIZE_CHECK(16); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::CurrentPass &el) +{ + SERIALISE_MEMBER(renderpass); + SERIALISE_MEMBER(framebuffer); + SERIALISE_MEMBER(renderArea); + + SIZE_CHECK(120); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::ImageLayout &el) +{ + SERIALISE_MEMBER(baseMip); + SERIALISE_MEMBER(baseLayer); + SERIALISE_MEMBER(numMip); + SERIALISE_MEMBER(numLayer); + SERIALISE_MEMBER(name); + + SIZE_CHECK(32); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::ImageData &el) +{ + SERIALISE_MEMBER(image); + SERIALISE_MEMBER(layouts); + + SIZE_CHECK(24); +} + +template +void DoSerialise(SerialiserType &ser, VKPipe::State &el) +{ + SERIALISE_MEMBER(compute); + SERIALISE_MEMBER(graphics); + + SERIALISE_MEMBER(IA); + SERIALISE_MEMBER(VI); + + SERIALISE_MEMBER(m_VS); + SERIALISE_MEMBER(m_TCS); + SERIALISE_MEMBER(m_TES); + SERIALISE_MEMBER(m_GS); + SERIALISE_MEMBER(m_FS); + SERIALISE_MEMBER(m_CS); + + SERIALISE_MEMBER(Tess); + + SERIALISE_MEMBER(VP); + SERIALISE_MEMBER(RS); + SERIALISE_MEMBER(MSAA); + SERIALISE_MEMBER(CB); + SERIALISE_MEMBER(DS); + SERIALISE_MEMBER(Pass); + + SERIALISE_MEMBER(images); + + SIZE_CHECK(1424); +} + +#pragma endregion Vulkan pipeline state + +INSTANTIATE_SERIALISE_TYPE(PathEntry) +INSTANTIATE_SERIALISE_TYPE(EnvironmentModification) +INSTANTIATE_SERIALISE_TYPE(CaptureOptions) +INSTANTIATE_SERIALISE_TYPE(ResourceFormat) +INSTANTIATE_SERIALISE_TYPE(BindpointMap) +INSTANTIATE_SERIALISE_TYPE(ShaderBindpointMapping) +INSTANTIATE_SERIALISE_TYPE(SigParameter) +INSTANTIATE_SERIALISE_TYPE(ShaderVariableType) +INSTANTIATE_SERIALISE_TYPE(ShaderConstant) +INSTANTIATE_SERIALISE_TYPE(ConstantBlock) +INSTANTIATE_SERIALISE_TYPE(ShaderSampler) +INSTANTIATE_SERIALISE_TYPE(ShaderResource) +INSTANTIATE_SERIALISE_TYPE(ShaderCompileFlags) +INSTANTIATE_SERIALISE_TYPE(ShaderDebugChunk) +INSTANTIATE_SERIALISE_TYPE(ShaderReflection) +INSTANTIATE_SERIALISE_TYPE(ShaderVariable) +INSTANTIATE_SERIALISE_TYPE(ShaderDebugState) +INSTANTIATE_SERIALISE_TYPE(ShaderDebugTrace) +INSTANTIATE_SERIALISE_TYPE(TextureDescription) +INSTANTIATE_SERIALISE_TYPE(BufferDescription) +INSTANTIATE_SERIALISE_TYPE(APIProperties) +INSTANTIATE_SERIALISE_TYPE(DebugMessage) +INSTANTIATE_SERIALISE_TYPE(APIEvent) +INSTANTIATE_SERIALISE_TYPE(DrawcallDescription) +INSTANTIATE_SERIALISE_TYPE(ConstantBindStats) +INSTANTIATE_SERIALISE_TYPE(SamplerBindStats) +INSTANTIATE_SERIALISE_TYPE(ResourceBindStats) +INSTANTIATE_SERIALISE_TYPE(ResourceUpdateStats) +INSTANTIATE_SERIALISE_TYPE(DrawcallStats) +INSTANTIATE_SERIALISE_TYPE(DispatchStats) +INSTANTIATE_SERIALISE_TYPE(IndexBindStats) +INSTANTIATE_SERIALISE_TYPE(VertexBindStats) +INSTANTIATE_SERIALISE_TYPE(LayoutBindStats) +INSTANTIATE_SERIALISE_TYPE(ShaderChangeStats) +INSTANTIATE_SERIALISE_TYPE(BlendStats) +INSTANTIATE_SERIALISE_TYPE(DepthStencilStats) +INSTANTIATE_SERIALISE_TYPE(RasterizationStats) +INSTANTIATE_SERIALISE_TYPE(OutputTargetStats) +INSTANTIATE_SERIALISE_TYPE(FrameStatistics) +INSTANTIATE_SERIALISE_TYPE(FrameDescription) +INSTANTIATE_SERIALISE_TYPE(FrameRecord) +INSTANTIATE_SERIALISE_TYPE(MeshFormat) +INSTANTIATE_SERIALISE_TYPE(FloatVector) +INSTANTIATE_SERIALISE_TYPE(Uuid) +INSTANTIATE_SERIALISE_TYPE(CounterDescription) +INSTANTIATE_SERIALISE_TYPE(PixelModification) +INSTANTIATE_SERIALISE_TYPE(EventUsage) +INSTANTIATE_SERIALISE_TYPE(CounterResult) +INSTANTIATE_SERIALISE_TYPE(CounterValue) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Layout) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::IA) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::View) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Sampler) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Shader) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Rasterizer) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Blend) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::OM) +INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::State) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Layout) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::IA) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::CBuffer) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Sampler) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::View) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::RegisterSpace) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Shader) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Rasterizer) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::Blend) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::OM) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::ResourceState) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::ResourceData) +INSTANTIATE_SERIALISE_TYPE(D3D12Pipe::State) +INSTANTIATE_SERIALISE_TYPE(GLPipe::VertexAttribute) +INSTANTIATE_SERIALISE_TYPE(GLPipe::VertexInput) +INSTANTIATE_SERIALISE_TYPE(GLPipe::Shader) +INSTANTIATE_SERIALISE_TYPE(GLPipe::Sampler) +INSTANTIATE_SERIALISE_TYPE(GLPipe::ImageLoadStore) +INSTANTIATE_SERIALISE_TYPE(GLPipe::Rasterizer) +INSTANTIATE_SERIALISE_TYPE(GLPipe::DepthState) +INSTANTIATE_SERIALISE_TYPE(GLPipe::StencilState) +INSTANTIATE_SERIALISE_TYPE(GLPipe::Blend) +INSTANTIATE_SERIALISE_TYPE(GLPipe::BlendState) +INSTANTIATE_SERIALISE_TYPE(GLPipe::Attachment) +INSTANTIATE_SERIALISE_TYPE(GLPipe::FrameBuffer) +INSTANTIATE_SERIALISE_TYPE(GLPipe::State) +INSTANTIATE_SERIALISE_TYPE(VKPipe::BindingElement) +INSTANTIATE_SERIALISE_TYPE(VKPipe::DescriptorBinding) +INSTANTIATE_SERIALISE_TYPE(VKPipe::DescriptorSet) +INSTANTIATE_SERIALISE_TYPE(VKPipe::Pipeline) +INSTANTIATE_SERIALISE_TYPE(VKPipe::VertexAttribute) +INSTANTIATE_SERIALISE_TYPE(VKPipe::VertexInput) +INSTANTIATE_SERIALISE_TYPE(VKPipe::SpecInfo) +INSTANTIATE_SERIALISE_TYPE(VKPipe::Shader) +INSTANTIATE_SERIALISE_TYPE(VKPipe::ViewState) +INSTANTIATE_SERIALISE_TYPE(VKPipe::Blend) +INSTANTIATE_SERIALISE_TYPE(VKPipe::ColorBlend) +INSTANTIATE_SERIALISE_TYPE(VKPipe::Attachment) +INSTANTIATE_SERIALISE_TYPE(VKPipe::DepthStencil) +INSTANTIATE_SERIALISE_TYPE(VKPipe::CurrentPass) +INSTANTIATE_SERIALISE_TYPE(VKPipe::ImageLayout) +INSTANTIATE_SERIALISE_TYPE(VKPipe::ImageData) +INSTANTIATE_SERIALISE_TYPE(VKPipe::State) \ No newline at end of file