Normalise and make python/public interface more consistent

* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
This commit is contained in:
baldurk committed 2017-12-22 13:02:36 +00:00
1 parent fd66995ac2
commit ebaefc82a9
171 files changed
+9843 -10175

No files matched your search

+13 -13
View File
@@ -47,7 +47,7 @@ Default - enabled
``False`` - vsync is force disabled.
)");
bool AllowVSync;
bool allowVSync;
DOCUMENT(R"(Allow the application to enable fullscreen.
@@ -57,7 +57,7 @@ Default - enabled
``False`` - fullscreen is force disabled.
)");
bool AllowFullscreen;
bool allowFullscreen;
DOCUMENT(R"(Record API debugging events and messages
@@ -68,7 +68,7 @@ the capture logfile, which is matched up with events on replay.
``False`` - no API debugging is forcibly enabled.
)");
bool APIValidation;
bool apiValidation;
DOCUMENT(R"(Capture CPU callstacks for API events
@@ -78,10 +78,10 @@ Default - disabled
``False`` - no callstacks are captured.
)");
bool CaptureCallstacks;
bool captureCallstacks;
DOCUMENT(R"(When capturing CPU callstacks, only capture them from drawcalls.
This option does nothing if :data:`CaptureCallstacks` is not enabled.
This option does nothing if :data:`captureCallstacks` is not enabled.
Default - disabled
@@ -89,7 +89,7 @@ Default - disabled
``False`` - Callstacks, if enabled, are captured for every event.
)");
bool CaptureCallstacksOnlyDraws;
bool captureCallstacksOnlyDraws;
DOCUMENT(R"(Specify a delay in seconds to wait for a debugger to attach, after
creating or injecting into a process, before continuing to allow it to run.
@@ -98,7 +98,7 @@ creating or injecting into a process, before continuing to allow it to run.
Default - 0 seconds
)");
uint32_t DelayForDebugger;
uint32_t delayForDebugger;
DOCUMENT(R"(Verify any writes to mapped buffers, by checking the memory after the
bounds of the returned pointer to detect any modification.
@@ -110,7 +110,7 @@ Default - disabled
``False`` - No verification is performed, and overwriting bounds may cause
crashes or corruption in RenderDoc.
)");
bool VerifyMapWrites;
bool verifyMapWrites;
DOCUMENT(R"(Hooks any system API calls that create child processes, and injects
RenderDoc into them recursively with the same options.
@@ -121,7 +121,7 @@ Default - disabled
``False`` - Child processes are not hooked by RenderDoc.
)");
bool HookIntoChildren;
bool hookIntoChildren;
DOCUMENT(R"(By default RenderDoc only includes resources in the final logfile necessary
for that frame, this allows you to override that behaviour.
@@ -133,7 +133,7 @@ and available for inspection.
``False`` - only the resources referenced by the captured frame are included.
)");
bool RefAllResources;
bool refAllResources;
DOCUMENT(R"(By default RenderDoc skips saving initial states for resources where the
previous contents don't appear to be used, assuming that writes before
@@ -147,7 +147,7 @@ Default - disabled
``False`` - unless a read is detected, initial contents will not be saved and will
appear as black or empty data.
)");
bool SaveAllInitials;
bool saveAllInitials;
DOCUMENT(R"(In APIs that allow for the recording of command lists to be replayed later,
RenderDoc may choose to not capture command lists before a frame capture is
@@ -165,7 +165,7 @@ capture.
``False`` - Command lists are only captured if their recording begins during
the period when a frame capture is in progress.
)");
bool CaptureAllCmdLists;
bool captureAllCmdLists;
DOCUMENT(R"(Mute API debugging output when the API validation mode option is enabled.
@@ -175,7 +175,7 @@ Default - enabled
``False`` - API debugging is displayed as normal.
)");
bool DebugOutputMute;
bool debugOutputMute;
};
DECLARE_REFLECTION_STRUCT(CaptureOptions);
+210
View File
@@ -0,0 +1,210 @@
/******************************************************************************
* 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.
******************************************************************************/
#pragma once
DOCUMENT("Information about a viewport.");
struct Viewport
{
DOCUMENT("");
bool operator==(const Viewport &o) const
{
return x == o.x && y == o.y && width == o.width && height == o.height &&
minDepth == o.minDepth && maxDepth == o.maxDepth;
}
bool operator<(const Viewport &o) const
{
if(!(x == o.x))
return x < o.x;
if(!(y == o.y))
return y < o.y;
if(!(width == o.width))
return width < o.width;
if(!(height == o.height))
return height < o.height;
if(!(minDepth == o.minDepth))
return minDepth < o.minDepth;
if(!(maxDepth == o.maxDepth))
return maxDepth < o.maxDepth;
return false;
}
Viewport() = default;
Viewport(float X, float Y, float W, float H, float MN, float MX, bool en = true)
: x(X), y(Y), width(W), height(H), minDepth(MN), maxDepth(MX), enabled(en)
{
}
DOCUMENT("Is this viewport enabled.");
bool enabled = true;
DOCUMENT("The X co-ordinate of the viewport.");
float x = 0.0f;
DOCUMENT("The Y co-ordinate of the viewport.");
float y = 0.0f;
DOCUMENT("The width of the viewport.");
float width = 0.0f;
DOCUMENT("The height of the viewport.");
float height = 0.0f;
DOCUMENT("The minimum depth of the viewport.");
float minDepth = 0.0f;
DOCUMENT("The maximum depth of the viewport.");
float maxDepth = 0.0f;
};
DECLARE_REFLECTION_STRUCT(Viewport);
DOCUMENT("Describes a single scissor region.");
struct Scissor
{
DOCUMENT("");
bool operator==(const Scissor &o) const
{
return x == o.x && y == o.y && width == o.width && height == o.height && enabled == o.enabled;
}
bool operator<(const Scissor &o) const
{
if(!(x == o.x))
return x < o.x;
if(!(y == o.y))
return y < o.y;
if(!(width == o.width))
return width < o.width;
if(!(height == o.height))
return height < o.height;
if(!(enabled == o.enabled))
return enabled < o.enabled;
return false;
}
Scissor() = default;
Scissor(int X, int Y, int W, int H, bool en = true) : x(X), y(Y), width(W), height(H), enabled(en)
{
}
DOCUMENT("X co-ordinate of the scissor region.");
int32_t x = 0;
DOCUMENT("Y co-ordinate of the scissor region.");
int32_t y = 0;
DOCUMENT("Width of the scissor region.");
int32_t width = 0;
DOCUMENT("Height of the scissor region.");
int32_t height = 0;
DOCUMENT("``True`` if this scissor region is enabled.");
bool enabled = true;
};
DECLARE_REFLECTION_STRUCT(Scissor);
DOCUMENT("Describes the details of a blend operation.");
struct BlendEquation
{
DOCUMENT("");
bool operator==(const BlendEquation &o) const
{
return source == o.source && destination == o.destination && operation == o.operation;
}
bool operator<(const BlendEquation &o) const
{
if(!(source == o.source))
return source < o.source;
if(!(destination == o.destination))
return destination < o.destination;
if(!(operation == o.operation))
return operation < o.operation;
return false;
}
DOCUMENT("The :class:`BlendMultiplier` for the source blend value.");
BlendMultiplier source = BlendMultiplier::One;
DOCUMENT("The :class:`BlendMultiplier` for the destination blend value.");
BlendMultiplier destination = BlendMultiplier::One;
DOCUMENT("The :class:`BlendOperation` to use in the blend calculation.");
BlendOperation operation = BlendOperation::Add;
};
DECLARE_REFLECTION_STRUCT(BlendEquation);
DOCUMENT("Describes the blend configuration for a given output target.");
struct ColorBlend
{
DOCUMENT("");
bool operator==(const ColorBlend &o) const
{
return enabled == o.enabled && logicOperationEnabled == o.logicOperationEnabled &&
colorBlend == o.colorBlend && alphaBlend == o.alphaBlend &&
logicOperation == o.logicOperation && writeMask == o.writeMask;
}
bool operator<(const ColorBlend &o) const
{
if(!(enabled == o.enabled))
return enabled < o.enabled;
if(!(logicOperationEnabled == o.logicOperationEnabled))
return logicOperationEnabled < o.logicOperationEnabled;
if(!(colorBlend == o.colorBlend))
return colorBlend < o.colorBlend;
if(!(alphaBlend == o.alphaBlend))
return alphaBlend < o.alphaBlend;
if(!(logicOperation == o.logicOperation))
return logicOperation < o.logicOperation;
if(!(writeMask == o.writeMask))
return writeMask < o.writeMask;
return false;
}
DOCUMENT("A :class:`BlendEquation` describing the blending for color values.");
BlendEquation colorBlend;
DOCUMENT("A :class:`BlendEquation` describing the blending for alpha values.");
BlendEquation alphaBlend;
DOCUMENT(R"(The :class:`LogicOperation` to use for logic operations, if
:data:`logicOperationEnabled` is ``True``.
)");
LogicOperation logicOperation = LogicOperation::NoOp;
DOCUMENT("``True`` if blending is enabled for this target.");
bool enabled = false;
DOCUMENT("``True`` if the logic operation in :data:`logicOperation` should be used.");
bool logicOperationEnabled = false;
DOCUMENT("The mask for writes to the render target.");
byte writeMask = 0;
};
DECLARE_REFLECTION_STRUCT(ColorBlend);
DOCUMENT("Describes the details of a stencil operation.");
struct StencilFace
{
DOCUMENT("The :class:`StencilOperation` to apply if the stencil-test fails.");
StencilOperation failOperation = StencilOperation::Keep;
DOCUMENT("the :class:`StencilOperation` to apply if the depth-test fails.");
StencilOperation depthFailOperation = StencilOperation::Keep;
DOCUMENT("the :class:`StencilOperation` to apply if the stencil-test passes.");
StencilOperation passOperation = StencilOperation::Keep;
DOCUMENT("the :class:`CompareFunction` to use for testing stencil values.");
CompareFunction function = CompareFunction::AlwaysTrue;
DOCUMENT("The current stencil reference value.");
uint32_t reference = 0;
DOCUMENT("The mask for testing stencil values.");
uint32_t compareMask = 0;
DOCUMENT("The mask for writing stencil values.");
uint32_t writeMask = 0;
};
DECLARE_REFLECTION_STRUCT(StencilFace);
+49 -46
View File
@@ -35,36 +35,36 @@ struct MeshFormat
{
MeshFormat()
{
idxoffs = 0;
idxByteWidth = 0;
indexByteOffset = 0;
indexByteStride = 0;
baseVertex = 0;
offset = 0;
stride = 0;
vertexByteOffset = 0;
vertexByteStride = 0;
showAlpha = false;
topo = Topology::Unknown;
numVerts = 0;
topology = Topology::Unknown;
numIndices = 0;
unproject = false;
nearPlane = farPlane = 0.0f;
}
DOCUMENT("The :class:`ResourceId` of the index buffer that goes with this mesh element.");
ResourceId idxbuf;
ResourceId indexResourceId;
DOCUMENT("The offset in bytes where the indices start in idxbuf.");
uint64_t idxoffs;
uint64_t indexByteOffset;
DOCUMENT("The width in bytes of each index. Valid values are 1 (depending on API), 2 or 4.");
uint32_t idxByteWidth;
uint32_t indexByteStride;
DOCUMENT("For indexed meshes, a value added to each index before using it to read the vertex.");
int32_t baseVertex;
DOCUMENT("The :class:`ResourceId` of the vertex buffer containing this mesh element.");
ResourceId buf;
ResourceId vertexResourceId;
DOCUMENT("The offset in bytes to the start of the vertex data.");
uint64_t offset;
uint64_t vertexByteOffset;
DOCUMENT("The stride in bytes between the start of one vertex and the start of another.");
uint32_t stride;
uint32_t vertexByteStride;
DOCUMENT("The :class:`ResourceFormat` describing this mesh component.");
ResourceFormat fmt;
ResourceFormat format;
DOCUMENT(
"The color to use for rendering the wireframe of this mesh element, as a "
@@ -72,9 +72,9 @@ struct MeshFormat
FloatVector meshColor;
DOCUMENT("The :class:`Topology` that describes the primitives in this mesh.");
Topology topo;
Topology topology;
DOCUMENT("The number of vertices in the mesh.");
uint32_t numVerts;
uint32_t numIndices;
DOCUMENT("The near plane for the projection matrix.");
float nearPlane;
@@ -165,16 +165,16 @@ particular subresource (such as array slice, mip or multi-sampled sample).
struct TextureDisplay
{
DOCUMENT("The :class:`ResourceId` of the texture to display.");
ResourceId texid;
ResourceId resourceId;
DOCUMENT("An optional :class:`CompType` hint to use when displaying a typeless texture.");
CompType typeHint;
DOCUMENT("The value in each channel to map to the black point.");
float rangemin;
float rangeMin;
DOCUMENT("The value in each channel to map to the white point.");
float rangemax;
float rangeMax;
DOCUMENT(R"(The scale to apply to the texture when rendering as a floating point value.
@@ -186,32 +186,32 @@ struct TextureDisplay
If only one channel is selected, it will be rendered in grayscale
)");
bool Red;
bool red;
DOCUMENT(R"(``True`` if the green channel should be visible.
If only one channel is selected, it will be rendered in grayscale
)");
bool Green;
bool green;
DOCUMENT(R"(``True`` if the blue channel should be visible.
If only one channel is selected, it will be rendered in grayscale
)");
bool Blue;
bool blue;
DOCUMENT(R"(``True`` if the alpha channel should be visible. If enabled with any of RGB, the
texture will be blended to the background color or checkerboard.
If only one channel is selected, it will be rendered in grayscale
)");
bool Alpha;
bool alpha;
DOCUMENT("``True`` if the texture should be flipped vertically when rendering.");
bool FlipY;
bool flipY;
DOCUMENT("If ``>= 0.0`` the RGBA values will be viewed as HDRM with this as the multiplier.");
float HDRMul;
float hdrMultiplier;
DOCUMENT(R"(``True`` if the texture should be interpreted as gamma.
@@ -223,7 +223,7 @@ See :ref:`the FAQ entry <gamma-linear-display>`.
See :meth:`ReplayController.BuildCustomShader` for creating an appropriate custom shader.
)");
ResourceId CustomShader;
ResourceId customShaderId;
DOCUMENT("Select the mip of the texture to display.");
uint32_t mip;
@@ -243,15 +243,15 @@ samples.
This is primarily useful when rendering to a floating point target for retrieving pixel data from
the input texture in cases where it isn't easy to directly fetch the input texture data.
)");
bool rawoutput;
bool rawOutput;
DOCUMENT("The offset to pan in the X axis.");
float offx;
float xOffset;
DOCUMENT("The offset to pan in the Y axis.");
float offy;
float yOffset;
DOCUMENT(R"(The background colour to use behind the texture display.
DOCUMENT(R"(The background color to use behind the texture display.
If set to (0, 0, 0, 0) the global checkerboard colors are used.
)");
@@ -373,7 +373,7 @@ written
int32_t mip;
DOCUMENT(R"(Controls black/white point mapping for output formats that are normal
:data:`8-bit SRGB <CompType.UNorm>`, values are
:attr:`8-bit SRGB <CompType.UNorm>`, values are
)");
TextureComponentMapping comp;
@@ -396,7 +396,7 @@ It is an :class:`AlphaMapping` that controls what behaviour to use.
)");
AlphaMapping alpha;
DOCUMENT("The background color if :data:`alpha` is set to :data:`AlphaMapping.BlendToColor`");
DOCUMENT("The background color if :data:`alpha` is set to :attr:`AlphaMapping.BlendToColor`");
FloatVector alphaCol;
DOCUMENT("The quality to use when saving to a ``JPG`` file. Valid values are between 1 and 100.");
@@ -410,7 +410,7 @@ DOCUMENT("Information about the a new capture created by the target.");
struct NewCaptureData
{
DOCUMENT("An identifier to use to refer to this capture.");
uint32_t ID = 0;
uint32_t captureId = 0;
DOCUMENT("The time the capture was created, as a unix timestamp in UTC.");
uint64_t timestamp = 0;
DOCUMENT("The raw bytes that contain the capture thumbnail, as RGB8 data.");
@@ -427,20 +427,23 @@ struct NewCaptureData
DECLARE_REFLECTION_STRUCT(NewCaptureData);
DOCUMENT("Information about the API that the target has begun using.");
struct RegisterAPIData
DOCUMENT("Information about the API that the target is using.");
struct APIUseData
{
DOCUMENT("The name of the new API.");
rdcstr APIName;
DOCUMENT("The name of the API.");
rdcstr name;
DOCUMENT("``True`` if the API is presenting to a swapchain");
bool presenting = false;
};
DECLARE_REFLECTION_STRUCT(RegisterAPIData);
DECLARE_REFLECTION_STRUCT(APIUseData);
DOCUMENT("Information about why the target is busy.");
struct BusyData
{
DOCUMENT("The name of the client currently connected to the target.");
rdcstr ClientName;
rdcstr clientName;
};
DECLARE_REFLECTION_STRUCT(BusyData);
@@ -449,7 +452,7 @@ DOCUMENT("Information about a new child process spawned by the target.");
struct NewChildData
{
DOCUMENT("The PID (Process ID) of the new child.");
uint32_t PID = 0;
uint32_t processId = 0;
DOCUMENT("The ident where the new child's target control is active.");
uint32_t ident = 0;
};
@@ -460,16 +463,16 @@ DOCUMENT("A message from a target control connection.");
struct TargetControlMessage
{
DOCUMENT("The :class:`type <TargetControlMessageType>` of message received");
TargetControlMessageType Type = TargetControlMessageType::Unknown;
TargetControlMessageType type = TargetControlMessageType::Unknown;
DOCUMENT("The :class:`new capture data <NewCaptureData>`.");
NewCaptureData NewCapture;
DOCUMENT("The :class:`API registration data <RegisterAPIData>`.");
RegisterAPIData RegisterAPI;
NewCaptureData newCapture;
DOCUMENT("The :class:`API use data <APIUseData>`.");
APIUseData apiUse;
DOCUMENT("The :class:`busy signal data <BusyData>`.");
BusyData Busy;
DOCUMENT("The :class:`new child process data <NewChild>`.");
NewChildData NewChild;
BusyData busy;
DOCUMENT("The :class:`new child process data <NewChildData>`.");
NewChildData newChild;
};
DECLARE_REFLECTION_STRUCT(TargetControlMessage);
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+86 -93
View File
@@ -169,7 +169,7 @@ struct ResourceFormat
)");
bool Special() const { return type != ResourceFormatType::Regular; }
DOCUMENT(R"(The :class:`ResourceFormatType` of this format. If the value is not
:data:`ResourceFormatType.Regular` then it's a non-uniform layout like block-compressed.
:attr:`ResourceFormatType.Regular` then it's a non-uniform layout like block-compressed.
)");
ResourceFormatType type;
@@ -194,7 +194,7 @@ struct TextureFilter
DOCUMENT("");
bool operator==(const TextureFilter &o) const
{
return minify == o.minify && magnify == o.magnify && mip == o.mip && func == o.func;
return minify == o.minify && magnify == o.magnify && mip == o.mip && filter == o.filter;
}
bool operator<(const TextureFilter &o) const
{
@@ -204,8 +204,8 @@ struct TextureFilter
return magnify < o.magnify;
if(!(mip == o.mip))
return mip < o.mip;
if(!(func == o.func))
return func < o.func;
if(!(filter == o.filter))
return filter < o.filter;
return false;
}
DOCUMENT("The :class:`FilterMode` to use when minifying the texture.");
@@ -214,8 +214,8 @@ struct TextureFilter
FilterMode magnify = FilterMode::NoFilter;
DOCUMENT("The :class:`FilterMode` to use when interpolating between mips.");
FilterMode mip = FilterMode::NoFilter;
DOCUMENT("The :class:`FilterFunc` to apply after interpolating values.");
FilterFunc func = FilterFunc::Normal;
DOCUMENT("The :class:`FilterFunction` to apply after interpolating values.");
FilterFunction filter = FilterFunction::Normal;
};
DECLARE_REFLECTION_STRUCT(TextureFilter);
@@ -224,10 +224,10 @@ DOCUMENT("A description of any type of resource.");
struct ResourceDescription
{
DOCUMENT("");
bool operator==(const ResourceDescription &o) const { return ID == o.ID; }
bool operator<(const ResourceDescription &o) const { return ID < o.ID; }
bool operator==(const ResourceDescription &o) const { return resourceId == o.resourceId; }
bool operator<(const ResourceDescription &o) const { return resourceId < o.resourceId; }
DOCUMENT("The unique :class:`ResourceId` that identifies this resource.");
ResourceId ID;
ResourceId resourceId;
DOCUMENT("The :class:`ResourceType` of the resource.");
ResourceType type = ResourceType::Unknown;
@@ -280,12 +280,12 @@ struct BufferDescription
DOCUMENT("");
bool operator==(const BufferDescription &o) const
{
return ID == o.ID && creationFlags == o.creationFlags && length == o.length;
return resourceId == o.resourceId && creationFlags == o.creationFlags && length == o.length;
}
bool operator<(const BufferDescription &o) const
{
if(!(ID == o.ID))
return ID < o.ID;
if(!(resourceId == o.resourceId))
return resourceId < o.resourceId;
if(!(creationFlags == o.creationFlags))
return creationFlags < o.creationFlags;
if(!(length == o.length))
@@ -293,7 +293,7 @@ struct BufferDescription
return false;
}
DOCUMENT("The unique :class:`ResourceId` that identifies this buffer.");
ResourceId ID;
ResourceId resourceId;
DOCUMENT("The way this buffer will be used in the pipeline.");
BufferCategory creationFlags;
@@ -310,8 +310,8 @@ struct TextureDescription
DOCUMENT("");
bool operator==(const TextureDescription &o) const
{
return format == o.format && dimension == o.dimension && resType == o.resType &&
width == o.width && height == o.height && depth == o.depth && ID == o.ID &&
return format == o.format && dimension == o.dimension && type == o.type && width == o.width &&
height == o.height && depth == o.depth && resourceId == o.resourceId &&
cubemap == o.cubemap && mips == o.mips && arraysize == o.arraysize &&
creationFlags == o.creationFlags && msQual == o.msQual && msSamp == o.msSamp &&
byteSize == o.byteSize;
@@ -322,16 +322,16 @@ struct TextureDescription
return format < o.format;
if(!(dimension == o.dimension))
return dimension < o.dimension;
if(!(resType == o.resType))
return resType < o.resType;
if(!(type == o.type))
return type < o.type;
if(!(width == o.width))
return width < o.width;
if(!(height == o.height))
return height < o.height;
if(!(depth == o.depth))
return depth < o.depth;
if(!(ID == o.ID))
return ID < o.ID;
if(!(resourceId == o.resourceId))
return resourceId < o.resourceId;
if(!(cubemap == o.cubemap))
return cubemap < o.cubemap;
if(!(mips == o.mips))
@@ -354,8 +354,8 @@ struct TextureDescription
DOCUMENT("The base dimension of the texture - either 1, 2, or 3.");
uint32_t dimension;
DOCUMENT("The :class:`TextureDim` of the texture.");
TextureDim resType;
DOCUMENT("The :class:`TextureType` of the texture.");
TextureType type;
DOCUMENT("The width of the texture, or length for buffer textures.");
uint32_t width;
@@ -366,8 +366,8 @@ struct TextureDescription
DOCUMENT("The depth of the texture, or 1 if not applicable.");
uint32_t depth;
DOCUMENT("The unique :class:`ResourceId` that identifies this buffer.");
ResourceId ID;
DOCUMENT("The unique :class:`ResourceId` that identifies this texture.");
ResourceId resourceId;
DOCUMENT("``True`` if this texture is used as a cubemap or cubemap array.");
bool cubemap;
@@ -397,23 +397,23 @@ DOCUMENT("An individual API-level event, generally corresponds one-to-one with a
struct APIEvent
{
DOCUMENT("");
bool operator==(const APIEvent &o) const { return eventID == o.eventID; }
bool operator<(const APIEvent &o) const { return eventID < o.eventID; }
DOCUMENT(R"(The API event's Event ID (EID).
bool operator==(const APIEvent &o) const { return eventId == o.eventId; }
bool operator<(const APIEvent &o) const { return eventId < o.eventId; }
DOCUMENT(R"(The API event's Event ID.
This is a 1-based count of API events in the capture. The EID is used as a reference point in
This is a 1-based count of API events in the capture. The eventId is used as a reference point in
many places in the API to represent where in the capture the 'current state' is, and to perform
analysis in reference to the state at a particular point in the frame.
EIDs are always increasing and positive, but they may not be contiguous - in some circumstances
eventIds are always increasing and positive, but they may not be contiguous - in some circumstances
there may be gaps if some events are consumed entirely internally, such as debug marker pops which
only modify the internal drawcall tree structures.
Also EIDs may not correspond directly to an actual function call - sometimes a function such as a
multi draw indirect will be one function call that expands to multiple events to allow inspection of
results part way through the multi draw.
Also eventIds may not correspond directly to an actual function call - sometimes a function such as
a multi draw indirect will be one function call that expands to multiple events to allow inspection
of results part way through the multi draw.
)");
uint32_t eventID;
uint32_t eventId;
DOCUMENT("A list of addresses in the CPU callstack where this function was called.");
rdcarray<uint64_t> callstack;
@@ -437,13 +437,13 @@ struct DebugMessage
DOCUMENT("");
bool operator==(const DebugMessage &o) const
{
return eventID == o.eventID && category == o.category && severity == o.severity &&
return eventId == o.eventId && category == o.category && severity == o.severity &&
source == o.source && messageID == o.messageID && description == o.description;
}
bool operator<(const DebugMessage &o) const
{
if(!(eventID == o.eventID))
return eventID < o.eventID;
if(!(eventId == o.eventId))
return eventId < o.eventId;
if(!(category == o.category))
return category < o.category;
if(!(severity == o.severity))
@@ -456,8 +456,8 @@ struct DebugMessage
return description < o.description;
return false;
}
DOCUMENT("The :data:`EID <APIEvent.eventID>` where this debug message was found.");
uint32_t eventID;
DOCUMENT("The :data:`eventId <APIEvent.eventId>` where this debug message was found.");
uint32_t eventId;
DOCUMENT("The :class:`category <MessageCategory>` of this debug message.");
MessageCategory category;
@@ -559,7 +559,7 @@ struct ResourceBindStats
DOCUMENT("How many objects were unbound.");
uint32_t nulls;
DOCUMENT(R"(A list with one element for each type in :class:`TextureDim`.
DOCUMENT(R"(A list with one element for each type in :class:`TextureType`.
The Nth element contains the number of times a resource of that type was bound.
)");
@@ -595,7 +595,7 @@ struct ResourceUpdateStats
DOCUMENT("How many of :data:`calls` were batched updates written in the command queue.");
uint32_t servers;
DOCUMENT(R"(A list with one element for each type in :class:`TextureDim`.
DOCUMENT(R"(A list with one element for each type in :class:`TextureType`.
The Nth element contains the number of times a resource of that type was updated.
)");
@@ -904,23 +904,24 @@ this counts the frame number when the capture was made.
DECLARE_REFLECTION_STRUCT(FrameDescription);
DOCUMENT("Describes a particular use of a resource at a specific :data:`EID <APIEvent.eventID>`.");
DOCUMENT(
"Describes a particular use of a resource at a specific :data:`eventId <APIEvent.eventId>`.");
struct EventUsage
{
DOCUMENT("");
EventUsage() : eventID(0), usage(ResourceUsage::Unused) {}
EventUsage(uint32_t e, ResourceUsage u) : eventID(e), usage(u) {}
EventUsage(uint32_t e, ResourceUsage u, ResourceId v) : eventID(e), usage(u), view(v) {}
EventUsage() : eventId(0), usage(ResourceUsage::Unused) {}
EventUsage(uint32_t e, ResourceUsage u) : eventId(e), usage(u) {}
EventUsage(uint32_t e, ResourceUsage u, ResourceId v) : eventId(e), usage(u), view(v) {}
bool operator<(const EventUsage &o) const
{
if(!(eventID == o.eventID))
return eventID < o.eventID;
if(!(eventId == o.eventId))
return eventId < o.eventId;
return usage < o.usage;
}
bool operator==(const EventUsage &o) const { return eventID == o.eventID && usage == o.usage; }
DOCUMENT("The :data:`EID <APIEvent.eventID>` where this usage happened.");
uint32_t eventID;
bool operator==(const EventUsage &o) const { return eventId == o.eventId && usage == o.usage; }
DOCUMENT("The :data:`eventId <APIEvent.eventId>` where this usage happened.");
uint32_t eventId;
DOCUMENT("The :class:`ResourceUsage` in question.");
ResourceUsage usage;
@@ -938,8 +939,8 @@ struct DrawcallDescription
DOCUMENT("Resets the drawcall back to a default/empty state.");
void Reset()
{
eventID = 0;
drawcallID = 0;
eventId = 0;
drawcallId = 0;
flags = DrawFlags::NoFlags;
markerColor[0] = markerColor[1] = markerColor[2] = markerColor[3] = 0.0f;
numIndices = 0;
@@ -967,12 +968,12 @@ struct DrawcallDescription
depthOut = ResourceId();
}
DOCUMENT("");
bool operator==(const DrawcallDescription &o) const { return eventID == o.eventID; }
bool operator<(const DrawcallDescription &o) const { return eventID < o.eventID; }
DOCUMENT("The :data:`EID <APIEvent.eventID>` that actually produced the drawcall.");
uint32_t eventID;
bool operator==(const DrawcallDescription &o) const { return eventId == o.eventId; }
bool operator<(const DrawcallDescription &o) const { return eventId < o.eventId; }
DOCUMENT("The :data:`eventId <APIEvent.eventId>` that actually produced the drawcall.");
uint32_t eventId;
DOCUMENT("A 1-based index of this drawcall relative to other drawcalls.");
uint32_t drawcallID;
uint32_t drawcallId;
DOCUMENT(R"(The name of this drawcall. Typically a summarised/concise list of parameters.
@@ -984,7 +985,7 @@ struct DrawcallDescription
DOCUMENT("A set of :class:`DrawFlags` properties describing what kind of drawcall this is.");
DrawFlags flags;
DOCUMENT("A RGBA colour specified by a debug marker call.");
DOCUMENT("A RGBA color specified by a debug marker call.");
float markerColor[4];
DOCUMENT("The number of indices or vertices as appropriate for the drawcall. 0 if not used.");
@@ -1030,21 +1031,21 @@ operation.
)");
ResourceId copyDestination;
DOCUMENT(R"(The :data:`EID <APIEvent.eventID>` of the parent of this drawcall, or ``0`` if there
DOCUMENT(R"(The :data:`eventId <APIEvent.eventId>` of the parent of this drawcall, or ``0`` if there
is no parent for this drawcall.
)");
int64_t parent;
DOCUMENT(R"(The :data:`EID <APIEvent.eventID>` of the previous drawcall in the frame, or ``0`` if
DOCUMENT(R"(The :data:`eventId <APIEvent.eventId>` of the previous drawcall in the frame, or ``0`` if
this is the first drawcall in the frame.
)");
int64_t previous;
DOCUMENT(R"(The :data:`EID <APIEvent.eventID>` of the next drawcall in the frame, or ``0`` if this
DOCUMENT(R"(The :data:`eventId <APIEvent.eventId>` of the next drawcall in the frame, or ``0`` if this
is the last drawcall in the frame.
)");
int64_t next;
DOCUMENT(R"(A simple list of the :class:`ResourceId` ids for the colour outputs, which can be used
DOCUMENT(R"(A simple list of the :class:`ResourceId` ids for the color outputs, which can be used
for very coarse bucketing of drawcalls into similar passes by their outputs.
)");
ResourceId outputs[8];
@@ -1128,7 +1129,7 @@ struct CounterDescription
.. note:: The value may not correspond to any of the predefined values if it's a hardware-specific
counter value.
)");
GPUCounter counterID;
GPUCounter counter;
DOCUMENT("A short human-readable name for the counter.");
rdcstr name;
@@ -1174,20 +1175,14 @@ DECLARE_REFLECTION_STRUCT(CounterValue);
DOCUMENT("The resulting value from a counter at an event.");
struct CounterResult
{
CounterResult() : eventID(0), counterID(GPUCounter::EventGPUDuration) { value.u64 = 0; }
CounterResult(uint32_t EID, GPUCounter c, float data) : eventID(EID), counterID(c)
{
value.f = data;
}
CounterResult(uint32_t EID, GPUCounter c, double data) : eventID(EID), counterID(c)
{
value.d = data;
}
CounterResult(uint32_t EID, GPUCounter c, uint32_t data) : eventID(EID), counterID(c)
CounterResult() : eventId(0), counter(GPUCounter::EventGPUDuration) { value.u64 = 0; }
CounterResult(uint32_t e, GPUCounter c, float data) : eventId(e), counter(c) { value.f = data; }
CounterResult(uint32_t e, GPUCounter c, double data) : eventId(e), counter(c) { value.d = data; }
CounterResult(uint32_t e, GPUCounter c, uint32_t data) : eventId(e), counter(c)
{
value.u32 = data;
}
CounterResult(uint32_t EID, GPUCounter c, uint64_t data) : eventID(EID), counterID(c)
CounterResult(uint32_t e, GPUCounter c, uint64_t data) : eventId(e), counter(c)
{
value.u64 = data;
}
@@ -1195,10 +1190,10 @@ struct CounterResult
DOCUMENT("Compares two ``CounterResult`` objects for less-than.");
bool operator<(const CounterResult &o) const
{
if(!(eventID == o.eventID))
return eventID < o.eventID;
if(!(counterID == o.counterID))
return counterID < o.counterID;
if(!(eventId == o.eventId))
return eventId < o.eventId;
if(!(counter == o.counter))
return counter < o.counter;
// don't compare values, just consider equal
return false;
@@ -1207,15 +1202,15 @@ struct CounterResult
DOCUMENT("Compares two ``CounterResult`` objects for equality.");
bool operator==(const CounterResult &o) const
{
// don't compare values, just consider equal by EID/counterID
return eventID == o.eventID && counterID == o.counterID;
// don't compare values, just consider equal by eventId/counterID
return eventId == o.eventId && counter == o.counter;
}
DOCUMENT("The :data:`EID <APIEvent.eventID>` that produced this value.");
uint32_t eventID;
DOCUMENT("The :data:`eventId <APIEvent.eventId>` that produced this value.");
uint32_t eventId;
DOCUMENT("The :data:`counter <GPUCounter>` that produced this value.");
GPUCounter counterID;
GPUCounter counter;
DOCUMENT("The value itself.");
CounterValue value;
@@ -1227,13 +1222,11 @@ DOCUMENT("The contents of an RGBA pixel.");
union PixelValue
{
DOCUMENT("The RGBA value interpreted as ``float``.");
float value_f[4];
float floatValue[4];
DOCUMENT("The RGBA value interpreted as 32-bit unsigned integer.");
uint32_t value_u[4];
uint32_t uintValue[4];
DOCUMENT("The RGBA value interpreted as 32-bit signed integer.");
int32_t value_i[4];
DOCUMENT("The RGBA value interpreted as 16-bit unsigned integer.");
uint16_t value_u16[4];
int32_t intValue[4];
};
DECLARE_REFLECTION_STRUCT(PixelValue);
@@ -1256,7 +1249,7 @@ struct ModificationValue
return stencil < o.stencil;
return false;
}
DOCUMENT("The colour value.");
DOCUMENT("The color value.");
PixelValue col;
DOCUMENT("The depth output, as a ``float``.");
@@ -1274,7 +1267,7 @@ struct PixelModification
DOCUMENT("");
bool operator==(const PixelModification &o) const
{
return eventID == o.eventID && directShaderWrite == o.directShaderWrite &&
return eventId == o.eventId && directShaderWrite == o.directShaderWrite &&
unboundPS == o.unboundPS && fragIndex == o.fragIndex && primitiveID == o.primitiveID &&
preMod == o.preMod && shaderOut == o.shaderOut && postMod == o.postMod &&
sampleMasked == o.sampleMasked && backfaceCulled == o.backfaceCulled &&
@@ -1284,8 +1277,8 @@ struct PixelModification
}
bool operator<(const PixelModification &o) const
{
if(!(eventID == o.eventID))
return eventID < o.eventID;
if(!(eventId == o.eventId))
return eventId < o.eventId;
if(!(directShaderWrite == o.directShaderWrite))
return directShaderWrite < o.directShaderWrite;
if(!(unboundPS == o.unboundPS))
@@ -1318,8 +1311,8 @@ struct PixelModification
return stencilTestFailed < o.stencilTestFailed;
return false;
}
DOCUMENT("The :data:`EID <APIEvent.eventID>` where the modification happened.");
uint32_t eventID;
DOCUMENT("The :data:`eventId <APIEvent.eventId>` where the modification happened.");
uint32_t eventId;
DOCUMENT("``True`` if this event came as part of an arbitrary shader write.");
bool directShaderWrite;
@@ -1370,7 +1363,7 @@ pixel.
:return: ``True`` if it passed all tests, ``False`` if it failed any.
:rtype: ``bool``
)");
bool passed() const
bool Passed() const
{
return !sampleMasked && !backfaceCulled && !depthClipped && !viewClipped && !scissorClipped &&
!shaderDiscarded && !depthTestFailed && !stencilTestFailed && !predicationSkipped;
File diff suppressed because it is too large. Load diff
+37 -37
View File
@@ -444,11 +444,11 @@ Should only be called for texture outputs.
:param WindowingSystem system: The type of native window handle data being provided.
:param data: The native window data, in a format defined by the system.
:type data: opaque void * pointer.
:param ResourceId texID: The texture ID to display in the thumbnail preview.
:param ResourceId textureId: The texture ID to display in the thumbnail preview.
:return: A boolean indicating if the thumbnail was successfully created.
:rtype: ``bool``
)");
virtual bool AddThumbnail(WindowingSystem system, void *data, ResourceId texID,
virtual bool AddThumbnail(WindowingSystem system, void *data, ResourceId textureId,
CompType typeHint) = 0;
DOCUMENT(R"(Render to the window handle specified when the output was created.
@@ -533,7 +533,7 @@ Should only be called for texture outputs.
Should only be called for texture outputs.
:param ResourceId texID: The texture to pick the pixel from.
:param ResourceId textureId: The texture to pick the pixel from.
:param bool customShader: Whether to apply the configured custom shader.
:param int x: The x co-ordinate to pick from.
:param int y: The y co-ordinate to pick from.
@@ -543,7 +543,7 @@ Should only be called for texture outputs.
:return: The contents of the pixel.
:rtype: PixelValue
)");
virtual PixelValue PickPixel(ResourceId texID, bool customShader, uint32_t x, uint32_t y,
virtual PixelValue PickPixel(ResourceId textureId, bool customShader, uint32_t x, uint32_t y,
uint32_t sliceFace, uint32_t mip, uint32_t sample) = 0;
DOCUMENT(R"(Retrieves the vertex and instance that is under the cursor location, when viewed
@@ -551,14 +551,14 @@ relative to the current window with the current mesh display configuration.
Should only be called for mesh outputs.
:param int eventID: The event ID to pick at.
:param int eventId: The event ID to pick at.
:param int x: The x co-ordinate to pick from.
:param int y: The y co-ordinate to pick from.
:return: A tuple with the first value being the vertex index in the mesh, and the second value being
the instance index. The values are set to :data:`NoResult` if no vertex was found,
:rtype: ``tuple`` of ``int`` and ``int``
)");
virtual rdcpair<uint32_t, uint32_t> PickVertex(uint32_t eventID, uint32_t x, uint32_t y) = 0;
virtual rdcpair<uint32_t, uint32_t> PickVertex(uint32_t eventId, uint32_t x, uint32_t y) = 0;
static const uint32_t NoResult = ~0U;
@@ -572,7 +572,7 @@ well as control the replay and analysis functionality available.
.. data:: NoPreference
No preference for a particular value, see :meth:`DebugPixel`.
No preference for a particular value, see :meth:`ReplayController.DebugPixel`.
)");
struct IReplayController
{
@@ -607,7 +607,7 @@ struct IReplayController
DOCUMENT(R"(Goes into a blocking loop, repeatedly replaying the open capture as fast as possible,
displaying the selected texture in a default unscaled manner to the given output window.
The function won't return until :meth:`CancelLoop` is called. Since this function is blocking, that
The function won't return until :meth:`CancelReplayLoop` is called. Since this function is blocking, that
function must be called from another thread.
:param WindowingSystem system: The type of native window handle data being provided
@@ -624,51 +624,51 @@ function must be called from another thread.
virtual void FileChanged() = 0;
DOCUMENT(R"(Move the replay to reflect the state immediately *after* the given
:data:`EID <APIEvent.eventID>`.
:data:`eventId <APIEvent.eventId>`.
:param int eventID: The :data:`EID <APIEvent.eventID>` to move to.
:param bool force: ``True`` if the internal replay should refresh even if the ``eventID`` is
:param int eventId: The :data:`eventId <APIEvent.eventId>` to move to.
:param bool force: ``True`` if the internal replay should refresh even if the ``eventId`` is
already current. This can be useful if external factors might cause the replay to vary.
)");
virtual void SetFrameEvent(uint32_t eventID, bool force) = 0;
virtual void SetFrameEvent(uint32_t eventId, bool force) = 0;
DOCUMENT(R"(Retrieve the current :class:`D3D11_State` pipeline state.
DOCUMENT(R"(Retrieve the current :class:`D3D11State` pipeline state.
This pipeline state will be filled with default values if the capture is not using the D3D11 API.
You should use :meth:`GetAPIProperties` to determine the API of the capture.
:return: The current D3D11 pipeline state.
:rtype: D3D11_State
:rtype: D3D11State
)");
virtual const D3D11Pipe::State &GetD3D11PipelineState() = 0;
DOCUMENT(R"(Retrieve the current :class:`D3D12_State` pipeline state.
DOCUMENT(R"(Retrieve the current :class:`D3D12State` pipeline state.
This pipeline state will be filled with default values if the capture is not using the D3D12 API.
You should use :meth:`GetAPIProperties` to determine the API of the capture.
:return: The current D3D12 pipeline state.
:rtype: D3D12_State
:rtype: D3D12State
)");
virtual const D3D12Pipe::State &GetD3D12PipelineState() = 0;
DOCUMENT(R"(Retrieve the current :class:`GL_State` pipeline state.
DOCUMENT(R"(Retrieve the current :class:`GLState` pipeline state.
This pipeline state will be filled with default values if the capture is not using the OpenGL API.
You should use :meth:`GetAPIProperties` to determine the API of the capture.
:return: The current OpenGL pipeline state.
:rtype: GL_State
:rtype: GLState
)");
virtual const GLPipe::State &GetGLPipelineState() = 0;
DOCUMENT(R"(Retrieve the current :class:`VK_State` pipeline state.
DOCUMENT(R"(Retrieve the current :class:`VKState` pipeline state.
This pipeline state will be filled with default values if the capture is not using the Vulkan API.
You should use :meth:`GetAPIProperties` to determine the API of the capture.
:return: The current Vulkan pipeline state.
:rtype: VK_State
:rtype: VKState
)");
virtual const VKPipe::State &GetVulkanPipelineState() = 0;
@@ -698,7 +698,7 @@ or hardware-specific ISA formats.
The language used is native to the local renderer - HLSL for D3D based renderers, GLSL otherwise.
See :data:`TextureDisplay.CustomShader`.
See :data:`TextureDisplay.customShaderId`.
:param str entry: The entry point to use when compiling.
:param str source: The source file.
@@ -804,11 +804,11 @@ implementation.
DOCUMENT(R"(Get information about what a counter actually represents, in terms of a human-readable
understanding as well as the type and unit of the resulting information.
:param GPUCounter counterID: The counter to query about.
:param GPUCounter counter: The counter to query about.
:return: The description of the counter.
:rtype: CounterDescription
)");
virtual CounterDescription DescribeCounter(GPUCounter counterID) = 0;
virtual CounterDescription DescribeCounter(GPUCounter counter) = 0;
DOCUMENT(R"(Retrieve the list of all resources in the capture.
@@ -939,7 +939,7 @@ otherwise.
:param ResourceId shader: The id of the shader to use for metadata.
:param str entryPoint: The entry point of the shader being used. In some APIs, this is ignored.
:param int cbufslot: The index in the :data:`ShaderReflection.ConstantBlocks` list to look up.
:param int cbufslot: The index in the :data:`ShaderReflection.constantBlocks` list to look up.
:param ResourceId buffer: The id of the buffer to use for data. If
:data:`ConstantBlock.bufferBacked` is ``False`` this is ignored.
:param int offs: Retrieve buffer contents starting at this byte offset.
@@ -963,12 +963,12 @@ texture to something compatible with the target file format.
DOCUMENT(R"(Retrieve the generated data from one of the geometry processing shader stages.
:param int instID: The index of the instance to retrieve data for.
:param int instance: The index of the instance to retrieve data for.
:param MeshDataStage stage: The stage of the geometry processing pipeline to retrieve data from.
:return: The information describing where the post-transform data is stored.
:rtype: MeshFormat
)");
virtual MeshFormat GetPostVSData(uint32_t instID, MeshDataStage stage) = 0;
virtual MeshFormat GetPostVSData(uint32_t instance, MeshDataStage stage) = 0;
DOCUMENT(R"(Retrieve the contents of a range of a buffer as a ``bytes``.
@@ -1065,16 +1065,16 @@ begin a capture is begun, and it ends when this frame number ends.
DOCUMENT(R"(Begin copying a given capture stored on a remote machine to the local machine over the
target control connection.
:param int remoteID: The identifier of the remote capture.
:param int captureId: The identifier of the remote capture.
:param str localpath: The absolute path on the local system where the file should be saved.
)");
virtual void CopyCapture(uint32_t remoteID, const char *localpath) = 0;
virtual void CopyCapture(uint32_t captureId, const char *localpath) = 0;
DOCUMENT(R"(Delete a capture from the remote machine.
:param int remoteID: The identifier of the remote capture.
:param int captureId: The identifier of the remote capture.
)");
virtual void DeleteCapture(uint32_t remoteID) = 0;
virtual void DeleteCapture(uint32_t captureId) = 0;
DOCUMENT(R"(Query to see if a message has been received from the remote system.
@@ -1134,7 +1134,7 @@ This index should not be cached, as writing sections could re-order the indices.
:param int index: The index of the section.
:return: The properties of the section, if the index is valid.
:rtype: SectionProperties.
:rtype: SectionProperties
)");
virtual SectionProperties GetSectionProperties(int index) = 0;
@@ -1199,7 +1199,7 @@ much work as possible happening on the local machine.
.. data:: NoPreference
No preference for a particular value, see :meth:`DebugPixel`.
No preference for a particular value, see :meth:`ReplayController.DebugPixel`.
)");
struct IRemoteServer : public ICaptureAccess
{
@@ -1459,8 +1459,8 @@ replay support.
This function may only be called if the handle is 'empty' - i.e. no file has been opened with
:meth:`OpenFile` or :meth:`OpenBuffer`.
.. note:: The only supported values for :paramref:`SetMetadata.thumbType` are :data:`FileType.JPG`,
:data:`FileType.PNG`, :data:`FileType.TGA`, and :data:`FileType.BMP`.
.. note:: The only supported values for :paramref:`SetMetadata.thumbType` are :attr:`FileType.JPG`,
:attr:`FileType.PNG`, :attr:`FileType.TGA`, and :attr:`FileType.BMP`.
:param str driverName: The name of the driver. Must be a recognised driver name (even if replay
support for that driver is not compiled in locally.
@@ -1518,8 +1518,8 @@ The data is copied internally so it can be destroyed after calling this function
DOCUMENT(R"(Retrieves the embedded thumbnail from the capture.
.. note:: The only supported values for :paramref:`GetThumbnail.type` are :data:`FileType.JPG`,
:data:`FileType.PNG`, :data:`FileType.TGA`, and :data:`FileType.BMP`.
.. note:: The only supported values for :paramref:`GetThumbnail.type` are :attr:`FileType.JPG`,
:attr:`FileType.PNG`, :attr:`FileType.TGA`, and :attr:`FileType.BMP`.
:param FileType type: The image format to convert the thumbnail to.
:param int maxsize: The largest width or height allowed. If the thumbnail is larger, it's resized.
@@ -1685,7 +1685,7 @@ This function returns a new handle to a capture file. Once initialised by openin
can only be shut-down, it is not re-usable.
:return: A handle to the specified path.
:rtype: ICaptureFile
:rtype: CaptureFile
)");
extern "C" RENDERDOC_API ICaptureFile *RENDERDOC_CC RENDERDOC_OpenCaptureFile();
+12 -12
View File
@@ -252,9 +252,9 @@ std::string DoStringise(const FilterMode &el)
}
template <>
std::string DoStringise(const FilterFunc &el)
std::string DoStringise(const FilterFunction &el)
{
BEGIN_ENUM_STRINGISE(FilterFunc)
BEGIN_ENUM_STRINGISE(FilterFunction)
{
STRINGISE_ENUM_CLASS(Normal);
STRINGISE_ENUM_CLASS(Comparison);
@@ -265,9 +265,9 @@ std::string DoStringise(const FilterFunc &el)
}
template <>
std::string DoStringise(const CompareFunc &el)
std::string DoStringise(const CompareFunction &el)
{
BEGIN_ENUM_STRINGISE(CompareFunc)
BEGIN_ENUM_STRINGISE(CompareFunction)
{
STRINGISE_ENUM_CLASS_NAMED(Never, "Never");
STRINGISE_ENUM_CLASS_NAMED(AlwaysTrue, "Always");
@@ -310,9 +310,9 @@ std::string DoStringise(const BlendMultiplier &el)
}
template <>
std::string DoStringise(const BlendOp &el)
std::string DoStringise(const BlendOperation &el)
{
BEGIN_ENUM_STRINGISE(BlendOp)
BEGIN_ENUM_STRINGISE(BlendOperation)
{
STRINGISE_ENUM_CLASS_NAMED(Add, "Add");
STRINGISE_ENUM_CLASS_NAMED(Subtract, "Subtract");
@@ -324,9 +324,9 @@ std::string DoStringise(const BlendOp &el)
}
template <>
std::string DoStringise(const StencilOp &el)
std::string DoStringise(const StencilOperation &el)
{
BEGIN_ENUM_STRINGISE(StencilOp)
BEGIN_ENUM_STRINGISE(StencilOperation)
{
STRINGISE_ENUM_CLASS_NAMED(Keep, "Keep");
STRINGISE_ENUM_CLASS_NAMED(Zero, "Zero");
@@ -341,9 +341,9 @@ std::string DoStringise(const StencilOp &el)
}
template <>
std::string DoStringise(const LogicOp &el)
std::string DoStringise(const LogicOperation &el)
{
BEGIN_ENUM_STRINGISE(LogicOp)
BEGIN_ENUM_STRINGISE(LogicOperation)
{
STRINGISE_ENUM_CLASS_NAMED(NoOp, "No-Op");
STRINGISE_ENUM_CLASS_NAMED(Clear, "Clear");
@@ -451,9 +451,9 @@ std::string DoStringise(const ResourceType &el)
}
template <>
std::string DoStringise(const TextureDim &el)
std::string DoStringise(const TextureType &el)
{
BEGIN_ENUM_STRINGISE(TextureDim)
BEGIN_ENUM_STRINGISE(TextureType)
{
STRINGISE_ENUM_CLASS_NAMED(Unknown, "Unknown");
STRINGISE_ENUM_CLASS_NAMED(Buffer, "Buffer");
+21 -21
View File
@@ -254,7 +254,7 @@ DOCUMENT(R"(A texture addressing mode in a single direction (U,V or W).
.. data:: ClampBorder
The texture is clamped such that texture co-ordinates outside the range of ``[0.0, 1.0]`` are set
to the border colour specified in the sampler.
to the border color specified in the sampler.
)");
enum class AddressMode : uint32_t
{
@@ -438,7 +438,7 @@ DOCUMENT(R"(The dimensionality of a texture binding.
A Cubemap texture array.
)");
enum class TextureDim : uint32_t
enum class TextureType : uint32_t
{
Unknown,
First = Unknown,
@@ -456,8 +456,8 @@ enum class TextureDim : uint32_t
Count,
};
ITERABLE_OPERATORS(TextureDim);
DECLARE_REFLECTION_ENUM(TextureDim);
ITERABLE_OPERATORS(TextureType);
DECLARE_REFLECTION_ENUM(TextureType);
DOCUMENT(R"(The type of a shader resource bind.
@@ -2031,7 +2031,7 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh.
.. data:: Solid
The mesh should be rendered in a single flat unshaded colour.
The mesh should be rendered in a single flat unshaded color.
.. data:: Lit
@@ -2039,7 +2039,7 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh.
.. data:: Secondary
The mesh should be rendered using the secondary element as colour.
The mesh should be rendered using the secondary element as color.
)");
enum class SolidShade : uint32_t
@@ -2164,7 +2164,7 @@ DOCUMENT(R"(The function used to process the returned value after interpolation.
Texels that were weight to 0 during interpolation are not included in the max function.
)");
enum class FilterFunc : uint32_t
enum class FilterFunction : uint32_t
{
Normal,
Comparison,
@@ -2172,7 +2172,7 @@ enum class FilterFunc : uint32_t
Maximum,
};
DECLARE_REFLECTION_ENUM(FilterFunc);
DECLARE_REFLECTION_ENUM(FilterFunction);
DOCUMENT(R"(A comparison function to return a ``bool`` result from two inputs ``A`` and ``B``.
@@ -2209,7 +2209,7 @@ DOCUMENT(R"(A comparison function to return a ``bool`` result from two inputs ``
``A != B``
)");
enum class CompareFunc : uint32_t
enum class CompareFunction : uint32_t
{
Never,
AlwaysTrue,
@@ -2221,7 +2221,7 @@ enum class CompareFunc : uint32_t
NotEqual,
};
DECLARE_REFLECTION_ENUM(CompareFunc);
DECLARE_REFLECTION_ENUM(CompareFunction);
DOCUMENT(R"(A stencil operation to apply in stencil processing.
@@ -2257,7 +2257,7 @@ DOCUMENT(R"(A stencil operation to apply in stencil processing.
Invert the bits in the stencil value (bitwise ``NOT``).
)");
enum class StencilOp : uint32_t
enum class StencilOperation : uint32_t
{
Keep,
Zero,
@@ -2269,7 +2269,7 @@ enum class StencilOp : uint32_t
Invert,
};
DECLARE_REFLECTION_ENUM(StencilOp);
DECLARE_REFLECTION_ENUM(StencilOperation);
DOCUMENT(R"(A multiplier on one component in the blend equation.
@@ -2279,7 +2279,7 @@ DOCUMENT(R"(A multiplier on one component in the blend equation.
The "destination" value is the value in the target being blended to.
These values are combined using a given blend operation, see :class:`BlendOp`.
These values are combined using a given blend operation, see :class:`BlendOperation`.
Where a color is referenced, the value depends on where the multiplier appears in the blend
equation. If it is a multiplier on the color component then it refers to the color component. If
@@ -2333,11 +2333,11 @@ DOCUMENT(R"(A multiplier on one component in the blend equation.
.. data:: FactorRGB
The colour components of the fixed blend factor constant.
The color components of the fixed blend factor constant.
.. data:: InvFactorRGB
``1.0`` minus the colour components of the fixed blend factor constant.
``1.0`` minus the color components of the fixed blend factor constant.
.. data:: FactorAlpha
@@ -2388,7 +2388,7 @@ enum class BlendMultiplier : uint32_t
DECLARE_REFLECTION_ENUM(BlendMultiplier);
DOCUMENT(R"(A blending operation to apply in colour blending.
DOCUMENT(R"(A blending operation to apply in color blending.
.. note:: The "source" value is the value written out by the shader.
@@ -2416,7 +2416,7 @@ DOCUMENT(R"(A blending operation to apply in colour blending.
The maximum of the source and destination value.
)");
enum class BlendOp : uint32_t
enum class BlendOperation : uint32_t
{
Add,
Subtract,
@@ -2425,7 +2425,7 @@ enum class BlendOp : uint32_t
Maximum,
};
DECLARE_REFLECTION_ENUM(BlendOp);
DECLARE_REFLECTION_ENUM(BlendOperation);
DOCUMENT(R"(A logical operation to apply when writing texture values to an output.
@@ -2502,7 +2502,7 @@ DOCUMENT(R"(A logical operation to apply when writing texture values to an outpu
The inverted source and destination values are combined with the bitwise ``OR`` operator - i.e.
``(NOT s) OR d``.
)");
enum class LogicOp : uint32_t
enum class LogicOperation : uint32_t
{
NoOp,
Clear,
@@ -2522,7 +2522,7 @@ enum class LogicOp : uint32_t
OrInverted,
};
DECLARE_REFLECTION_ENUM(LogicOp);
DECLARE_REFLECTION_ENUM(LogicOperation);
DOCUMENT(R"(Pre-defined GPU counters that can be supported by a given implementation.
@@ -3382,7 +3382,7 @@ DOCUMENT(R"(A set of flags describing the properties of a particular drawcall.
.. data:: ClearColor
The drawcall clears a colour target.
The drawcall clears a color target.
.. data:: ClearDepthStencil
+87 -89
View File
@@ -273,9 +273,9 @@ struct ShaderDebugTrace
DOCUMENT(R"(Constant variables for this shader as a list of :class:`ShaderValue` lists.
Each entry in this list corresponds to a constant block with the same index in the
:data:`ShaderBindpointMapping.ConstantBlocks` list, which can be used to look up the metadata.
:data:`ShaderBindpointMapping.constantBlocks` list, which can be used to look up the metadata.
)");
rdcarray<ShaderVariable> cbuffers;
rdcarray<ShaderVariable> constantBlocks;
DOCUMENT(R"(A list of :class:`ShaderDebugState` states representing the state after each
instruction was executed
@@ -390,9 +390,9 @@ struct ShaderVariableDescriptor
DOCUMENT("");
bool operator==(const ShaderVariableDescriptor &o) const
{
return type == o.type && rows == o.rows && cols == o.cols &&
return type == o.type && rows == o.rows && columns == o.columns &&
rowMajorStorage == o.rowMajorStorage && elements == o.elements &&
arrayStride == o.arrayStride && name == o.name;
arrayByteStride == o.arrayByteStride && name == o.name;
}
bool operator<(const ShaderVariableDescriptor &o) const
{
@@ -400,14 +400,14 @@ struct ShaderVariableDescriptor
return type < o.type;
if(!(rows == o.rows))
return rows < o.rows;
if(!(cols == o.cols))
return cols < o.cols;
if(!(columns == o.columns))
return columns < o.columns;
if(!(rowMajorStorage == o.rowMajorStorage))
return rowMajorStorage < o.rowMajorStorage;
if(!(elements == o.elements))
return elements < o.elements;
if(!(arrayStride == o.arrayStride))
return arrayStride < o.arrayStride;
if(!(arrayByteStride == o.arrayByteStride))
return arrayByteStride < o.arrayByteStride;
if(!(name == o.name))
return name < o.name;
return false;
@@ -417,13 +417,13 @@ struct ShaderVariableDescriptor
DOCUMENT("The number of rows in this matrix.");
uint8_t rows;
DOCUMENT("The number of columns in this matrix.");
uint8_t cols;
uint8_t columns;
DOCUMENT("``True`` if the matrix is stored as row major instead of column major.");
bool rowMajorStorage;
DOCUMENT("The number of elements in the array, or 1 if it's not an array.");
uint32_t elements;
DOCUMENT("The number of bytes between the start of one element in the array and the next.");
uint32_t arrayStride;
uint32_t arrayByteStride;
DOCUMENT("The name of the type of this constant, e.g. a ``struct`` name.");
rdcstr name;
};
@@ -542,7 +542,7 @@ struct ConstantBlock
DOCUMENT("The constants contained within this block as a list of :class:`ShaderConstant`.");
rdcarray<ShaderConstant> variables;
DOCUMENT(R"(The bindpoint for this block. This is an index in the
:data:`ShaderBindpointMapping.ConstantBlocks` list.
:data:`ShaderBindpointMapping.constantBlocks` list.
)");
int32_t bindPoint;
DOCUMENT("The total number of bytes consumed by all of the constants contained in this block.");
@@ -581,7 +581,7 @@ struct ShaderSampler
rdcstr name;
DOCUMENT(R"(The bindpoint for this block. This is an index in either the
:data:`ShaderBindpointMapping.Samplers` list.
:data:`ShaderBindpointMapping.samplers` list.
)");
int32_t bindPoint;
};
@@ -600,7 +600,7 @@ struct ShaderResource
bool operator==(const ShaderResource &o) const
{
return resType == o.resType && name == o.name && variableType == o.variableType &&
bindPoint == o.bindPoint && IsTexture == o.IsTexture && IsReadOnly == o.IsReadOnly;
bindPoint == o.bindPoint && isTexture == o.isTexture && isReadOnly == o.isReadOnly;
}
bool operator<(const ShaderResource &o) const
{
@@ -612,14 +612,14 @@ struct ShaderResource
return variableType < o.variableType;
if(!(bindPoint == o.bindPoint))
return bindPoint < o.bindPoint;
if(!(IsTexture == o.IsTexture))
return IsTexture < o.IsTexture;
if(!(IsReadOnly == o.IsReadOnly))
return IsReadOnly < o.IsReadOnly;
if(!(isTexture == o.isTexture))
return isTexture < o.isTexture;
if(!(isReadOnly == o.isReadOnly))
return isReadOnly < o.isReadOnly;
return false;
}
DOCUMENT("The :class:`TextureDim` that describes the type of this resource.");
TextureDim resType;
DOCUMENT("The :class:`TextureType` that describes the type of this resource.");
TextureType resType;
DOCUMENT("The name of this resource.");
rdcstr name;
@@ -628,19 +628,17 @@ struct ShaderResource
ShaderVariableType variableType;
DOCUMENT(R"(The bindpoint for this block. This is an index in either the
:data:`ShaderBindpointMapping.ReadOnlyResources` list or
:data:`ShaderBindpointMapping.ReadWriteResources` list as appropriate (see :data:`IsReadOnly`).
:data:`ShaderBindpointMapping.readOnlyResources` list or
:data:`ShaderBindpointMapping.readWriteResources` list as appropriate (see :data:`isReadOnly`).
)");
int32_t bindPoint;
DOCUMENT(R"(``True`` if this resource is a texture, otherwise it is a buffer or sampler (see
:data:`IsSampler`).
)");
bool IsTexture;
DOCUMENT("``True`` if this resource is a texture, otherwise it is a buffer.");
bool isTexture;
DOCUMENT(R"(``True`` if this resource is available to the shader for reading only, otherwise it is
able to be read from and written to arbitrarily.
)");
bool IsReadOnly;
bool isReadOnly;
};
DECLARE_REFLECTION_STRUCT(ShaderResource);
@@ -671,20 +669,20 @@ DOCUMENT("Contains a single flag used at compile-time on a shader.");
struct ShaderCompileFlag
{
DOCUMENT("");
bool operator==(const ShaderCompileFlag &o) const { return Name == o.Name && Value == o.Value; }
bool operator==(const ShaderCompileFlag &o) const { return name == o.name && value == o.value; }
bool operator<(const ShaderCompileFlag &o) const
{
if(!(Name == o.Name))
return Name < o.Name;
if(!(Value == o.Value))
return Value < o.Value;
if(!(name == o.name))
return name < o.name;
if(!(value == o.value))
return value < o.value;
return false;
}
DOCUMENT("The name of the compile flag.");
rdcstr Name;
rdcstr name;
DOCUMENT("The value of the compile flag.");
rdcstr Value;
rdcstr value;
};
DECLARE_REFLECTION_STRUCT(ShaderCompileFlag);
@@ -707,21 +705,21 @@ struct ShaderSourceFile
DOCUMENT("");
bool operator==(const ShaderSourceFile &o) const
{
return Filename == o.Filename && Contents == o.Contents;
return filename == o.filename && contents == o.contents;
}
bool operator<(const ShaderSourceFile &o) const
{
if(!(Filename == o.Filename))
return Filename < o.Filename;
if(!(Contents == o.Contents))
return Contents < o.Contents;
if(!(filename == o.filename))
return filename < o.filename;
if(!(contents == o.contents))
return contents < o.contents;
return false;
}
DOCUMENT("The filename of this source file.");
rdcstr Filename;
rdcstr filename;
DOCUMENT("The actual contents of the file.");
rdcstr Contents;
rdcstr contents;
};
DECLARE_REFLECTION_STRUCT(ShaderSourceFile);
@@ -731,9 +729,9 @@ information attached to the shader.
Primarily this means the embedded original source files.
)");
struct ShaderDebugChunk
struct ShaderDebugInfo
{
ShaderDebugChunk() {}
ShaderDebugInfo() {}
DOCUMENT("A :class:`ShaderCompileFlags` containing the flags used to compile this shader.");
ShaderCompileFlags compileFlags;
@@ -744,7 +742,7 @@ The first entry in the list is always the file where the entry point is.
rdcarray<ShaderSourceFile> files;
};
DECLARE_REFLECTION_STRUCT(ShaderDebugChunk);
DECLARE_REFLECTION_STRUCT(ShaderDebugInfo);
DOCUMENT(R"(The reflection and metadata fully describing a shader.
@@ -755,44 +753,44 @@ and resource binding scheme.
struct ShaderReflection
{
DOCUMENT("The :class:`ResourceId` of this shader.");
ResourceId ID;
ResourceId resourceId;
DOCUMENT("The entry point in the shader for this reflection, if multiple entry points exist.");
rdcstr EntryPoint;
rdcstr entryPoint;
DOCUMENT(
"The :class:`ShaderStage` that this shader corresponds to, if multiple entry points exist.");
ShaderStage Stage;
ShaderStage stage;
DOCUMENT(
"A :class:`ShaderDebugChunk` containing any embedded debugging information in this shader.");
ShaderDebugChunk DebugInfo;
"A :class:`ShaderDebugInfo` containing any embedded debugging information in this shader.");
ShaderDebugInfo debugInfo;
DOCUMENT("A raw ``bytes`` dump of the original shader, encoded in API specific binary form.");
bytebuf RawBytes;
bytebuf rawBytes;
DOCUMENT("The 3D dimensions of a compute workgroup, for compute shaders.");
uint32_t DispatchThreadsDimension[3];
uint32_t dispatchThreadsDimension[3];
DOCUMENT("A list of :class:`SigParameter` with the shader's input signature.");
rdcarray<SigParameter> InputSig;
rdcarray<SigParameter> inputSignature;
DOCUMENT("A list of :class:`SigParameter` with the shader's output signature.");
rdcarray<SigParameter> OutputSig;
rdcarray<SigParameter> outputSignature;
DOCUMENT("A list of :class:`ConstantBlock` with the shader's constant bindings.");
rdcarray<ConstantBlock> ConstantBlocks;
rdcarray<ConstantBlock> constantBlocks;
DOCUMENT("A list of :class:`ShaderSampler` with the shader's samplers.");
rdcarray<ShaderSampler> Samplers;
rdcarray<ShaderSampler> samplers;
DOCUMENT("A list of :class:`ShaderResource` with the shader's read-only resources.");
rdcarray<ShaderResource> ReadOnlyResources;
rdcarray<ShaderResource> readOnlyResources;
DOCUMENT("A list of :class:`ShaderResource` with the shader's read-write resources.");
rdcarray<ShaderResource> ReadWriteResources;
rdcarray<ShaderResource> readWriteResources;
// TODO expand this to encompass shader subroutines.
DOCUMENT("A list of strings with the shader's interfaces. Largely an unused API feature.");
rdcarray<rdcstr> Interfaces;
rdcarray<rdcstr> interfaces;
};
DECLARE_REFLECTION_STRUCT(ShaderReflection);
@@ -801,10 +799,10 @@ DOCUMENT(R"(Declares the binding information for a single resource binding.
See :class:`ShaderBindpointMapping` for how this mapping works in detail.
)");
struct BindpointMap
struct Bindpoint
{
DOCUMENT("");
BindpointMap()
Bindpoint()
{
bindset = 0;
bind = 0;
@@ -812,7 +810,7 @@ struct BindpointMap
arraySize = 1;
}
BindpointMap(int32_t s, int32_t b)
Bindpoint(int32_t s, int32_t b)
{
bindset = s;
bind = b;
@@ -820,13 +818,13 @@ struct BindpointMap
arraySize = 1;
}
bool operator<(const BindpointMap &o) const
bool operator<(const Bindpoint &o) const
{
if(!(bindset == o.bindset))
return bindset < o.bindset;
return bind < o.bind;
}
bool operator==(const BindpointMap &o) const { return bindset == o.bindset && bind == o.bind; }
bool operator==(const Bindpoint &o) const { return bindset == o.bindset && bind == o.bind; }
DOCUMENT("The binding set.");
int32_t bindset;
DOCUMENT("The binding index.");
@@ -838,7 +836,7 @@ struct BindpointMap
bool used;
};
DECLARE_REFLECTION_STRUCT(BindpointMap);
DECLARE_REFLECTION_STRUCT(Bindpoint);
DOCUMENT(R"(This structure goes hand in hand with :class:`ShaderReflection` to determine how to map
from bindpoint indices in the resource lists there to API-specific binding points. The ``bindPoint``
@@ -848,62 +846,62 @@ API registers, indices, or slots.
API specific details:
* Direct3D11 - All :data:`BindpointMap.bindset` values are 0 as D3D11 has no notion of sets, and the
* Direct3D11 - All :data:`Bindpoint.bindset` values are 0 as D3D11 has no notion of sets, and the
only namespacing that exists is by shader stage and object type. Mostly this already exists with
the constant block, read only and read write resource lists.
:data:`BindpointMap.arraySize` is likewise unused as D3D11 doesn't have arrayed resource bindings.
:data:`Bindpoint.arraySize` is likewise unused as D3D11 doesn't have arrayed resource bindings.
:data:`BindpointMap.bind` refers to the register/slot binding within the appropriate type (SRVs for
:data:`Bindpoint.bind` refers to the register/slot binding within the appropriate type (SRVs for
read-only resources, UAV for read-write resources, samplers/constant buffers in each type).
* OpenGL - Similarly to D3D11, :data:`BindpointMap.bindset` and :data:`BindpointMap.arraySize` are
* OpenGL - Similarly to D3D11, :data:`Bindpoint.bindset` and :data:`Bindpoint.arraySize` are
unused as OpenGL does not have true binding sets or array resource binds.
For OpenGL there may be many more duplicate :class:`BindpointMap` objects as the
:data:`BindpointMap.bind` refers to the index in the type-specific list, which is much more
For OpenGL there may be many more duplicate :class:`Bindpoint` objects as the
:data:`Bindpoint.bind` refers to the index in the type-specific list, which is much more
granular on OpenGL. E.g. ``0`` may refer to images, storage buffers, and atomic buffers all within
the :data:`ReadWriteResources` list. The index is the uniform value of the binding. Since no
the :data:`readWriteResources` list. The index is the uniform value of the binding. Since no
objects are namespaced by shader stage, the same value in two shaders refers to the same binding.
* Direct3D12 - Since D3D12 doesn't have true resource arrays (they are linearised into sequential
registers) :data:`BindpointMap.arraySize` is not used.
registers) :data:`Bindpoint.arraySize` is not used.
:data:`BindpointMap.bindset` corresponds to register spaces, with :data:`BindpointMap.bind` then
:data:`Bindpoint.bindset` corresponds to register spaces, with :data:`Bindpoint.bind` then
mapping to the register within that space. The root signature then maps these registers to
descriptors.
* Vulkan - For Vulkan :data:`BindpointMap.bindset` corresponds to the index of the descriptor set,
and :data:`BindpointMap.bind` refers to the index of the descriptor within that set.
:data:`BindpointMap.arraySize` also is used as descriptors in Vulkan can be true arrays, bound all
* Vulkan - For Vulkan :data:`Bindpoint.bindset` corresponds to the index of the descriptor set,
and :data:`Bindpoint.bind` refers to the index of the descriptor within that set.
:data:`Bindpoint.arraySize` also is used as descriptors in Vulkan can be true arrays, bound all
at once to a single binding.
)");
struct ShaderBindpointMapping
{
DOCUMENT(R"(This maps input attributes as a simple swizzle on the
:data:`ShaderReflection.InputSig` indices for APIs where this mapping is mutable at runtime.
:data:`ShaderReflection.inputSignature` indices for APIs where this mapping is mutable at runtime.
)");
rdcarray<int> InputAttributes;
rdcarray<int> inputAttributes;
DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the
:data:`ShaderReflection.ConstantBlocks` list.
DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the
:data:`ShaderReflection.constantBlocks` list.
)");
rdcarray<BindpointMap> ConstantBlocks;
rdcarray<Bindpoint> constantBlocks;
DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the
:data:`ShaderReflection.Samplers` list.
DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the
:data:`ShaderReflection.samplers` list.
)");
rdcarray<BindpointMap> Samplers;
rdcarray<Bindpoint> samplers;
DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the
:data:`ShaderReflection.ReadOnlyResources` list.
DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the
:data:`ShaderReflection.readOnlyResources` list.
)");
rdcarray<BindpointMap> ReadOnlyResources;
rdcarray<Bindpoint> readOnlyResources;
DOCUMENT(R"(Provides a list of :class:`BindpointMap` entries for remapping the
:data:`ShaderReflection.ReadWriteResources` list.
DOCUMENT(R"(Provides a list of :class:`Bindpoint` entries for remapping the
:data:`ShaderReflection.readWriteResources` list.
)");
rdcarray<BindpointMap> ReadWriteResources;
rdcarray<Bindpoint> readWriteResources;
};
DECLARE_REFLECTION_STRUCT(ShaderBindpointMapping);
+3 -3
View File
@@ -341,7 +341,7 @@ struct SDObject
SDObjectData data;
DOCUMENT("Find a child object by a given name.");
inline SDObject *findChild(const char *childName) const
inline SDObject *FindChild(const char *childName) const
{
for(size_t i = 0; i < data.children.size(); i++)
if(data.children[i]->name == childName)
@@ -351,7 +351,7 @@ struct SDObject
}
DOCUMENT("Add a new child object by duplicating it.");
inline void addChild(SDObject *child) { data.children.push_back(child->Duplicate()); }
inline void AddChild(SDObject *child) { data.children.push_back(child->Duplicate()); }
#if defined(RENDERDOC_QT_COMPAT)
operator QVariant() const
{
@@ -646,7 +646,7 @@ struct SDFile
DOCUMENT("The version of this structured stream, typically only used internally.");
uint64_t version = 0;
inline void swap(SDFile &other)
inline void Swap(SDFile &other)
{
chunks.swap(other.chunks);
buffers.swap(other.buffers);
+238 -381
View File
@@ -24,6 +24,8 @@
#pragma once
#include "common_pipestate.h"
namespace VKPipe
{
DOCUMENT("The contents of a single binding element within a descriptor set, possibly in an array.");
@@ -32,30 +34,31 @@ struct BindingElement
DOCUMENT("");
bool operator==(const BindingElement &o) const
{
return view == o.view && res == o.res && sampler == o.sampler &&
immutableSampler == o.immutableSampler && viewfmt == o.viewfmt &&
swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] &&
swizzle[3] == o.swizzle[3] && baseMip == o.baseMip && baseLayer == o.baseLayer &&
numMip == o.numMip && numLayer == o.numLayer && offset == o.offset && size == o.size &&
Filter == o.Filter && AddressU == o.AddressU && AddressV == o.AddressV &&
AddressW == o.AddressW && mipBias == o.mipBias && maxAniso == o.maxAniso &&
comparison == o.comparison && minlod == o.minlod && maxlod == o.maxlod &&
BorderColor[0] == o.BorderColor[0] && BorderColor[1] == o.BorderColor[1] &&
BorderColor[2] == o.BorderColor[2] && BorderColor[3] == o.BorderColor[3] &&
return viewResourceId == o.viewResourceId && resourceResourceId == o.resourceResourceId &&
samplerResourceId == o.samplerResourceId && immutableSampler == o.immutableSampler &&
viewFormat == o.viewFormat && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] &&
swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && firstMip == o.firstMip &&
firstSlice == o.firstSlice && numMips == o.numMips && numSlices == o.numSlices &&
byteOffset == o.byteOffset && byteSize == o.byteSize && filter == o.filter &&
addressU == o.addressU && addressV == o.addressV && addressW == o.addressW &&
mipBias == o.mipBias && maxAnisotropy == o.maxAnisotropy &&
compareFunction == o.compareFunction && minLOD == o.minLOD && maxLOD == o.maxLOD &&
borderColor[0] == o.borderColor[0] && borderColor[1] == o.borderColor[1] &&
borderColor[2] == o.borderColor[2] && borderColor[3] == o.borderColor[3] &&
unnormalized == o.unnormalized;
}
bool operator<(const BindingElement &o) const
{
if(!(view == o.view))
return view < o.view;
if(!(res == o.res))
return res < o.res;
if(!(sampler == o.sampler))
return sampler < o.sampler;
if(!(viewResourceId == o.viewResourceId))
return viewResourceId < o.viewResourceId;
if(!(resourceResourceId == o.resourceResourceId))
return resourceResourceId < o.resourceResourceId;
if(!(samplerResourceId == o.samplerResourceId))
return samplerResourceId < o.samplerResourceId;
if(!(immutableSampler == o.immutableSampler))
return immutableSampler < o.immutableSampler;
if(!(viewfmt == o.viewfmt))
return viewfmt < o.viewfmt;
if(!(viewFormat == o.viewFormat))
return viewFormat < o.viewFormat;
if(!(swizzle[0] == o.swizzle[0]))
return swizzle[0] < o.swizzle[0];
if(!(swizzle[1] == o.swizzle[1]))
@@ -64,97 +67,99 @@ struct BindingElement
return swizzle[2] < o.swizzle[2];
if(!(swizzle[3] == o.swizzle[3]))
return swizzle[3] < o.swizzle[3];
if(!(baseMip == o.baseMip))
return baseMip < o.baseMip;
if(!(baseLayer == o.baseLayer))
return baseLayer < o.baseLayer;
if(!(numMip == o.numMip))
return numMip < o.numMip;
if(!(numLayer == o.numLayer))
return numLayer < o.numLayer;
if(!(offset == o.offset))
return offset < o.offset;
if(!(size == o.size))
return size < o.size;
if(!(Filter == o.Filter))
return Filter < o.Filter;
if(!(AddressU == o.AddressU))
return AddressU < o.AddressU;
if(!(AddressV == o.AddressV))
return AddressV < o.AddressV;
if(!(AddressW == o.AddressW))
return AddressW < o.AddressW;
if(!(firstMip == o.firstMip))
return firstMip < o.firstMip;
if(!(firstSlice == o.firstSlice))
return firstSlice < o.firstSlice;
if(!(numMips == o.numMips))
return numMips < o.numMips;
if(!(numSlices == o.numSlices))
return numSlices < o.numSlices;
if(!(byteOffset == o.byteOffset))
return byteOffset < o.byteOffset;
if(!(byteSize == o.byteSize))
return byteSize < o.byteSize;
if(!(filter == o.filter))
return filter < o.filter;
if(!(addressU == o.addressU))
return addressU < o.addressU;
if(!(addressV == o.addressV))
return addressV < o.addressV;
if(!(addressW == o.addressW))
return addressW < o.addressW;
if(!(mipBias == o.mipBias))
return mipBias < o.mipBias;
if(!(maxAniso == o.maxAniso))
return maxAniso < o.maxAniso;
if(!(comparison == o.comparison))
return comparison < o.comparison;
if(!(minlod == o.minlod))
return minlod < o.minlod;
if(!(maxlod == o.maxlod))
return maxlod < o.maxlod;
if(!(BorderColor[0] == o.BorderColor[0]))
return BorderColor[0] < o.BorderColor[0];
if(!(BorderColor[1] == o.BorderColor[1]))
return BorderColor[1] < o.BorderColor[1];
if(!(BorderColor[2] == o.BorderColor[2]))
return BorderColor[2] < o.BorderColor[2];
if(!(BorderColor[3] == o.BorderColor[3]))
return BorderColor[3] < o.BorderColor[3];
if(!(maxAnisotropy == o.maxAnisotropy))
return maxAnisotropy < o.maxAnisotropy;
if(!(compareFunction == o.compareFunction))
return compareFunction < o.compareFunction;
if(!(minLOD == o.minLOD))
return minLOD < o.minLOD;
if(!(maxLOD == o.maxLOD))
return maxLOD < o.maxLOD;
if(!(borderColor[0] == o.borderColor[0]))
return borderColor[0] < o.borderColor[0];
if(!(borderColor[1] == o.borderColor[1]))
return borderColor[1] < o.borderColor[1];
if(!(borderColor[2] == o.borderColor[2]))
return borderColor[2] < o.borderColor[2];
if(!(borderColor[3] == o.borderColor[3]))
return borderColor[3] < o.borderColor[3];
if(!(unnormalized == o.unnormalized))
return unnormalized < o.unnormalized;
return false;
}
DOCUMENT("The :class:`ResourceId` of the current view object, if one is in use.");
ResourceId view; // bufferview, imageview, attachmentview
ResourceId viewResourceId; // bufferview, imageview, attachmentview
DOCUMENT("The :class:`ResourceId` of the current underlying buffer or image object.");
ResourceId res; // buffer, image, attachment
ResourceId resourceResourceId; // buffer, image, attachment
DOCUMENT("The :class:`ResourceId` of the current sampler object.");
ResourceId sampler;
ResourceId samplerResourceId;
DOCUMENT("``True`` if this is an immutable sampler binding.");
bool immutableSampler = false;
DOCUMENT("The :class:`ResourceFormat` that the view uses.");
ResourceFormat viewfmt;
ResourceFormat viewFormat;
DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture.");
TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue,
TextureSwizzle::Alpha};
DOCUMENT("For textures - the first mip level used in the view.");
uint32_t baseMip = 0;
DOCUMENT("For 3D textures and texture arrays - the first slice used in the view.");
uint32_t baseLayer = 0;
uint32_t firstMip = 0;
DOCUMENT("For textures - the number of mip levels in the view.");
uint32_t numMip = 0;
uint32_t numMips = 0;
DOCUMENT("For 3D textures and texture arrays - the first slice used in the view.");
uint32_t firstSlice = 0;
DOCUMENT("For 3D textures and texture arrays - the number of array slices in the view.");
uint32_t numLayer = 0;
uint32_t numSlices = 0;
DOCUMENT("For buffers - the byte offset where the buffer view starts in the underlying buffer.");
uint64_t offset = 0;
uint64_t byteOffset = 0;
DOCUMENT("For buffers - how many bytes are in this buffer view.");
uint64_t size = 0;
uint64_t byteSize = 0;
DOCUMENT("For samplers - the :class:`TextureFilter` describing the filtering mode.");
TextureFilter Filter;
TextureFilter filter;
DOCUMENT("For samplers - the :class:`AddressMode` in the U direction.");
AddressMode AddressU = AddressMode::Wrap;
AddressMode addressU = AddressMode::Wrap;
DOCUMENT("For samplers - the :class:`AddressMode` in the V direction.");
AddressMode AddressV = AddressMode::Wrap;
AddressMode addressV = AddressMode::Wrap;
DOCUMENT("For samplers - the :class:`AddressMode` in the W direction.");
AddressMode AddressW = AddressMode::Wrap;
AddressMode addressW = AddressMode::Wrap;
DOCUMENT("For samplers - a bias to apply to the calculated mip level before sampling.");
float mipBias = 0.0f;
DOCUMENT("For samplers - the maximum anisotropic filtering level to use.");
float maxAniso = 0.0f;
DOCUMENT("For samplers - the :class:`CompareFunc` for comparison samplers.");
CompareFunc comparison = CompareFunc::AlwaysTrue;
float maxAnisotropy = 0.0f;
DOCUMENT("For samplers - the :class:`CompareFunction` for comparison samplers.");
CompareFunction compareFunction = CompareFunction::AlwaysTrue;
DOCUMENT("For samplers - the minimum mip level that can be used.");
float minlod = 0.0f;
float minLOD = 0.0f;
DOCUMENT("For samplers - the maximum mip level that can be used.");
float maxlod = 0.0f;
float maxLOD = 0.0f;
DOCUMENT("For samplers - the RGBA border color.");
float BorderColor[4];
float borderColor[4];
DOCUMENT("For samplers - ``True`` if unnormalized co-ordinates are used in this sampler.");
bool unnormalized = false;
@@ -165,8 +170,8 @@ struct BindingElement
)");
bool UseBorder() const
{
return AddressU == AddressMode::ClampBorder || AddressV == AddressMode::ClampBorder ||
AddressW == AddressMode::ClampBorder;
return addressU == AddressMode::ClampBorder || addressV == AddressMode::ClampBorder ||
addressW == AddressMode::ClampBorder;
}
};
@@ -200,7 +205,7 @@ If this binding is empty/non-existant this value will be ``0``.
DOCUMENT("The :class:`ShaderStageMask` where this binding is visible.");
ShaderStageMask stageFlags = ShaderStageMask::Unknown;
DOCUMENT(R"(A list of :class:`VK_BindingElement` with the binding elements.
DOCUMENT(R"(A list of :class:`VKBindingElement` with the binding elements.
If :data:`descriptorCount` is 1 then this isn't an array, and this list has only one element.
)");
rdcarray<BindingElement> binds;
@@ -212,24 +217,25 @@ struct DescriptorSet
DOCUMENT("");
bool operator==(const DescriptorSet &o) const
{
return layout == o.layout && descset == o.descset && bindings == o.bindings;
return layoutResourceId == o.layoutResourceId &&
descriptorSetResourceId == o.descriptorSetResourceId && bindings == o.bindings;
}
bool operator<(const DescriptorSet &o) const
{
if(!(layout == o.layout))
return layout < o.layout;
if(!(descset == o.descset))
return descset < o.descset;
if(!(layoutResourceId == o.layoutResourceId))
return layoutResourceId < o.layoutResourceId;
if(!(descriptorSetResourceId == o.descriptorSetResourceId))
return descriptorSetResourceId < o.descriptorSetResourceId;
if(!(bindings == o.bindings))
return bindings < o.bindings;
return false;
}
DOCUMENT("The :class:`ResourceId` of the descriptor set layout that matches this set.");
ResourceId layout;
ResourceId layoutResourceId;
DOCUMENT("The :class:`ResourceId` of the descriptor set object.");
ResourceId descset;
ResourceId descriptorSetResourceId;
DOCUMENT(R"(A list of :class:`VK_DescriptorBinding` with the bindings within this set.
DOCUMENT(R"(A list of :class:`VKDescriptorBinding` with the bindings within this set.
This list is indexed by the binding, so it may be sparse (some entries do not contain any elements).
)");
rdcarray<DescriptorBinding> bindings;
@@ -239,22 +245,24 @@ DOCUMENT("Describes the object and descriptor set bindings of a Vulkan pipeline
struct Pipeline
{
DOCUMENT("The :class:`ResourceId` of the pipeline object.");
ResourceId obj;
ResourceId pipelineResourceId;
DOCUMENT("The :class:`ResourceId` of the pipeline layout object.");
ResourceId pipelineLayoutResourceId;
DOCUMENT("The flags used to create the pipeline object.");
uint32_t flags = 0;
DOCUMENT("A list of :class:`VK_DescriptorSet` with the bound descriptor sets.");
rdcarray<DescriptorSet> DescSets;
DOCUMENT("A list of :class:`VKDescriptorSet` with the bound descriptor sets.");
rdcarray<DescriptorSet> descriptorSets;
};
DOCUMENT("Describes the Vulkan index buffer binding.")
struct IB
struct IndexBuffer
{
DOCUMENT("The :class:`ResourceId` of the index buffer.");
ResourceId buf;
ResourceId resourceId;
DOCUMENT("The byte offset from the start of the buffer to the beginning of the index data.");
uint64_t offs = 0;
uint64_t byteOffset = 0;
};
DOCUMENT("Describes the vulkan input assembly configuration.");
@@ -263,8 +271,8 @@ struct InputAssembly
DOCUMENT("``True`` if primitive restart is enabled for strip primitives.");
bool primitiveRestartEnable = false;
DOCUMENT("The :class:`VK_IB` with the index buffer binding.");
IB ibuffer;
DOCUMENT("The :class:`VKIndexBuffer` with the index buffer binding.");
IndexBuffer indexBuffer;
};
DOCUMENT("Describes the configuration of a single vertex attribute.");
@@ -274,7 +282,7 @@ struct VertexAttribute
bool operator==(const VertexAttribute &o) const
{
return location == o.location && binding == o.binding && format == o.format &&
byteoffset == o.byteoffset;
byteOffset == o.byteOffset;
}
bool operator<(const VertexAttribute &o) const
{
@@ -284,8 +292,8 @@ struct VertexAttribute
return binding < o.binding;
if(!(format == o.format))
return format < o.format;
if(!(byteoffset == o.byteoffset))
return byteoffset < o.byteoffset;
if(!(byteOffset == o.byteOffset))
return byteOffset < o.byteOffset;
return false;
}
DOCUMENT("The location in the shader that is bound to this attribute.");
@@ -297,7 +305,7 @@ struct VertexAttribute
DOCUMENT(
"The byte offset from the start of each vertex data in the :data:`binding` to this "
"attribute.");
uint32_t byteoffset = 0;
uint32_t byteOffset = 0;
};
DOCUMENT("Describes a vertex binding.");
@@ -306,72 +314,78 @@ struct VertexBinding
DOCUMENT("");
bool operator==(const VertexBinding &o) const
{
return vbufferBinding == o.vbufferBinding && bytestride == o.bytestride &&
return vertexBufferBinding == o.vertexBufferBinding && byteStride == o.byteStride &&
perInstance == o.perInstance;
}
bool operator<(const VertexBinding &o) const
{
if(!(vbufferBinding == o.vbufferBinding))
return vbufferBinding < o.vbufferBinding;
if(!(bytestride == o.bytestride))
return bytestride < o.bytestride;
if(!(vertexBufferBinding == o.vertexBufferBinding))
return vertexBufferBinding < o.vertexBufferBinding;
if(!(byteStride == o.byteStride))
return byteStride < o.byteStride;
if(!(perInstance == o.perInstance))
return perInstance < o.perInstance;
return false;
}
DOCUMENT("The vertex binding where data will be sourced from.");
uint32_t vbufferBinding = 0;
uint32_t vertexBufferBinding = 0;
DOCUMENT("The byte stride between the start of one set of vertex data and the next.");
uint32_t bytestride = 0;
uint32_t byteStride = 0;
DOCUMENT("``True`` if the vertex data is instance-rate.");
bool perInstance = false;
};
DOCUMENT("Describes a single Vulkan vertex buffer binding.")
struct VB
struct VertexBuffer
{
DOCUMENT("");
bool operator==(const VB &o) const { return buffer == o.buffer && offset == o.offset; }
bool operator<(const VB &o) const
bool operator==(const VertexBuffer &o) const
{
if(!(buffer == o.buffer))
return buffer < o.buffer;
if(!(offset == o.offset))
return offset < o.offset;
return resourceId == o.resourceId && byteOffset == o.byteOffset;
}
bool operator<(const VertexBuffer &o) const
{
if(!(resourceId == o.resourceId))
return resourceId < o.resourceId;
if(!(byteOffset == o.byteOffset))
return byteOffset < o.byteOffset;
return false;
}
DOCUMENT("The :class:`ResourceId` of the buffer bound to this slot.");
ResourceId buffer;
ResourceId resourceId;
DOCUMENT("The byte offset from the start of the buffer to the beginning of the vertex data.");
uint64_t offset = 0;
uint64_t byteOffset = 0;
};
DOCUMENT("Describes the fixed-function vertex input fetch setup.");
struct VertexInput
{
DOCUMENT("A list of :class:`VK_VertexAttribute` with the vertex attributes.");
rdcarray<VertexAttribute> attrs;
DOCUMENT("A list of :class:`VK_VertexBinding` with the vertex bindings.");
rdcarray<VertexBinding> binds;
DOCUMENT("A list of :class:`VK_VB` with the vertex buffers.");
rdcarray<VB> vbuffers;
DOCUMENT("A list of :class:`VKVertexAttribute` with the vertex attributes.");
rdcarray<VertexAttribute> attributes;
DOCUMENT("A list of :class:`VKVertexBinding` with the vertex bindings.");
rdcarray<VertexBinding> bindings;
DOCUMENT("A list of :class:`VKVertexBuffer` with the vertex buffers.");
rdcarray<VertexBuffer> vertexBuffers;
};
DOCUMENT("The provided value for a specialization constant.");
struct SpecInfo
struct SpecializationConstant
{
DOCUMENT("");
bool operator==(const SpecInfo &o) const { return specID == o.specID && data == o.data; }
bool operator<(const SpecInfo &o) const
bool operator==(const SpecializationConstant &o) const
{
if(!(specID == o.specID))
return specID < o.specID;
return specializationId == o.specializationId && data == o.data;
}
bool operator<(const SpecializationConstant &o) const
{
if(!(specializationId == o.specializationId))
return specializationId < o.specializationId;
if(!(data == o.data))
return data < o.data;
return false;
}
DOCUMENT("The specialization ID");
uint32_t specID = 0;
uint32_t specializationId = 0;
DOCUMENT("A ``bytes`` with the contents of the constant.");
bytebuf data;
};
@@ -380,22 +394,23 @@ DOCUMENT("Describes a Vulkan shader stage.");
struct Shader
{
DOCUMENT("The :class:`ResourceId` of the shader module object.");
ResourceId Object;
ResourceId resourceId;
DOCUMENT("The name of the entry point in the shader module that is used.");
rdcstr entryPoint;
DOCUMENT("A :class:`ShaderReflection` describing the reflection data for this shader.");
ShaderReflection *ShaderDetails = NULL;
DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`ShaderDetails` with the bindpoint
ShaderReflection *reflection = NULL;
DOCUMENT(R"(A :class:`ShaderBindpointMapping` to match :data:`reflection` with the bindpoint
mapping data.
)");
ShaderBindpointMapping BindpointMapping;
ShaderBindpointMapping bindpointMapping;
DOCUMENT("A :class:`VK_ShaderStage` identifying which stage this shader is bound to.");
DOCUMENT("A :class:`ShaderStage` identifying which stage this shader is bound to.");
ShaderStage stage = ShaderStage::Vertex;
DOCUMENT("A list of :class:`VK_SpecInfo` with the provided specialization constants.");
rdcarray<SpecInfo> specialization;
DOCUMENT(
"A list of :class:`VKSpecializationConstant` with the provided specialization constants.");
rdcarray<SpecializationConstant> specialization;
};
DOCUMENT("Describes the state of the fixed-function tessellator.");
@@ -405,96 +420,27 @@ struct Tessellation
uint32_t numControlPoints = 0;
};
DOCUMENT("Describes a single Vulkan viewport.");
struct Viewport
{
DOCUMENT("");
bool operator==(const Viewport &o) const
{
return x == o.x && y == o.y && width == o.width && height == o.height &&
minDepth == o.minDepth && maxDepth == o.maxDepth;
}
bool operator<(const Viewport &o) const
{
if(!(x == o.x))
return x < o.x;
if(!(y == o.y))
return y < o.y;
if(!(width == o.width))
return width < o.width;
if(!(height == o.height))
return height < o.height;
if(!(minDepth == o.minDepth))
return minDepth < o.minDepth;
if(!(maxDepth == o.maxDepth))
return maxDepth < o.maxDepth;
return false;
}
DOCUMENT("The X co-ordinate of the viewport.");
float x = 0.0f;
DOCUMENT("The Y co-ordinate of the viewport.");
float y = 0.0f;
DOCUMENT("The width of the viewport.");
float width = 0.0f;
DOCUMENT("The height of the viewport.");
float height = 0.0f;
DOCUMENT("The minimum depth of the viewport.");
float minDepth = 0.0f;
DOCUMENT("The maximum depth of the viewport.");
float maxDepth = 0.0f;
};
DOCUMENT("Describes a single Vulkan scissor region.");
struct Scissor
{
DOCUMENT("");
bool operator==(const Scissor &o) const
{
return x == o.x && y == o.y && width == o.width && height == o.height;
}
bool operator<(const Scissor &o) const
{
if(!(x == o.x))
return x < o.x;
if(!(y == o.y))
return y < o.y;
if(!(width == o.width))
return width < o.width;
if(!(height == o.height))
return height < o.height;
return false;
}
DOCUMENT("The X co-ordinate of the scissor region.");
int32_t x = 0;
DOCUMENT("The Y co-ordinate of the scissor region.");
int32_t y = 0;
DOCUMENT("The width of the scissor region.");
int32_t width = 0;
DOCUMENT("The height of the scissor region.");
int32_t height = 0;
};
DOCUMENT("Describes a combined viewport and scissor region.");
struct ViewportScissor
{
DOCUMENT("");
bool operator==(const ViewportScissor &o) const { return vp == o.vp && scissor == o.scissor; }
bool operator<(const ViewportScissor &o) const { return vp == o.vp && scissor == o.scissor; }
DOCUMENT("The :class:`VK_Viewport`.");
DOCUMENT("The :class:`Viewport`.");
Viewport vp;
DOCUMENT("The :class:`VK_Scissor`.");
DOCUMENT("The :class:`Scissor`.");
Scissor scissor;
};
DOCUMENT("Describes the view state in the pipeline.");
struct ViewState
{
DOCUMENT("A list of :class:`VK_ViewportScissor`.");
DOCUMENT("A list of :class:`VKViewportScissor`.");
rdcarray<ViewportScissor> viewportScissors;
};
DOCUMENT("Describes the raster state in the pipeline.");
struct Raster
DOCUMENT("Describes the rasterizer state in the pipeline.");
struct Rasterizer
{
DOCUMENT(R"(``True`` if pixels outside of the near and far depth planes should be clamped and
to ``0.0`` to ``1.0`` and not clipped.
@@ -505,7 +451,7 @@ to ``0.0`` to ``1.0`` and not clipped.
DOCUMENT(R"(``True`` if counter-clockwise polygons are front-facing.
``False`` if clockwise polygons are front-facing.
)");
bool FrontCCW = false;
bool frontCCW = false;
DOCUMENT("The polygon fill mode.");
FillMode fillMode = FillMode::Solid;
DOCUMENT("The polygon culling mode.");
@@ -536,102 +482,19 @@ struct MultiSample
uint32_t sampleMask = 0;
};
DOCUMENT("Describes the details of a Vulkan blend operation.");
struct BlendEquation
{
DOCUMENT("");
bool operator==(const BlendEquation &o) const
{
return Source == o.Source && Destination == o.Destination && Operation == o.Operation;
}
bool operator<(const BlendEquation &o) const
{
if(!(Source == o.Source))
return Source < o.Source;
if(!(Destination == o.Destination))
return Destination < o.Destination;
if(!(Operation == o.Operation))
return Operation < o.Operation;
return false;
}
DOCUMENT("The :class:`BlendMultiplier` for the source blend value.");
BlendMultiplier Source = BlendMultiplier::One;
DOCUMENT("The :class:`BlendMultiplier` for the destination blend value.");
BlendMultiplier Destination = BlendMultiplier::One;
DOCUMENT("The :class:`BlendOp` to use in the blend calculation.");
BlendOp Operation = BlendOp::Add;
};
DOCUMENT("Describes the blend configuration for a given Vulkan attachment.");
struct Blend
{
DOCUMENT("");
bool operator==(const Blend &o) const
{
return blendEnable == o.blendEnable && blend == o.blend && alphaBlend == o.alphaBlend &&
writeMask == o.writeMask;
}
bool operator<(const Blend &o) const
{
if(!(blendEnable == o.blendEnable))
return blendEnable < o.blendEnable;
if(!(blend == o.blend))
return blend < o.blend;
if(!(alphaBlend == o.alphaBlend))
return alphaBlend < o.alphaBlend;
if(!(writeMask == o.writeMask))
return writeMask < o.writeMask;
return false;
}
DOCUMENT("A :class:`VK_BlendEquation` describing the blending for colour values.");
BlendEquation blend;
DOCUMENT("A :class:`VK_BlendEquation` describing the blending for alpha values.");
BlendEquation alphaBlend;
DOCUMENT("``True`` if blending is enabled for this attachment.");
bool blendEnable = false;
DOCUMENT("The mask for writes to the attachment.");
uint8_t writeMask = 0;
};
DOCUMENT("Describes the pipeline blending state.");
struct ColorBlend
struct ColorBlendState
{
DOCUMENT("``True`` if alpha-to-coverage should be used when blending to an MSAA target.");
bool alphaToCoverageEnable = false;
DOCUMENT("``True`` if alpha-to-one should be used when blending to an MSAA target.");
bool alphaToOneEnable = false;
DOCUMENT("``True`` if the logic operation in :data:`logic` should be used.");
bool logicOpEnable = false;
DOCUMENT(
"The :class:`LogicOp` to use for logic operations, if :data:`logicOpEnable` is ``True``.");
LogicOp logic = LogicOp::NoOp;
DOCUMENT("The list of :class:`VK_Blend` with the blending configuration per-attachment.");
rdcarray<Blend> attachments;
DOCUMENT("The list of :class:`ColorBlend` with the blending configuration per-attachment.");
rdcarray<ColorBlend> blends;
DOCUMENT("The constant blend factor to use in blend equations.");
float blendConst[4] = {1.0f, 1.0f, 1.0f, 1.0f};
};
DOCUMENT("Describes the details of a Vulkan stencil operation.");
struct StencilFace
{
DOCUMENT("The :class:`StencilOp` to apply if the stencil-test fails.");
StencilOp FailOp = StencilOp::Keep;
DOCUMENT("The :class:`StencilOp` to apply if the depth-test fails.");
StencilOp DepthFailOp = StencilOp::Keep;
DOCUMENT("The :class:`StencilOp` to apply if the stencil-test passes.");
StencilOp PassOp = StencilOp::Keep;
DOCUMENT("The :class:`CompareFunc` to use for testing stencil values.");
CompareFunc Func = CompareFunc::AlwaysTrue;
DOCUMENT("The current stencil reference value.");
uint32_t ref = 0;
DOCUMENT("The mask for testing stencil values.");
uint32_t compareMask = 0;
DOCUMENT("The mask for writing stencil values.");
uint32_t writeMask = 0;
float blendFactor[4] = {1.0f, 1.0f, 1.0f, 1.0f};
};
DOCUMENT("Describes the pipeline depth-stencil state.");
@@ -643,16 +506,16 @@ struct DepthStencil
bool depthWriteEnable = false;
DOCUMENT("``True`` if depth bounds tests should be applied.");
bool depthBoundsEnable = false;
DOCUMENT("The :class:`CompareFunc` to use for testing depth values.");
CompareFunc depthCompareOp = CompareFunc::AlwaysTrue;
DOCUMENT("The :class:`CompareFunction` to use for testing depth values.");
CompareFunction depthFunction = CompareFunction::AlwaysTrue;
DOCUMENT("``True`` if stencil operations should be performed.");
bool stencilTestEnable = false;
DOCUMENT("A :class:`VK_StencilFace` describing what happens for front-facing polygons.");
StencilFace front;
DOCUMENT("A :class:`VK_StencilFace` describing what happens for back-facing polygons.");
StencilFace back;
DOCUMENT("A :class:`StencilFace` describing what happens for front-facing polygons.");
StencilFace frontFace;
DOCUMENT("A :class:`StencilFace` describing what happens for back-facing polygons.");
StencilFace backFace;
DOCUMENT("The near plane bounding value.");
float minDepthBounds = 0.0f;
@@ -664,7 +527,7 @@ DOCUMENT("Describes the setup of a renderpass and subpasses.");
struct RenderPass
{
DOCUMENT("The :class:`ResourceId` of the render pass.");
ResourceId obj;
ResourceId resourceId;
DOCUMENT("The index of the current active subpass.");
uint32_t subpass;
@@ -690,19 +553,19 @@ struct Attachment
DOCUMENT("");
bool operator==(const Attachment &o) const
{
return view == o.view && img == o.img && viewfmt == o.viewfmt && swizzle[0] == o.swizzle[0] &&
swizzle[1] == o.swizzle[1] && swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] &&
baseMip == o.baseMip && baseLayer == o.baseLayer && numMip == o.numMip &&
numLayer == o.numLayer;
return viewResourceId == o.viewResourceId && imageResourceId == o.imageResourceId &&
viewFormat == o.viewFormat && swizzle[0] == o.swizzle[0] && swizzle[1] == o.swizzle[1] &&
swizzle[2] == o.swizzle[2] && swizzle[3] == o.swizzle[3] && firstMip == o.firstMip &&
firstSlice == o.firstSlice && numMips == o.numMips && numSlices == o.numSlices;
}
bool operator<(const Attachment &o) const
{
if(!(view == o.view))
return view < o.view;
if(!(img == o.img))
return img < o.img;
if(!(viewfmt == o.viewfmt))
return viewfmt < o.viewfmt;
if(!(viewResourceId == o.viewResourceId))
return viewResourceId < o.viewResourceId;
if(!(imageResourceId == o.imageResourceId))
return imageResourceId < o.imageResourceId;
if(!(viewFormat == o.viewFormat))
return viewFormat < o.viewFormat;
if(!(swizzle[0] == o.swizzle[0]))
return swizzle[0] < o.swizzle[0];
if(!(swizzle[1] == o.swizzle[1]))
@@ -711,43 +574,43 @@ struct Attachment
return swizzle[2] < o.swizzle[2];
if(!(swizzle[3] == o.swizzle[3]))
return swizzle[3] < o.swizzle[3];
if(!(baseMip == o.baseMip))
return baseMip < o.baseMip;
if(!(baseLayer == o.baseLayer))
return baseLayer < o.baseLayer;
if(!(numMip == o.numMip))
return numMip < o.numMip;
if(!(numLayer == o.numLayer))
return numLayer < o.numLayer;
if(!(firstMip == o.firstMip))
return firstMip < o.firstMip;
if(!(firstSlice == o.firstSlice))
return firstSlice < o.firstSlice;
if(!(numMips == o.numMips))
return numMips < o.numMips;
if(!(numSlices == o.numSlices))
return numSlices < o.numSlices;
return false;
}
DOCUMENT("The :class:`ResourceId` of the image view itself.");
ResourceId view;
ResourceId viewResourceId;
DOCUMENT("The :class:`ResourceId` of the underlying image that the view refers to.");
ResourceId img;
ResourceId imageResourceId;
DOCUMENT("The :class:`ResourceFormat` that the view uses.");
ResourceFormat viewfmt;
ResourceFormat viewFormat;
DOCUMENT("Four :class:`TextureSwizzle` elements indicating the swizzle applied to this texture.");
TextureSwizzle swizzle[4] = {TextureSwizzle::Red, TextureSwizzle::Green, TextureSwizzle::Blue,
TextureSwizzle::Alpha};
DOCUMENT("The first mip level used in the attachment.");
uint32_t baseMip = 0;
uint32_t firstMip = 0;
DOCUMENT("For 3D textures and texture arrays, the first slice used in the attachment.");
uint32_t baseLayer = 0;
uint32_t firstSlice = 0;
DOCUMENT("The number of mip levels in the attachment.");
uint32_t numMip = 1;
uint32_t numMips = 1;
DOCUMENT("For 3D textures and texture arrays, the number of array slices in the attachment.");
uint32_t numLayer = 1;
uint32_t numSlices = 1;
};
DOCUMENT("Describes a framebuffer object and its attachments.");
struct Framebuffer
{
DOCUMENT("The :class:`ResourceId` of the framebuffer object.");
ResourceId obj;
ResourceId resourceId;
DOCUMENT("A list of :class:`VK_Attachment` with the attachments of this framebuffer.");
DOCUMENT("A list of :class:`VKAttachment` with the attachments of this framebuffer.");
rdcarray<Attachment> attachments;
DOCUMENT("The width of this framebuffer in pixels.");
@@ -774,11 +637,11 @@ struct RenderArea
DOCUMENT("Describes the current pass instance at the current time.");
struct CurrentPass
{
DOCUMENT("The :class:`VK_RenderPass` that is currently active.");
DOCUMENT("The :class:`VKRenderPass` that is currently active.");
RenderPass renderpass;
DOCUMENT("The :class:`VK_Framebuffer` that is currently being used.");
DOCUMENT("The :class:`VKFramebuffer` that is currently being used.");
Framebuffer framebuffer;
DOCUMENT("The :class:`VK_RenderArea` that is currently being rendered to.");
DOCUMENT("The :class:`VKRenderArea` that is currently being rendered to.");
RenderArea renderArea;
};
@@ -821,66 +684,65 @@ DOCUMENT("Contains the current layout of all subresources in the image.");
struct ImageData
{
DOCUMENT("");
bool operator==(const ImageData &o) const { return image == o.image; }
bool operator==(const ImageData &o) const { return resourceId == o.resourceId; }
bool operator<(const ImageData &o) const
{
if(!(image == o.image))
return image < o.image;
if(!(resourceId == o.resourceId))
return resourceId < o.resourceId;
return false;
}
DOCUMENT("The :class:`ResourceId` of the image.");
ResourceId image;
ResourceId resourceId;
DOCUMENT(
"A list of :class:`VK_ImageLayout` with the set of subresources that make up the image.");
DOCUMENT("A list of :class:`VKImageLayout` with the set of subresources that make up the image.");
rdcarray<ImageLayout> layouts;
};
DOCUMENT("The full current Vulkan pipeline state.");
struct State
{
DOCUMENT("A :class:`VK_Pipeline` with the currently bound compute pipeline, if any.");
DOCUMENT("A :class:`VKPipeline` with the currently bound compute pipeline, if any.");
Pipeline compute;
DOCUMENT("A :class:`VK_Pipeline` with the currently bound graphics pipeline, if any.");
DOCUMENT("A :class:`VKPipeline` with the currently bound graphics pipeline, if any.");
Pipeline graphics;
DOCUMENT("A :class:`VK_InputAssembly` describing the input assembly stage.");
InputAssembly IA;
DOCUMENT("A :class:`VK_VertexInput` describing the vertex input stage.");
VertexInput VI;
DOCUMENT("A :class:`VKInputAssembly` describing the input assembly stage.");
InputAssembly inputAssembly;
DOCUMENT("A :class:`VKVertexInput` describing the vertex input stage.");
VertexInput vertexInput;
DOCUMENT("A :class:`VK_Shader` describing the vertex shader stage.");
Shader m_VS;
DOCUMENT("A :class:`VK_Shader` describing the tessellation control shader stage.");
Shader m_TCS;
DOCUMENT("A :class:`VK_Shader` describing the tessellation evaluation shader stage.");
Shader m_TES;
DOCUMENT("A :class:`VK_Shader` describing the geometry shader stage.");
Shader m_GS;
DOCUMENT("A :class:`VK_Shader` describing the fragment shader stage.");
Shader m_FS;
DOCUMENT("A :class:`VK_Shader` describing the compute shader stage.");
Shader m_CS;
DOCUMENT("A :class:`VKShader` describing the vertex shader stage.");
Shader vertexShader;
DOCUMENT("A :class:`VKShader` describing the tessellation control shader stage.");
Shader tessControlShader;
DOCUMENT("A :class:`VKShader` describing the tessellation evaluation shader stage.");
Shader tessEvalShader;
DOCUMENT("A :class:`VKShader` describing the geometry shader stage.");
Shader geometryShader;
DOCUMENT("A :class:`VKShader` describing the fragment shader stage.");
Shader fragmentShader;
DOCUMENT("A :class:`VKShader` describing the compute shader stage.");
Shader computeShader;
DOCUMENT("A :class:`VK_Tessellation` describing the tessellation stage.");
Tessellation Tess;
DOCUMENT("A :class:`VKTessellation` describing the tessellation stage.");
Tessellation tessellation;
DOCUMENT("A :class:`VK_ViewState` describing the viewport setup.");
ViewState VP;
DOCUMENT("A :class:`VK_Raster` describing rasterization.");
Raster RS;
DOCUMENT("A :class:`VKViewState` describing the viewport setup.");
ViewState viewportScissor;
DOCUMENT("A :class:`VKRasterizer` describing rasterization.");
Rasterizer rasterizer;
DOCUMENT("A :class:`VK_MultiSample` describing the multisample setup.");
MultiSample MSAA;
DOCUMENT("A :class:`VK_ColorBlend` describing color blending.");
ColorBlend CB;
DOCUMENT("A :class:`VK_DepthStencil` describing the depth-stencil stage.");
DepthStencil DS;
DOCUMENT("A :class:`VKMultiSample` describing the multisample setup.");
MultiSample multisample;
DOCUMENT("A :class:`VKColorBlendState` describing color blending.");
ColorBlendState colorBlend;
DOCUMENT("A :class:`VKDepthStencil` describing the depth-stencil stage.");
DepthStencil depthStencil;
DOCUMENT("A :class:`VK_CurrentPass` describing the current renderpass, subpass and framebuffer.");
CurrentPass Pass;
DOCUMENT("A :class:`VKCurrentPass` describing the current renderpass, subpass and framebuffer.");
CurrentPass currentPass;
DOCUMENT("A list of :class:`VK_ImageData` entries, one for each image.");
DOCUMENT("A list of :class:`VKImageData` entries, one for each image.");
rdcarray<ImageData> images;
};
@@ -890,25 +752,20 @@ DECLARE_REFLECTION_STRUCT(VKPipe::BindingElement);
DECLARE_REFLECTION_STRUCT(VKPipe::DescriptorBinding);
DECLARE_REFLECTION_STRUCT(VKPipe::DescriptorSet);
DECLARE_REFLECTION_STRUCT(VKPipe::Pipeline);
DECLARE_REFLECTION_STRUCT(VKPipe::IB);
DECLARE_REFLECTION_STRUCT(VKPipe::IndexBuffer);
DECLARE_REFLECTION_STRUCT(VKPipe::InputAssembly);
DECLARE_REFLECTION_STRUCT(VKPipe::VertexAttribute);
DECLARE_REFLECTION_STRUCT(VKPipe::VertexBinding);
DECLARE_REFLECTION_STRUCT(VKPipe::VB);
DECLARE_REFLECTION_STRUCT(VKPipe::VertexBuffer);
DECLARE_REFLECTION_STRUCT(VKPipe::VertexInput);
DECLARE_REFLECTION_STRUCT(VKPipe::SpecInfo);
DECLARE_REFLECTION_STRUCT(VKPipe::SpecializationConstant);
DECLARE_REFLECTION_STRUCT(VKPipe::Shader);
DECLARE_REFLECTION_STRUCT(VKPipe::Tessellation);
DECLARE_REFLECTION_STRUCT(VKPipe::Viewport);
DECLARE_REFLECTION_STRUCT(VKPipe::Scissor);
DECLARE_REFLECTION_STRUCT(VKPipe::ViewportScissor);
DECLARE_REFLECTION_STRUCT(VKPipe::ViewState);
DECLARE_REFLECTION_STRUCT(VKPipe::Raster);
DECLARE_REFLECTION_STRUCT(VKPipe::Rasterizer);
DECLARE_REFLECTION_STRUCT(VKPipe::MultiSample);
DECLARE_REFLECTION_STRUCT(VKPipe::BlendEquation);
DECLARE_REFLECTION_STRUCT(VKPipe::Blend);
DECLARE_REFLECTION_STRUCT(VKPipe::ColorBlend);
DECLARE_REFLECTION_STRUCT(VKPipe::StencilFace);
DECLARE_REFLECTION_STRUCT(VKPipe::ColorBlendState);
DECLARE_REFLECTION_STRUCT(VKPipe::DepthStencil);
DECLARE_REFLECTION_STRUCT(VKPipe::RenderPass);
DECLARE_REFLECTION_STRUCT(VKPipe::Attachment);