API Reference: ShadersΒΆ
This is the API reference for the functions, classes, and enums in the renderdoc module which represents the underlying interface that the UI is built on top of. For more high-level information and instructions on using the python API, see Python API.
DescriptorsΒΆ
- class renderdoc.DescriptorΒΆ
- class renderdoc.Descriptor(other: Descriptor)
The contents of a descriptor. Not all contents will be valid depending on API and descriptor type, others will be set to sensible defaults.
For sampler descriptors, the sampler-specific data can be queried separately and returned as
SamplerDescriptorfor sampler types.- bufferStructCountΒΆ
If the view has a hidden counter, this stores the current value of the counter.
- Type:
int
- byteOffsetΒΆ
For any kind of buffer descriptor, the base byte offset within the resource where the referenced range by the descriptor begins.
- Type:
int
- byteSizeΒΆ
For any kind of buffer descriptor, the number of bytes in the range covered by the descriptor.
- Type:
int
- counterByteOffsetΒΆ
The byte offset in
secondarywhere the counter is stored, for buffer descriptors with a secondary counter.- Type:
int
- elementByteSizeΒΆ
The byte size of a single element in the view. Either the byte size of
format, or the structured buffer element size, as appropriate.- Type:
int
- firstMipΒΆ
For texture descriptors, the first mip in the texture which is visible to the descriptor
- Type:
int
- firstSliceΒΆ
For texture descriptors, the first slice in a 3D or array texture which is visible to the descriptor
- Type:
int
- flagsΒΆ
The flags for additional API-specific and generally non-semantically impactful properties.
- Type:
- formatΒΆ
The format cast that the view uses, for typed buffer and image descriptors.
- Type:
- minLODClampΒΆ
The clamp applied to the minimum LOD by the resource view, separate and in addition to any clamp by a sampler used.
- Type:
float
- numMipsΒΆ
For texture descriptors, the number of mips in the texture which are visible to the descriptor
- Type:
int
- numSlicesΒΆ
For texture descriptors, the number of slices in a 3D or array texture which are visible to the descriptor
- Type:
int
- resourceΒΆ
The primary bound resource at this descriptor, either a buffer or an image resource.
Note that sampler descriptors will not be listed here, see
secondary.- Type:
- secondaryΒΆ
The secondary bound resource at this descriptor.
For any descriptor containing a sampler, this will be the sampler. For buffer descriptors with an associated counter buffer this will be the counter buffer.
- Type:
- swizzleΒΆ
The swizzle applied to texture descriptors.
- Type:
- textureTypeΒΆ
The specific type of a texture descriptor.
- Type:
- typeΒΆ
The type of this descriptor as a general category.
- Type:
- class renderdoc.SamplerDescriptorΒΆ
- class renderdoc.SamplerDescriptor(other: SamplerDescriptor)
The contents of a sampler descriptor. Not all contents will be valid depending on API and capabilities, others will be set to sensible defaults.
For normal descriptors, the resource data should be queried and returned in
Descriptor.- UseBorder()ΒΆ
Check if the border color is used in this D3D11 sampler.
- Returns:
Trueif the border color is used,Falseotherwise.- Return type:
bool
- addressUΒΆ
The
AddressModein the U direction.- Type:
- addressVΒΆ
The
AddressModein the V direction.- Type:
- addressWΒΆ
The
AddressModein the W direction.- Type:
- borderColorTypeΒΆ
The RGBA border color type. This determines how the data in
borderColorValuewill be interpreted.- Type:
- borderColorValueΒΆ
The RGBA border color value. Typically the float tuple inside will be used, but the exact component type can be checked with
borderColorType.- Type:
- chromaFilterΒΆ
For ycbcr samplers - the
FilterModedescribing the chroma filtering mode.- Type:
- compareFunctionΒΆ
The
CompareFunctionfor comparison samplers.- Type:
- creationTimeConstantΒΆ
Trueif this sampler was initialised at creation time for a pipeline or descriptor layout, the method being API specific. If so this sampler is not dynamic and was not explicitly set and may have no real descriptor storage.- Type:
bool
- filterΒΆ
The filtering mode.
- Type:
- forceExplicitReconstructionΒΆ
For ycbcr samplers -
Trueif explicit reconstruction is force enabled.- Type:
bool
- maxAnisotropyΒΆ
The maximum anisotropic filtering level to use.
- Type:
float
- maxLODΒΆ
The maximum mip level that can be used.
- Type:
float
- minLODΒΆ
The minimum mip level that can be used.
- Type:
float
- mipBiasΒΆ
A bias to apply to the calculated mip level before sampling.
- Type:
float
- objectΒΆ
For APIs where samplers are an explicit object, the
ResourceIdof the sampler itself- Type:
- seamlessCubemapsΒΆ
Trueif this sampler is seamless across cubemap boundaries (the default).- Type:
bool
- srgbBorderΒΆ
Trueif the border colour is swizzled with an sRGB formatted image.- Type:
bool
- swizzleΒΆ
The swizzle applied. Primarily for ycbcr samplers applied before conversion but for non-ycbcr samplers can be used for implementations that require sampler swizzle information for border colors.
- Type:
- typeΒΆ
The type of this descriptor as a general category.
If this is not set to
DescriptorType.SamplerorDescriptorType.ImageSamplerthe rest of the contents of this structure are not valid as the descriptor is not a sampler descriptor.- Type:
- unnormalizedΒΆ
Trueif unnormalized co-ordinates are used in this sampler.- Type:
bool
- xChromaOffsetΒΆ
For ycbcr samplers - the
ChromaSampleLocationX-axis chroma offset.- Type:
- yChromaOffsetΒΆ
For ycbcr samplers - the
ChromaSampleLocationY-axis chroma offset.- Type:
- ycbcrModelΒΆ
For ycbcr samplers - the
YcbcrConversionused for conversion.- Type:
- ycbcrRangeΒΆ
For ycbcr samplers - the
YcbcrRangeused for conversion.- Type:
- ycbcrSamplerΒΆ
The
ResourceIdof the ycbcr conversion object associated with this sampler.- Type:
- class renderdoc.DescriptorFlags(value)ΒΆ
A set of flags for descriptor properties.
- NoFlagsΒΆ
The buffer will not be used for any of the uses below.
- RawBufferΒΆ
On D3D, a buffer is used as a raw (byte-addressed) buffer.
- AppendBufferΒΆ
On D3D, a buffer is used as a append/consume view.
- CounterBufferΒΆ
On D3D, a buffer is used with a structured buffer with associated hidden counter.
- ReadOnlyAccessΒΆ
On GL, a storage image or buffer is bound with read-only access.
- WriteOnlyAccessΒΆ
On GL, a storage image or buffer is bound with write-only access.
- InlineDataΒΆ
This descriptor isnβt backed by an explicit buffer in the API (though a resource may be provided for data query purposes during replay), but instead by some virtual or in-line data. For example in-line constants set directly, or compile/creation time constants.
The exact nature can be determined by the shader reflection data.
- class renderdoc.DescriptorCategory(value)ΒΆ
The category of a descriptor, corresponding to the interfaces in
ShaderReflection.- UnknownΒΆ
An unknown or uninitialised type of descriptor.
- ConstantBlockΒΆ
A constant block.
- SamplerΒΆ
A sampler object.
- ReadOnlyResourceΒΆ
A read-only resource.
- ReadWriteResourceΒΆ
A read-write resource.
- class renderdoc.DescriptorType(value)ΒΆ
The type of a descriptor.
- UnknownΒΆ
An unknown or uninitialised type of descriptor.
- ConstantBufferΒΆ
A constant or uniform buffer.
- SamplerΒΆ
A separate sampler object.
- ImageSamplerΒΆ
A combined image and sampler object.
- ImageΒΆ
An image that can only be sampled from.
- BufferΒΆ
A buffer that can only be read from, with data read literally in a shader via raw or structured access.
- TypedBufferΒΆ
A typed buffer that can only be read from, interpreting each element via a format decode.
- ReadWriteImageΒΆ
An image that can be read from and written to arbitrarily.
- ReadWriteTypedBufferΒΆ
A typed/texture buffer that can be read from and written to arbitrarily.
- ReadWriteBufferΒΆ
A buffer that can be read from and written to arbitrarily.
- AccelerationStructureΒΆ
A ray-tracing acceleration structure, read-only in the shader.
- renderdoc.CategoryForDescriptorType(type)ΒΆ
Get the shader interface category for a given type of descriptor.
- Parameters:
type# (DescriptorType) β The type of descriptor
- Returns:
The descriptor category.
- Return type:
- renderdoc.IsConstantBlockDescriptor(type)ΒΆ
Checks if a descriptor type corresponds to a constant block in shader reflection.
- Parameters:
type# (DescriptorType) β The type of descriptor
- Returns:
Trueif the descriptor type is a constant block descriptor.- Return type:
bool
- renderdoc.IsReadOnlyDescriptor(type)ΒΆ
Checks if a descriptor type corresponds to a read only resource in shader reflection. Combined image/samplers are reported as read only resources.
- Parameters:
type# (DescriptorType) β The type of descriptor
- Returns:
Trueif the descriptor type is a read-only resource descriptor.- Return type:
bool
- renderdoc.IsReadWriteDescriptor(type)ΒΆ
Checks if a descriptor type corresponds to a read write resource in shader reflection.
- Parameters:
type# (DescriptorType) β The type of descriptor
- Returns:
Trueif the descriptor type is a read-write resource descriptor.- Return type:
bool
- renderdoc.IsSamplerDescriptor(type)ΒΆ
Checks if a descriptor type corresponds to a sampler in shader reflection. Only dedicated sampler types are sampler descriptors, combined image/samplers are reported only as read only resources.
- Parameters:
type# (DescriptorType) β The type of descriptor
- Returns:
Trueif the descriptor type is a sampler descriptor.- Return type:
bool
- class renderdoc.DescriptorLogicalLocationΒΆ
- class renderdoc.DescriptorLogicalLocation(other: DescriptorLogicalLocation)
In many cases there may be a logical location or fixed binding point for a particular descriptor which is not conveyed with a simple byte offset into a descriptor store. This is particularly true for any descriptor stores that are not equivalent to a buffer of bytes but actually have an API structure - for example D3D11 and GL with fixed binding points, or Vulkan with descriptor sets.
In some cases on APIs with explicit descriptor storage this may convey information about virtualised descriptors that are not explicitly backed with real storage.
This structure describes such a location queried for a given descriptor.
For example on D3D11 this would give the register number of the binding, and on GL it would give the unit index. Both cases would be able to query the type and shader stage visibility of descriptors that are not accessed or even bound.
On Vulkan this would give the set, binding, and visibility. In most cases this information will be available for all descriptors but in some cases the type of descriptor may not be available if it is unused and has not been initialised.
On D3D12 this would only give the index into the heap, as no other information is available purely by the descriptor itself.
Note
This information may not be fully present on all APIs so the returned structures may be empty or partially filled out, depending on what information is relevant per API.
- categoryΒΆ
The general category of a descriptor stored. This may not be available for uninitialised descriptors on all APIs.
- Type:
- fixedBindNumberΒΆ
The fixed binding number for this descriptor. The interpretation of this is API-specific and it is provided purely for informational purposes and has no bearing on how data is accessed or described.
Generally speaking sorting by this number will give a reasonable ordering by binding if it exists.
Note
Because this number is API-specific, there is no guarantee that it will be unique across all descriptors. It should be used only within contexts that can interpret it API-specifically, or else for purely informational/non-semantic purposes like sorting.
- Type:
int
- logicalBindNameΒΆ
The logical binding name, as suitable for displaying to a user when displaying the contents of a descriptor queried directly from a heap.
Depending on the API, this name may be identical or less specific than the one obtained from shader reflection. Generally speaking itβs preferred to use any information from shader reflection first, and fall back to this name if no reflection information is available in the context.
- Type:
str
- stageMaskΒΆ
The set of shader stages that this descriptor is intrinsically available to. This is primarily relevant for D3D11 with its fixed per-stage register binding points.
Note this only shows if a descriptor itself can only ever be accessed by some shader stages by definition, not if a descriptor is generally available but happened to only be accessed by one or more stage. That information is available directly in the
DescriptorAccessitself.- Type:
- class renderdoc.DescriptorRangeΒΆ
- class renderdoc.DescriptorRange(other: DescriptorRange)
- class renderdoc.DescriptorRange(access: DescriptorAccess)
A range of sized descriptors.
- countΒΆ
The number of descriptors in this range.
- Type:
int
- descriptorSizeΒΆ
The size of each descriptor in the range.
- Type:
int
- offsetΒΆ
The offset in the descriptor storage where the descriptor range starts.
- Type:
int
- typeΒΆ
The type of descriptor in the descriptor range.
- Type:
- class renderdoc.DescriptorAccessΒΆ
- class renderdoc.DescriptorAccess(other: DescriptorAccess)
The details of a single accessed descriptor as fetched by a shader and which descriptor in the descriptor store was fetched.
This may be a somewhat conservative access, reported as possible but not actually executed on the GPU itself.
- NoShaderBindingΒΆ
No shader binding corresponds to this descriptor access, it happened directly without going through any kind of binding.
- arrayElementΒΆ
For an arrayed resource declared in a shader, the array element used.
- Type:
int
- byteOffsetΒΆ
The offset in bytes to the descriptor in the descriptor store.
- Type:
int
- byteSizeΒΆ
The size in bytes of the descriptor.
- Type:
int
- descriptorStoreΒΆ
The backing storage of the descriptor.
- Type:
- indexΒΆ
The index within the shaderβs reflection list corresponding to
typeof the accessing resource.If this value is set to
NoShaderBindingthen the shader synthesised a direct access into descriptor storage without passing through a declared binding.- Type:
int
- stageΒΆ
The shader stage that this descriptor access came from.
- Type:
- staticallyUnusedΒΆ
For informational purposes, some descriptors that are declared in the shader interface but are provably unused may still be reported as descriptor accesses. This flag will be set to
Trueto indicate that the descriptor was definitely not used.This flag only states that a descriptor is definitely unused on all paths. If set to
Falsethis does not necessarily guarantee that the descriptor was accessed on the GPU during execution.- Type:
bool
- typeΒΆ
The type of the descriptor being accessed.
- Type:
ReflectionΒΆ
- class renderdoc.ShaderReflectionΒΆ
The reflection and metadata fully describing a shader.
The information in this structure is API agnostic.
- constantBlocksΒΆ
The constant block bindings.
- Type:
List[ConstantBlock]
- debugInfoΒΆ
The embedded debugging information.
- Type:
- dispatchThreadsDimensionΒΆ
The 3D dimensions of a compute workgroup, for compute shaders.
- Type:
Tuple[int,int,int]
- encodingΒΆ
The
ShaderEncodingof this shader. SeerawBytes.- Type:
- entryPointΒΆ
The entry point in the shader for this reflection, if multiple entry points exist.
- Type:
str
- inputSignatureΒΆ
The input signature.
- Type:
List[SigParameter]
- interfacesΒΆ
The list of strings with the shaderβs interfaces. Largely an unused API feature.
- Type:
List[str]
- outputSignatureΒΆ
The output signature.
- Type:
List[SigParameter]
- pointerTypesΒΆ
The list of pointer types referred to in this shader.
- Type:
List[ShaderConstantType]
- rawBytesΒΆ
A raw
bytesdump of the original shader, encoded in the form denoted byencoding.- Type:
bytes
- rayAttributesΒΆ
The block layout of the ray attributes structure.
Only relevant for intersection shaders and closest/any hit shaders, this gives the attributes structure produced by a custom intersection shader which is available by hit shaders, or else the built-in structure if no intersection shader was used and a triangle intersection is reported.
- Type:
- rayPayloadΒΆ
The block layout of the ray payload.
Only relevant for raytracing shaders, this gives the payload accessible for read and write by ray evaluation during the processing of the ray
- Type:
- readOnlyResourcesΒΆ
The read-only resource bindings.
- Type:
List[ShaderResource]
- readWriteResourcesΒΆ
The read-write resource bindings.
- Type:
List[ShaderResource]
- resourceIdΒΆ
The
ResourceIdof this shader.- Type:
- samplersΒΆ
The sampler bindings.
- Type:
List[ShaderSampler]
- stageΒΆ
The
ShaderStagethat this shader corresponds to, if multiple entry points exist.- Type:
- taskPayloadΒΆ
The block layout of the task-mesh communication payload.
Only relevant for task or mesh shaders, this gives the output payload (for task shaders) or the input payload (for mesh shaders)
- Type:
- class renderdoc.ShaderStage(value)ΒΆ
The stage in a pipeline where a shader runs
- VertexΒΆ
The vertex shader.
- HullΒΆ
The hull shader. See also
Tess_Control.
- GeometryΒΆ
The geometry shader.
- ComputeΒΆ
The compute shader.
- TaskΒΆ
The task shader. See also
Amplification.
- MeshΒΆ
The mesh shader.
- RayGenΒΆ
A ray generation shader, called from a ray dispatch command to launch initial rays.
- IntersectionΒΆ
An intersection shader, used for procedural objects in a BLAS to calculate hits.
- AnyHitΒΆ
An any-hit shader, called in an indeterminate order and number when a ray intersection has been found with an object but may not be the final hit.
- ClosestHitΒΆ
A closest-hit shader, called once the closest hit on a ray has been found.
- MissΒΆ
A miss shader, called when a ray has no valid closest hit at all.
- CallableΒΆ
A callable shader, called by shader code via index during ray processing.
- InvalidΒΆ
An invalid/unknown shader stage.
- class renderdoc.ShaderStageMask(value)ΒΆ
A set of flags for
ShaderStagestages- UnknownΒΆ
No flags set for any shader stages.
- VertexΒΆ
The flag for
ShaderStage.Vertex.
- HullΒΆ
The flag for
ShaderStage.Hull.
- Tess_ControlΒΆ
The flag for
ShaderStage.Tess_Control.
- DomainΒΆ
The flag for
ShaderStage.Domain.
- Tess_EvalΒΆ
The flag for
ShaderStage.Tess_Eval.
- GeometryΒΆ
The flag for
ShaderStage.Geometry.
- PixelΒΆ
The flag for
ShaderStage.Pixel.
- FragmentΒΆ
The flag for
ShaderStage.Fragment.
- ComputeΒΆ
The flag for
ShaderStage.Compute.
- TaskΒΆ
The flag for
ShaderStage.Task.
- AmplificationΒΆ
The flag for
ShaderStage.Amplification.
- MeshΒΆ
The flag for
ShaderStage.Mesh.
- RayGenΒΆ
The flag for
ShaderStage.RayGen.
- IntersectionΒΆ
The flag for
ShaderStage.Intersection.
- AnyHitΒΆ
The flag for
ShaderStage.AnyHit.
- ClosestHitΒΆ
The flag for
ShaderStage.ClosestHit.
- MissΒΆ
The flag for
ShaderStage.Miss.
- CallableΒΆ
The flag for
ShaderStage.Callable.
- AllΒΆ
A shorthand version with flags set for all stages together.
- renderdoc.MaskForStage(stage)ΒΆ
Calculate the corresponding flag for a shader stage
- Parameters:
stage# (ShaderStage) β The shader stage
- Returns:
The flag that corresponds to the input shader stage
- Return type:
- renderdoc.FirstStageForMask(stageMask)ΒΆ
For a shader stage mask that only covers one shader stage, return the shader stage.
Note
If the shader stage mask covers multiple stages, only the first matching stage will be returned. If the mask is empty,
ShaderStage.Invalidwill be returned.- Parameters:
stageMask# (ShaderStageMask) β The shader stage mask.
- Returns:
The first shader stage covered by the mask.
- Return type:
- class renderdoc.SigParameterΒΆ
- class renderdoc.SigParameter(other: SigParameter)
The information describing an input or output signature element describing the interface between shader stages.
- NoIndexΒΆ
Value for an index that means it is invalid or not applicable for this parameter.
- channelUsedMaskΒΆ
A bitmask indicating which components in the shader register are actually used by the shader itself, for APIs that pack signatures together.
- Type:
int
- needSemanticIndexΒΆ
A convenience flag -
Trueif the semantic name is unique and no index is needed.- Type:
bool
- perPrimitiveRateΒΆ
A flag indicating if this parameter is output at per-primitive rate rather than per-vertex.
- Type:
bool
- regChannelMaskΒΆ
A bitmask indicating which components in the shader register are stored, for APIs that pack signatures together.
- Type:
int
- regIndexΒΆ
The index of the shader register/binding used to store this signature element.
This may be
NoIndexif the element is system-generated and not consumed by another shader stage. SeesystemValue.- Type:
int
- semanticIdxNameΒΆ
The combined semantic name and index.
- Type:
str
- semanticIndexΒΆ
The semantic index of this variable - see
semanticName.- Type:
int
- semanticNameΒΆ
The semantic name of this variable, if the API uses semantic matching for bindings.
- Type:
str
- streamΒΆ
Selects a stream for APIs that provide multiple output streams for the same named output.
- Type:
int
- systemValueΒΆ
The
ShaderBuiltinvalue that this element contains.- Type:
- varNameΒΆ
The name of this variable - may not be present in the metadata for all APIs.
- Type:
str
- varTypeΒΆ
The
variable typeof data that this element stores.- Type:
- class renderdoc.ShaderBuiltin(value)ΒΆ
Annotates a particular built-in input or output from a shader with a special meaning to the hardware or API.
Some of the built-in inputs or outputs can be declared multiple times in arrays or otherwise indexed to apply to multiple related things - see
ClipDistance,CullDistanceandColorOutput.- UndefinedΒΆ
Undefined built-in or no built-in is attached to this shader variable.
- PositionΒΆ
As an output from the final vertex processing shader stage, this feeds the vertex position to the rasterized. As an input to the pixel shader stage this receives the position from the rasterizer.
- PointSizeΒΆ
An output that controls the size of point primitives.
- ClipDistanceΒΆ
An output for the distance to a user-defined clipping plane. Any pixel with an interpolated value that is negative will not be rasterized. Typically there can be more than one such output.
- CullDistanceΒΆ
An output for the distance to a user-defined culling plane. Any primitive with all vertices having negative values will not be rasterized. Typically there can be more than one such output.
- RTIndexΒΆ
An output for selecting the render target index in an array to render to. Available in geometry shaders and possibly earlier stages depending on hardware/API capability.
- ViewportIndexΒΆ
An output for selecting the viewport index to render to. Available in geometry shaders and possibly earlier stages depending on hardware/API capability.
- VertexIndexΒΆ
An input to the vertex shader listing the vertex index. The exact meaning of this index can vary by API but generally it refers to either a 0-based counter for non-indexed draws, or the index value for indexed draws. It may or may not be affected by offsets, depending on API semantics.
- PrimitiveIndexΒΆ
A built-in indicating which primitive is being processed. This can be read by all primitive stages after the vertex shader, and written by the geometry shader.
- InstanceIndexΒΆ
This built-in is defined similar to
VertexIndexbut for instances within an instanced drawcall. It counts from 0 and as withVertexIndexit may or may not be affected by drawcall offsets.
- DispatchSizeΒΆ
An input in compute shaders that gives the number of workgroups executed by the dispatch call.
- DispatchThreadIndexΒΆ
An input in compute shaders giving a 3D shared index across all workgroups, such that the index varies across each thread in the workgroup up to its size, then the indices for workgroup
(0,0,1)begin adjacent to where workgroup(0,0,0)ended.This is related to
GroupThreadIndexandGroupIndex.
- GroupIndexΒΆ
An input in compute shaders giving a 3D index of this current workgroup among all workgroups, up to the dispatch size.
The index is constant across all threads in the workgroup.
This is related to
GroupThreadIndexandDispatchThreadIndex.
- GroupSizeΒΆ
The size of a workgroup, giving the number of threads in each dimension.
- GroupFlatIndexΒΆ
An input in compute shaders giving a flat 1D index of the thread within the current workgroup. This index increments first in the
Xdimension, then in theYdimension, then in theZdimension.
- GroupThreadIndexΒΆ
An input in compute shaders giving a 3D index of this thread within its workgroup, up to the workgroup size.
The input does not vary between one thread in a workgroup and the same thread in another workgroup.
This is related to
GroupIndexandDispatchThreadIndex.
- GSInstanceIndexΒΆ
An input to the geometry shader giving the instance being run, if the geometry shader was setup to be invoked multiple times for each input primitive.
- OutputControlPointIndexΒΆ
An input to the tessellation control or hull shader giving the output control point index or patch vertex being operated on.
- DomainLocationΒΆ
An input to the tessellation evaluation or domain shader, giving the normalised location on the output patch where evaluation is occurring. E.g. for triangle output this is the barycentric co-ordinates of the output vertex.
- IsFrontFaceΒΆ
An input to the pixel shader indicating whether or not the contributing triangle was considered front-facing or not according to the API setup for winding order and backface orientation.
- MSAACoverageΒΆ
An input or an output from the pixel shader. As an input, it specifies a bitmask of which samples in a pixel were covered by the rasterizer. As an output, it specifies which samples in the destination target should be updated.
- MSAASamplePositionΒΆ
An input to the pixel shader that contains the location of the current sample relative to the pixel, when running the pixel shader at sample frequency.
- MSAASampleIndexΒΆ
An input to the pixel shader that indicates which sample in the range
0 .. N-1is currently being processed.
- PatchNumVerticesΒΆ
An input to the tessellation stages, this gives the number of vertices in each patch.
- OuterTessFactorΒΆ
An output from the tessellation control or hull shader, this determines the level to which the outer edge of each primitive is tessellated by the fixed-function tessellator.
It is also available for reading in the tessellation evaluation or domain shader.
- InsideTessFactorΒΆ
Related to
OuterTessFactorthis functions in the same way to determine the tessellation level inside the primitive.
- ColorOutputΒΆ
An output from the pixel shader, this determines the color value written to the corresponding target. There will be as many color output built-ins as there are targets bound.
- DepthOutputΒΆ
An output from the pixel shader, writes the depth of this pixel with no restrictions.
Related to
DepthOutputGreaterEqualandDepthOutputLessEqual.
- DepthOutputGreaterEqualΒΆ
An output from the pixel shader, writes the depth of this pixel with the restriction that it will be greater than or equal to the original depth produced by the rasterizer.
Related to
DepthOutputandDepthOutputLessEqual.
- DepthOutputLessEqualΒΆ
An output from the pixel shader, writes the depth of this pixel with the restriction that it will be less than or equal to the original depth produced by the rasterizer.
Related to
DepthOutputGreaterEqualandDepthOutput.
- BaseVertexΒΆ
The first vertex processed in this draw, as specified by the
firstVertex/baseVertexparameter to the draw call.
- BaseInstanceΒΆ
The first instance processed in this draw call, as specified by the
firstInstanceparameter.
- DrawIndexΒΆ
For indirect or multi-draw commands, the index of this draw call within the overall draw command.
- StencilReferenceΒΆ
The stencil reference to be used for stenciling operations on this fragment.
- PointCoordΒΆ
The fragments co-ordinates within a point primitive being rasterized.
- IsHelperΒΆ
Indicates if the current invocation is a helper invocation.
- SubgroupSizeΒΆ
The number of invocations in a subgroup.
- NumSubgroupsΒΆ
The number of subgroups in the local workgroup.
- SubgroupIndexInWorkgroupΒΆ
The index of the current subgroup within all subgroups in the workgroup, up to
NumSubgroups- 1.
- IndexInSubgroupΒΆ
The index of the current thread in the current subgroup, up to
SubgroupSize- 1.
- SubgroupEqualMaskΒΆ
A bitmask where the bit corresponding to
IndexInSubgroupis set.
- SubgroupGreaterEqualMaskΒΆ
A bitmask where all bits greater or equal to the one corresponding to
IndexInSubgroupare set.
- SubgroupGreaterMaskΒΆ
A bitmask where all bits greater than the one corresponding to
IndexInSubgroupare set.
- SubgroupLessEqualMaskΒΆ
A bitmask where all bits less or equal to the one corresponding to
IndexInSubgroupare set.
- SubgroupLessMaskΒΆ
A bitmask where all bits less than the one corresponding to
IndexInSubgroupare set.
- DeviceIndexΒΆ
The device index executing the shader, relative to the current device group.
- IsFullyCoveredΒΆ
Indicates if the current fragment area is fully covered by the generating primitive.
- FragAreaSizeΒΆ
Gives the dimensions of the area that the fragment covers.
- FragInvocationCountΒΆ
Gives the maximum number of invocations for the fragment being covered.
- PackedFragRateΒΆ
Contains the packed shading rate, with an API specific packing of X and Y. For example:
1x being 0, 2x being 1, 4x being 2. Then the lower two bits being the Y rate and the next 2 bits being the X rate.
- BarycentricsΒΆ
Contains the barycentric co-ordinates.
- CullPrimitiveΒΆ
An output to indicate whether or not a primitive should be culled.
- OutputIndicesΒΆ
An output containing the indices for a meshlet.
- MultiViewIndexΒΆ
An input specifying the view being rendered to in multiview rendering. Only valid when multiview rendering is enabled.
- class renderdoc.ConstantBlockΒΆ
- class renderdoc.ConstantBlock(other: ConstantBlock)
Contains the information for a block of constant values. The values are not present, only the metadata about how the variables are stored in memory itself and their type/name information.
- bindArraySizeΒΆ
If this binding is natively arrayed, how large is the array size. If not arrayed, this will be set to 1.
This value may be set to a very large number if the array is unbounded in the shader.
- Type:
int
- bufferBackedΒΆ
Trueif the contents are stored in a buffer of memory. If not then they are set by some other API-specific method, such as direct function calls or they may be compile-time specialisation constants.- Type:
bool
- byteSizeΒΆ
The total number of bytes consumed by all of the constants contained in this block.
- Type:
int
- compileConstantsΒΆ
Trueif this is a virtual buffer listing compile-time specialisation constants.- Type:
bool
- fixedBindNumberΒΆ
The fixed binding number for this binding. The interpretation of this is API-specific and it is provided purely for informational purposes and has no bearing on how data is accessed or described. Similarly some bindings donβt have a fixed bind number and the value here should not be relied on.
For OpenGL only, this value is not used as bindings are dynamic and cannot be determined by the shader reflection. Bindings must be determined only by the descriptor mapped to.
Generally speaking sorting by this number will give a reasonable ordering by binding if it exists.
Note
Because this number is API-specific, there is no guarantee that it will be unique across all resources, though generally it will be unique within all binds of the same type. It should be used only within contexts that can interpret it API-specifically, or else for purely informational/non-semantic purposes like sorting.
- Type:
int
- fixedBindSetOrSpaceΒΆ
The fixed binding set or space for this binding. This is API-specific, on Vulkan this gives the set and on D3D12 this gives the register space. It is provided purely for informational purposes and has no bearing on how data is accessed or described.
Generally speaking sorting by this number before
fixedBindNumberwill give a reasonable ordering by binding if it exists.- Type:
int
- inlineDataBytesΒΆ
Trueif this is backed by in-line data bytes rather than a specific buffer.- Type:
bool
- nameΒΆ
The name of this constant block, may be empty on some APIs.
- Type:
str
- variablesΒΆ
The constants contained within this block.
- Type:
List[ShaderConstant]
- class renderdoc.ShaderSamplerΒΆ
- class renderdoc.ShaderSampler(other: ShaderSampler)
Contains the information for a separate sampler in a shader. If the API doesnβt have the concept of separate samplers, this struct will be unused and only
ShaderResourceis relevant.Note
that constant blocks will not have a shader resource entry, see
ConstantBlock.- bindArraySizeΒΆ
If this binding is natively arrayed, how large is the array size. If not arrayed, this will be set to 1.
This value may be set to a very large number if the array is unbounded in the shader.
- Type:
int
- fixedBindNumberΒΆ
The fixed binding number for this binding. The interpretation of this is API-specific and it is provided purely for informational purposes and has no bearing on how data is accessed or described. Similarly some bindings donβt have a fixed bind number and the value here should not be relied on.
For OpenGL only, this value is not used as bindings are dynamic and cannot be determined by the shader reflection. Bindings must be determined only by the descriptor mapped to.
Generally speaking sorting by this number will give a reasonable ordering by binding if it exists.
Note
Because this number is API-specific, there is no guarantee that it will be unique across all resources, though generally it will be unique within all binds of the same type. It should be used only within contexts that can interpret it API-specifically, or else for purely informational/non-semantic purposes like sorting.
- Type:
int
- fixedBindSetOrSpaceΒΆ
The fixed binding set or space for this binding. This is API-specific, on Vulkan this gives the set and on D3D12 this gives the register space. It is provided purely for informational purposes and has no bearing on how data is accessed or described.
Generally speaking sorting by this number before
fixedBindNumberwill give a reasonable ordering by binding if it exists.- Type:
int
- nameΒΆ
The name of this sampler.
- Type:
str
- class renderdoc.ShaderResourceΒΆ
- class renderdoc.ShaderResource(other: ShaderResource)
Contains the information for a shader resource that is made accessible to shaders directly by means of the API resource binding system.
Note
that constant blocks and samplers will not have a shader resource entry, see
ConstantBlockandShaderSampler.- bindArraySizeΒΆ
If this binding is natively arrayed, how large is the array size. If not arrayed, this will be set to 1.
This value may be set to a very large number if the array is unbounded in the shader.
- Type:
int
- descriptorTypeΒΆ
The
DescriptorTypewhich this resource expects to access.- Type:
- fixedBindNumberΒΆ
The fixed binding number for this binding. The interpretation of this is API-specific and it is provided purely for informational purposes and has no bearing on how data is accessed or described. Similarly some bindings donβt have a fixed bind number and the value here should not be relied on.
For OpenGL only, this value is not used as bindings are dynamic and cannot be determined by the shader reflection. Bindings must be determined only by the descriptor mapped to.
Generally speaking sorting by this number will give a reasonable ordering by binding if it exists.
Note
Because this number is API-specific, there is no guarantee that it will be unique across all resources, though generally it will be unique within all binds of the same type. It should be used only within contexts that can interpret it API-specifically, or else for purely informational/non-semantic purposes like sorting.
- Type:
int
- fixedBindSetOrSpaceΒΆ
The fixed binding set or space for this binding. This is API-specific, on Vulkan this gives the set and on D3D12 this gives the register space. It is provided purely for informational purposes and has no bearing on how data is accessed or described.
Generally speaking sorting by this number before
fixedBindNumberwill give a reasonable ordering by binding if it exists.- Type:
int
- hasSamplerΒΆ
Trueif this texture resource has a sampler as well.- Type:
bool
- isInputAttachmentΒΆ
Trueif this texture resource is a subpass input attachment.- Type:
bool
- isReadOnlyΒΆ
Trueif this resource is available to the shader for reading only, otherwise it is able to be read from and written to arbitrarily.- Type:
bool
- isTextureΒΆ
Trueif this resource is a texture, otherwise it is a buffer.- Type:
bool
- nameΒΆ
The name of this resource.
- Type:
str
- textureTypeΒΆ
The
TextureTypethat describes the type of this resource.- Type:
- variableTypeΒΆ
The type of each element of this resource.
- Type:
Debug InfoΒΆ
- class renderdoc.ShaderDebugInfoΒΆ
- class renderdoc.ShaderDebugInfo(other: ShaderDebugInfo)
Contains the information about a shader contained within API-specific debugging information attached to the shader.
Primarily this means the embedded original source files.
- compileFlagsΒΆ
The flags used to compile this shader.
- Type:
- compilerΒΆ
The
KnownShaderToolof the compiling tool.- Type:
- debugInfoLoadingLogΒΆ
Contains a log of the debug shader loading process i.e. searching for shader PDB.
- Type:
str
- debugStatusΒΆ
If
debuggableis false then this contains a simple explanation of why the shader is not supported for debugging- Type:
str
- debuggableΒΆ
Indicates whether this particular shader can be debugged. In some cases even if the API can debug shaders in general, specific shaders cannot be debugged because they use unsupported functionality
- Type:
bool
- editBaseFileΒΆ
The index of the file which should be used for re-editing this shaderβs entry point.
This is an optional value, and if set to
-1you should fall back to using the file specified inentryLocation, and if no file is specified there then use the first file listed.- Type:
int
- encodingΒΆ
The
ShaderEncodingof the source. Seefiles.- Type:
- entryLocationΒΆ
The source location of the first executable line or the entry point.
Note
The information is not guaranteed to be available depending on the underlying shader format, so all of the elements are optional.
- Type:
- entrySourceNameΒΆ
The name of the entry point in the source code, not necessarily the same as the entry point name exported to the API.
- Type:
str
- filesΒΆ
The shader files encoded in the form denoted by
encoding.The first entry in the list is always the file where the entry point is.
- Type:
List[ShaderSourceFile]
- sourceDebugInformationΒΆ
Indicates whether this shader has debug information to allow source-level debugging.
- Type:
bool
- class renderdoc.ShaderEncoding(value)ΒΆ
Identifies a shader encoding used to pass shader code to an API.
- UnknownΒΆ
Unknown or unprocessable format.
- DXBCΒΆ
DXBC binary shader, used by D3D11 and D3D12.
- GLSLΒΆ
GLSL in string format, used by OpenGL.
- SPIRVΒΆ
SPIR-V binary shader, as used by Vulkan. This format is technically not distinct from
OpenGLSPIRVbut is considered unique here since it really should have been a different format, and introducing a separation allows better selection of tools automatically.
- OpenGLSPIRVΒΆ
SPIR-V binary shader, as used by OpenGL. This format is technically not distinct from
SPIRVbut is considered unique here since it really should have been a different format, and introducing a separation allows better selection of tools automatically.
- OpenGLSPIRVAsmΒΆ
Canonical SPIR-V assembly form, used (indirectly via
OpenGLSPIRV) by OpenGL. SeeOpenGLSPIRVand note that itβs artificially differentiated fromSPIRVAsm.
- HLSLΒΆ
HLSL in string format, used by D3D11, D3D12, and Vulkan/GL via compilation to SPIR-V.
- DXILΒΆ
DXIL binary shader, used by D3D12. Note that although the container is still DXBC format this is used to distinguish from
DXBCfor compiler I/O matching.
- SlangΒΆ
Slang in string format, used by the slang compiler for compilation to multiple backend formats.
- class renderdoc.KnownShaderTool(value)ΒΆ
Identifies a particular known tool used for shader processing.
- UnknownΒΆ
Corresponds to no known tool.
- SPIRV_CrossΒΆ
- SPIRV-Cross
targeting normal Vulkan flavoured SPIR-V.
- SPIRV_Cross_OpenGLΒΆ
- SPIRV-Cross
targeting OpenGL extension flavoured SPIR-V.
- spirv_disΒΆ
- spirv-dis from SPIRV-Tools
targeting normal Vulkan flavoured SPIR-V.
- spirv_dis_OpenGLΒΆ
- spirv-dis from SPIRV-Tools
targeting OpenGL extension flavoured SPIR-V.
- glslangValidatorGLSLΒΆ
- glslang compiler (GLSL)
targeting normal Vulkan flavoured SPIR-V.
- glslangValidatorGLSL_OpenGLΒΆ
- glslang compiler (GLSL)
targeting OpenGL extension flavoured SPIR-V.
- glslangValidatorHLSLΒΆ
- spirv_asΒΆ
- spirv-as from SPIRV-Tools
targeting normal Vulkan flavoured SPIR-V.
- spirv_as_OpenGLΒΆ
- spirv-as from SPIRV-Tools
targeting OpenGL extension flavoured SPIR-V.
- dxcSPIRVΒΆ
- DirectX Shader Compiler with Vulkan SPIR-V
output.
- dxcDXILΒΆ
DirectX Shader Compiler with DXIL output.
- fxcΒΆ
fxc Shader Compiler with DXBC output.
- slangSPIRVΒΆ
Slang Shader Compiler with Vulkan SPIR-V output.
- slangDXILΒΆ
Slang Shader Compiler with DXIL output.
- renderdoc.ToolExecutable(tool)ΒΆ
Returns the default executable name with no suffix for a given
KnownShaderTool.Note
The executable name is returned with no suffix, e.g.
foobarwhich may need a platform specific suffix like.exeappended.- Parameters:
tool# (KnownShaderTool) β The tool to get the executable name for.
- Returns:
The default executable name for this tool, or an empty string if the tool is unrecognised.
- Return type:
str
- renderdoc.ToolInput(tool)ΒΆ
Returns the expected default input
ShaderEncodingthat aKnownShaderToolexpects. This may not be accurate and may be configurable depending on the tool.- Parameters:
tool# (KnownShaderTool) β The tool to get the input encoding for.
- Returns:
The encoding that this tool expects as an input by default.
- Return type:
- renderdoc.ToolOutput(tool)ΒΆ
Returns the expected default output
ShaderEncodingthat aKnownShaderToolproduces. This may not be accurate and may be configurable depending on the tool.- Parameters:
tool# (KnownShaderTool) β The tool to get the output encoding for.
- Returns:
The encoding that this tool produces as an output by default.
- Return type:
- renderdoc.IsTextRepresentation(encoding)ΒΆ
Check whether or not this is a human readable text representation.
- Parameters:
encoding# (ShaderEncoding) β The encoding to check.
- Returns:
Trueif it describes a text representation,Falsefor a bytecode representation.- Return type:
bool
- class renderdoc.ShaderEntryPointΒΆ
- class renderdoc.ShaderEntryPoint(other: ShaderEntryPoint)
- class renderdoc.ShaderEntryPoint(name: str, stage: ShaderStage)
Describes an entry point in a shader.
- nameΒΆ
The name of the entry point.
- Type:
str
- stageΒΆ
The
ShaderStagefor this entry point .- Type:
- class renderdoc.ShaderSourceFileΒΆ
- class renderdoc.ShaderSourceFile(other: ShaderSourceFile)
Contains a source file available in a debug-compiled shader.
- contentsΒΆ
The actual contents of the file.
- Type:
str
- filenameΒΆ
The filename of this source file.
- Type:
str
- class renderdoc.ShaderCompileFlagsΒΆ
- class renderdoc.ShaderCompileFlags(other: ShaderCompileFlags)
Contains the information about the compilation environment of a shader
- flagsΒΆ
The API or compiler specific flags used to compile this shader originally.
- Type:
List[ShaderCompileFlag]
- class renderdoc.ShaderCompileFlagΒΆ
- class renderdoc.ShaderCompileFlag(other: ShaderCompileFlag)
Contains a single flag used at compile-time on a shader.
- nameΒΆ
The name of the compile flag.
- Type:
str
- valueΒΆ
The value of the compile flag.
- Type:
str
- class renderdoc.ShaderSourcePrefixΒΆ
- class renderdoc.ShaderSourcePrefix(other: ShaderSourcePrefix)
Contains the source prefix to add to a given type of shader source
- encodingΒΆ
The encoding of the language this prefix applies to.
- Type:
- prefixΒΆ
The source prefix to add.
- Type:
str
Shader ConstantsΒΆ
- class renderdoc.ShaderConstantΒΆ
- class renderdoc.ShaderConstant(other: ShaderConstant)
Contains the detail of a constant within a struct, such as a
ConstantBlock, with its type and relative location in memory.- bitFieldOffsetΒΆ
If the variable is bitfield packed, the bit offset from
byteOffsetabove where this variable starts.If the variable is not a bitfield, this value will be 0. Only integer scalars will have bitfield packing.
Note
Although the offset specified in
byteOffsetis in bytes, this bitfield offset may be larger than 0 depending on the surrounding values and their types and packing. However it is guaranteed that the offset and the size (frombitFieldSize) will be contained within the normal bit size for the variable type. For example if the variable type is a 32-bit integer, the offsets may range from 0 to 31 and the sum of offset and size will be no more than 32. If the variable is an 8-bit integer, similarly the offset will be 0 to 7 and the sum will be no more than 8.- Type:
int
- bitFieldSizeΒΆ
If the variable is bitfield packed, the number of bits this variable spans starting from
bitFieldOffsetinto memory.If the variable is not a bitfield, this value will be 0. Only integer scalars will have bitfield packing.
- Type:
int
- byteOffsetΒΆ
The byte offset of this constant relative to the parent structure
- Type:
int
- defaultValueΒΆ
If this constant is no larger than a 64-bit constant, gives a default value for it.
- Type:
int
- nameΒΆ
The name of this constant
- Type:
str
- typeΒΆ
The type information for this constant.
- Type:
- class renderdoc.ShaderConstantTypeΒΆ
- class renderdoc.ShaderConstantType(other: ShaderConstantType)
Describes the type and members of a
ShaderConstant.- ColMajor()ΒΆ
Helper function for checking if
flagsdoes not haveShaderVariableFlags.RowMajorMatrixset. This is entirely equivalent to checking that flag manually, but since it is common this helper is provided.Note
Vectors and scalars will be marked as row-major by convention for convenience.
- Returns:
If the storage is column-major order in memory
- Return type:
bool
- RowMajor()ΒΆ
Helper function for checking if
flagshasShaderVariableFlags.RowMajorMatrixset. This is entirely equivalent to checking that flag manually, but since it is common this helper is provided.Note
Vectors and scalars will be marked as row-major by convention for convenience.
- Returns:
If the storage is row-major order in memory
- Return type:
bool
- arrayByteStrideΒΆ
The number of bytes between the start of one element in the array and the next.
- Type:
int
- columnsΒΆ
The number of columns in this matrix.
- Type:
int
- elementsΒΆ
The number of elements in the array, or 1 if itβs not an array.
- Type:
int
- flagsΒΆ
The flags controlling how this constant is interpreted and displayed.
- Type:
- matrixByteStrideΒΆ
The number of bytes between the start of one column/row in a matrix and the next.
- Type:
int
- membersΒΆ
Any members that this constant may contain.
- Type:
List[ShaderConstant]
- nameΒΆ
The name of the type of this constant, e.g. a
structname.- Type:
str
- pointerTypeIDΒΆ
The index in
ShaderReflection.pointerTypesof the pointee type.- Type:
int
- rowsΒΆ
The number of rows in this matrix.
- Type:
int
- class renderdoc.ShaderVariableFlags(value)ΒΆ
A set of flags for events that control how a shader/buffer value is interpreted and displayed
- NoFlagsΒΆ
No flags are specified.
- RowMajorMatrixΒΆ
This matrix is stored in row-major order in memory, instead of column-major. In RenderDoc values are always provided row-major regardless, for consistency of access, but if this flag is not present then the original values were in column order in memory, so the data has been transposed.
- HexDisplayΒΆ
This value should be displayed using hexadecimal where possible.
- BinaryDisplayΒΆ
This value should be displayed using binary where possible.
- RGBDisplayΒΆ
This value should be interpreted as an RGB colour for display where possible.
- R11G11B10ΒΆ
This value should be decoded from a 32-bit integer in R11G11B10 packing format.
- R10G10B10A2ΒΆ
This value should be decoded from a 32-bit integer in R10G10B10A2 packing format.
- UNormΒΆ
This value should be treated as unsigned normalised floating point values when interpreting.
- SNormΒΆ
This value should be treated as signed normalised floating point values when interpreting.
- TruncatedΒΆ
This value was truncated when reading - the available range was exhausted.
- SignedEnumΒΆ
For enums, the base type is a signed integer allowing signed values.
- SingleElementArrayΒΆ
In some cases it can be possible to represent and need to distinguish a variable declared as an array of size 1 from a scalar object. This flag indicates that even though elements == 1 normally means βnot an arrayβ, in this case it means an array of size 1.
- class renderdoc.VarType(value)ΒΆ
Represents the base type of a shader variable in debugging or constant blocks.
- FloatΒΆ
A single-precision (32-bit) floating point value.
- DoubleΒΆ
A double-precision (64-bit) floating point value.
- HalfΒΆ
A half-precision (16-bit) floating point value.
- SIntΒΆ
A signed 32-bit integer value.
- UIntΒΆ
An unsigned 32-bit integer value.
- SShortΒΆ
A signed 16-bit integer value.
- UShortΒΆ
An unsigned 16-bit integer value.
- SLongΒΆ
A signed 64-bit integer value.
- ULongΒΆ
An unsigned 64-bit integer value.
- SByteΒΆ
A signed 8-bit integer value.
- UByteΒΆ
An unsigned 8-bit integer value.
- BoolΒΆ
A boolean value.
- EnumΒΆ
An enum - each member gives a named value, and the type itself is stored as an integer.
- StructΒΆ
A structure with some number of members.
- GPUPointerΒΆ
A 64-bit pointer into GPU-addressable memory. Variables with this type are stored with opaque contents and should be decoded with
ShaderVariable.GetPointer().
- ConstantBlockΒΆ
A reference to a constant block bound to the shader. Variables with this type are stored with opaque contents and should be decoded with
ShaderVariable.GetBindIndex().
- ReadOnlyResourceΒΆ
A reference to a read only resource bound to the shader. Variables with this type are stored with opaque contents and should be decoded with
ShaderVariable.GetBindIndex().
- ReadWriteResourceΒΆ
A reference to a read/write resource bound to the shader. Variables with this type are stored with opaque contents and should be decoded with
ShaderVariable.GetBindIndex().
- SamplerΒΆ
A reference to a sampler bound to the shader. Variables with this type are stored with opaque contents and should be decoded with
ShaderVariable.GetBindIndex().
- UnknownΒΆ
An unknown type.
- renderdoc.VarTypeByteSize(type)ΒΆ
Get the byte size of a variable type.
Shader DebuggingΒΆ
- class renderdoc.ShaderDebugTraceΒΆ
This stores the whole state of a shaderβs execution from start to finish, with each individual debugging step along the way, as well as the immutable global constant values that do not change with shader execution.
- constantBlocksΒΆ
Constant buffer backed variables for this shader.
Each entry in this list corresponds to a constant block with the same index in the
ShaderReflection.constantBlockslist, which can be used to look up the metadata.Depending on the underlying shader representation, the constant block may retain any structure or it may have been vectorised and flattened.
- Type:
List[ShaderVariable]
- debuggerΒΆ
An opaque handle identifying by the underlying debugger, which is used to simulate the shader and generate new debug states.
If this is
Nonethen the trace is invalid.- Type:
- inputsΒΆ
The input variables for this shader.
- Type:
List[ShaderVariable]
- instInfoΒΆ
An array of the same size as the number of instructions in the shader, with per-instruction information such as source line mapping, and source variables.
Warning
This array is not indexed by instruction. Since it is common for adjacent instructions to have effectively identical source information, this array only stores unique information ordered by instruction. On some internal representations this may be one entry per instruction, and on others it may be sparse and require a binary lookup to locate the corresponding information for an instruction. If no direct match is found, the lower bound match is valid (i.e. the data for instruction A before the data for instruction B is valid for all instructions in range
[A, B).- Type:
List[InstructionSourceInfo]
- readOnlyResourcesΒΆ
The read-only resource variables for this shader.
The βvalueβ of the variable is always a single unsigned integer, which is the bindpoint - an index into the
ShaderReflection.readOnlyResourceslist, which can be used to look up the other metadata as well as find the binding from the pipeline state.- Type:
List[ShaderVariable]
- readWriteResourcesΒΆ
The read-write resource variables for this shader.
The βvalueβ of the variable is always a single unsigned integer, which is the bindpoint - an index into the
ShaderReflection.readWriteResourceslist, which can be used to look up the other metadata as well as find the binding from the pipeline state.- Type:
List[ShaderVariable]
- samplersΒΆ
The sampler variables for this shader.
The βvalueβ of the variable is always a single unsigned integer, which is the bindpoint - an index into the
ShaderReflection.samplerslist, which can be used to look up the other metadata as well as find the binding from the pipeline state.- Type:
List[ShaderVariable]
- sourceVarsΒΆ
An optional mapping from high-level source variables to which debug variables and includes extra type information.
This list contains source variable mapping that is valid for the lifetime of a debug trace. It may be empty if there is no source variable mapping that extends to the life of the debug trace.
- Type:
List[SourceVariableMapping]
- stageΒΆ
The shader stage being debugged in this trace
- Type:
- class renderdoc.ShaderDebuggerΒΆ
An opaque structure that has internal state for shader debugging
- class renderdoc.SourceVariableMappingΒΆ
- class renderdoc.SourceVariableMapping(other: SourceVariableMapping)
Maps the contents of a high-level source variable to one or more shader variables in a
ShaderDebugState, with type information.A single high-level variable may be represented by multiple mappings but only along regular boundaries, typically whole vectors. For example an array may have each element in a different mapping, or a matrix may have a mapping per row. The properties such as
rowsandcolumnsreflect the parent object.Note
There is not necessarily a 1:1 mapping from source variable to debug variable, so this can change over time.
- columnsΒΆ
The number of columns in this variable.
- Type:
int
- nameΒΆ
The name and member of this source variable thatβs being mapped from.
- Type:
str
- offsetΒΆ
The offset in the parent source variable, for struct members. Useful for sorting.
- Type:
int
- rowsΒΆ
The number of rows in this variable - 1 for vectors, >1 for matrices.
- Type:
int
- signatureIndexΒΆ
The index in the input or output signature of the shader that this variable represents.
The type of signature can be disambiguated by the debug variables referenced - inputs are stored separately.
This will be set to -1 if the variable is not part of either signature.
- Type:
int
- typeΒΆ
The variable type of the source being mapped from, if the debug variable is untyped.
- Type:
- undefinedValueΒΆ
A flag indicating if this mapping indicates an undefined value - the meaning of which is compiler defined but may mean either uninitialised data, unassigned values, or optimised away values.
- Type:
bool
- variablesΒΆ
The debug variables that the components of this high level variable map to. Multiple ranges could refer to the same variable if a contiguous range is mapped to - the mapping is component-by-component to greatly simplify algorithms at the expense of a small amount of storage space.
- Type:
List[DebugVariableReference]
- class renderdoc.DebugVariableReferenceΒΆ
- class renderdoc.DebugVariableReference(other: DebugVariableReference)
- class renderdoc.DebugVariableReference(type: DebugVariableType, name: str, component: int)
A particular component of a debugging variable that a high-level variable component maps to
- componentΒΆ
The component within the variable.
- Type:
int
- nameΒΆ
The name of the base debug variable.
- Type:
str
- typeΒΆ
The type of variable this is referring to.
- Type:
- class renderdoc.DebugVariableType(value)ΒΆ
Represents the category of debugging variable that a source variable maps to.
- UndefinedΒΆ
Undefined type.
- InputΒΆ
A constant input value, stored globally.
- ConstantΒΆ
A constant buffer value, stored globally.
- SamplerΒΆ
A sampler, stored globally.
- ReadOnlyResourceΒΆ
A read-only resource, stored globally.
- ReadWriteResourceΒΆ
A read-write resource, stored globally.
- VariableΒΆ
A mutable variable, stored per state.
- class renderdoc.LineColumnInfoΒΆ
- class renderdoc.LineColumnInfo(other: LineColumnInfo)
Details the current region of code that an instruction maps to.
- SourceEqual(o)ΒΆ
- Parameters:
o# (LineColumnInfo) β The object to compare against.
- Returns:
Trueif this object is equal to the parameter, disregardingdisassemblyLine.- Return type:
bool
- colEndΒΆ
The column number (starting from 1) of the end of the code on the line specified by
lineEnd. If set to 0, no column information is available and the whole lines should be treated as covering the code.- Type:
int
- colStartΒΆ
The column number (starting from 1) of the start of the code on the line specified by
lineStart. If set to 0, no column information is available and the whole lines should be treated as covering the code.- Type:
int
- disassemblyLineΒΆ
The line (starting from 1) in the disassembly where this instruction is located.
- Type:
int
- fileIndexΒΆ
The current file, as an index into the list of files for this shader.
If this is negative, no source mapping is available and only
disassemblyLineis valid.- Type:
int
- lineEndΒΆ
The ending line-number (starting from 1) of the source code.
- Type:
int
- lineStartΒΆ
The starting line-number (starting from 1) of the source code.
- Type:
int
- class renderdoc.InstructionSourceInfoΒΆ
- class renderdoc.InstructionSourceInfo(other: InstructionSourceInfo)
Gives per-instruction source code mapping information, including what line(s) correspond to this instruction and which source variables exist
- instructionΒΆ
The instruction that this information is for.
- Type:
int
- lineInfoΒΆ
The source location that this instruction corresponds to
- Type:
- sourceVarsΒΆ
An optional mapping of which high-level source variables map to which debug variables and including extra type information.
This list contains source variable mapping that is only valid at this instruction, and is fully complete & redundant including all previous source variables that are still valid at this instruction.
- Type:
List[SourceVariableMapping]
- class renderdoc.ShaderDebugStateΒΆ
- class renderdoc.ShaderDebugState(other: ShaderDebugState)
This stores the current state of shader debugging at one particular step in the shader, with all mutable variable contents.
- callstackΒΆ
The function names in the current callstack at this instruction.
The oldest/outer function is first in the list, the newest/inner function is last.
- Type:
List[str]
- changesΒΆ
The changes in mutable variables for this shader. The change documents the bidirectional change of variables, so that a single state can be updated either forwards or backwards using the information.
- Type:
List[ShaderVariableChange]
- flagsΒΆ
A set of
ShaderEventsflags that indicate what events happened on this step.- Type:
- nextInstructionΒΆ
The next instruction to be executed after this state. The initial state before any shader execution happened will have
nextInstruction == 0.- Type:
int
- stepIndexΒΆ
The program counter within the debug trace. The initial state will be index 0, and it will increment linearly after that regardless of loops or branching.
- Type:
int
- class renderdoc.ShaderEvents(value)ΒΆ
A set of flags for events that may occur while debugging a shader
- NoEventΒΆ
No event has occurred.
- SampleLoadGatherΒΆ
A texture was sampled, loaded or gathered.
- GeneratedNanOrInfΒΆ
A floating point operation generated a
NaNorinfinityresult.
- DebugBreakΒΆ
A
debugbreak()event was emitted.
- class renderdoc.ShaderVariableChangeΒΆ
- class renderdoc.ShaderVariableChange(other: ShaderVariableChange)
This stores the before and after state of a
ShaderVariable.- afterΒΆ
The value of the variable after the change. If this variable is uninitialised that means the variable stopped existing on this step.
- Type:
- beforeΒΆ
The value of the variable before the change. If this variable is uninitialised that means the variable came into existence on this step.
- Type:
Shader VariablesΒΆ
- class renderdoc.ShaderVariableΒΆ
- class renderdoc.ShaderVariable(other: ShaderVariable)
- class renderdoc.ShaderVariable(name: str, x: float, y: float, z: float, w: float)
- class renderdoc.ShaderVariable(name: str, x: int, y: int, z: int, w: int)
Holds a single named shader variable. It contains either a primitive type (up to a 4x4 matrix of a
basic type) or a list of members, which can either be struct or array members of this parent variable.Matrices are always stored row-major. If necessary they are transposed when retrieving from the raw data bytes when they are specified to be column-major in the API/shader metadata.
- ColMajor()ΒΆ
Helper function for checking if
flagsdoes not haveShaderVariableFlags.RowMajorMatrixset. This is entirely equivalent to checking that flag manually, but since it is common this helper is provided.Note
Vectors and scalars will be marked as row-major by convention for convenience.
- Returns:
If the storage is column-major order in memory
- Return type:
bool
- GetBindIndex()ΒΆ
Utility function for getting a shader binding referenced by this variable.
Note
The return value is undefined if this variable is not a binding reference.
- Returns:
A
ShaderBindIndexwith the binding referenced.- Return type:
- GetDirectAccess()ΒΆ
Utility function for getting the resource which is accessed directly from a shader without using bindings.
Note
The return value is undefined if this variable is not a resource referenced directly by a shader.
- Returns:
A
ShaderDirectAccesscontaining the resource reference.- Return type:
- GetPointer()ΒΆ
Utility function for getting a pointer value, with optional type information.
Note
The return value is undefined if this variable is not a pointer.
- Returns:
A
PointerValwith the pointer value.- Return type:
- IsDirectAccess()ΒΆ
Utility function to check if this variable stores a resource reference directly accessed by a shader.
- Returns:
If the variable represents a
ShaderDirectAccess.- Return type:
bool
- RowMajor()ΒΆ
Helper function for checking if
flagshasShaderVariableFlags.RowMajorMatrixset. This is entirely equivalent to checking that flag manually, but since it is common this helper is provided.Note
Vectors and scalars will be marked as row-major by convention for convenience.
- Returns:
If the storage is row-major order in memory
- Return type:
bool
- SetBindIndex(idx)ΒΆ
Utility function for setting a reference to a shader binding.
The
ShaderBindIndexuniquely refers to a given shader binding in one of the shader interfaces (constant blocks, samplers, read-only and read-write resources) and if necessary the element within an arrayed binding.- Parameters:
idx# (ShaderBindIndex) β The index of the bind being referred to.
- SetDirectAccess(access)ΒΆ
Utility function for setting a resource which is accessed directly from a shader without using bindings.
The
ShaderDirectAccessuniquely refers to a resource descriptor.- Parameters:
access# (ShaderDirectAccess) β The resource descriptor being referenced.
- SetTypedPointer(pointer, shader, pointerTypeID)ΒΆ
Utility function for setting a pointer value with type information.
- Parameters:
pointer# (int) β The actual pointer value.
shader# (ResourceId) β The shader containing the type information.
pointerTypeID# (int) β The typeβs index in the shaderβs
ShaderReflection.pointerTypeslist.
- SetTypelessPointer(pointer)ΒΆ
Utility function for setting a pointer value with no type information.
- Parameters:
pointer# (int) β The actual pointer value.
- columnsΒΆ
The number of columns in this matrix.
- Type:
int
- flagsΒΆ
The flags controlling how this constant is interpreted and displayed.
- Type:
- membersΒΆ
The members of this variable.
- Type:
List[ShaderVariable]
- nameΒΆ
The name of this variable.
- Type:
str
- rowsΒΆ
The number of rows in this matrix.
- Type:
int
- typeΒΆ
The
basic typeof this variable.- Type:
- valueΒΆ
The contents of this variable if it has no members.
- Type:
- class renderdoc.ShaderValueΒΆ
- class renderdoc.ShaderValue(other: ShaderValue)
A C union that holds 16 values, with each different basic variable type.
- f16vΒΆ
16-tuple of 16-bit half-precision float values.
- Type:
Tuple[int,β¦]
- f32vΒΆ
16-tuple of
floatvalues.- Type:
Tuple[float,β¦]
- f64vΒΆ
16-tuple of
doublevalues.- Type:
Tuple[float,β¦]
- s16vΒΆ
16-tuple of 16-bit signed integer values.
- Type:
Tuple[int,β¦]
- s32vΒΆ
16-tuple of 32-bit signed integer values.
- Type:
Tuple[int,β¦]
- s64vΒΆ
16-tuple of 64-bit signed integer values.
- Type:
Tuple[int,β¦]
- s8vΒΆ
16-tuple of 8-bit signed integer values.
- Type:
Tuple[int,β¦]
- u16vΒΆ
16-tuple of 16-bit unsigned integer values.
- Type:
Tuple[int,β¦]
- u32vΒΆ
16-tuple of 32-bit unsigned integer values.
- Type:
Tuple[int,β¦]
- u64vΒΆ
16-tuple of 64-bit unsigned integer values.
- Type:
Tuple[int,β¦]
- u8vΒΆ
16-tuple of 8-bit unsigned integer values.
- Type:
Tuple[int,β¦]
- class renderdoc.PointerValΒΆ
- class renderdoc.PointerVal(other: PointerVal)
A 64-bit pointer value with optional type information.
- pointerΒΆ
The actual pointer value itself.
- Type:
int
- pointerTypeIDΒΆ
The index into
ShaderReflection.pointerTypesof the pointed type.- Type:
int
- shaderΒΆ
An optional
ResourceIdidentifying the shader containing the type info.- Type:
- class renderdoc.ShaderBindIndexΒΆ
- class renderdoc.ShaderBindIndex(other: ShaderBindIndex)
- class renderdoc.ShaderBindIndex(category: DescriptorCategory, index: int)
- class renderdoc.ShaderBindIndex(category: DescriptorCategory, index: int, arrayElement: int)
- class renderdoc.ShaderBindIndex(access: DescriptorAccess)
References a particular individual binding element in a shader interface.
This is the shader interface side of a
DescriptorAccessand so can be compared to one to check if an access refers to a given index or not.The context of which shader reflection this index refers to must be provided to properly interpret this information, as it is relative to a particular
ShaderReflection.- arrayElementΒΆ
If the binding identified by
categoryandindexis arrayed, this identifies the particular array index being referred to.- Type:
int
- categoryΒΆ
The type of binding this refers to, with each category referring to a different shader interface in the
ShaderReflection.- Type:
- class renderdoc.ShaderDirectAccessΒΆ
- class renderdoc.ShaderDirectAccess(other: ShaderDirectAccess)
- class renderdoc.ShaderDirectAccess(category: DescriptorCategory, index: int)
- class renderdoc.ShaderDirectAccess(type: DescriptorType, descriptorStore: ResourceId, byteOffset: int, byteSize: int)
References a particular resource accessed via the shader using direct heap access (as opposed to a direct binding).
- byteOffsetΒΆ
The offset in bytes to the descriptor in the descriptor store.
- Type:
int
- byteSizeΒΆ
The size in bytes of the descriptor.
- Type:
int
- descriptorStoreΒΆ
The backing storage of the descriptor.
- Type:
- typeΒΆ
The type of the resource being accessed.
- Type: