Add serialisation for public interface structs

This commit is contained in:
baldurk
2017-09-27 14:56:28 +01:00
parent 034a0f3759
commit a63e99177d
10 changed files with 2374 additions and 2 deletions
+1
View File
@@ -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
+2
View File
@@ -177,3 +177,5 @@ Default - enabled
)");
bool DebugOutputMute;
};
DECLARE_REFLECTION_STRUCT(CaptureOptions);
+7
View File
@@ -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
{
+84 -1
View File
@@ -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 <typename integer>
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 <typename integer>
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);
BITMASK_OPERATORS(AndroidFlags);
DECLARE_REFLECTION_ENUM(AndroidFlags);
+3 -1
View File
@@ -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
+2
View File
@@ -38,6 +38,8 @@
#include "api/replay/renderdoc_tostr.inl"
#include "replay/renderdoc_serialise.inl"
template <>
std::string DoStringise(const ResourceId &el)
{
+2
View File
@@ -123,6 +123,8 @@ enum RDCDriver
RDC_Custom9,
};
DECLARE_REFLECTION_ENUM(RDCDriver);
namespace DXBC
{
class DXBCFile;
+1
View File
@@ -443,6 +443,7 @@
<None Include="data\hlsl\mesh.hlsl" />
<None Include="data\hlsl\multisample.hlsl" />
<None Include="os\win32\comexport.def" />
<None Include="replay\renderdoc_serialise.inl" />
</ItemGroup>
<ItemGroup>
<Natvis Include="renderdoc.natvis" />
+3
View File
@@ -724,6 +724,9 @@
<None Include="api\replay\renderdoc_tostr.inl">
<Filter>API\Replay</Filter>
</None>
<None Include="replay\renderdoc_serialise.inl">
<Filter>Replay</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="data\renderdoc.rc">
File diff suppressed because it is too large Load Diff