API Reference: Resources¶

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.

General¶

class renderdoc.ResourceId¶

This is an opaque identifier that uniquely locates a resource.

Note

These IDs do not overlap ever - textures, buffers, shaders and samplers will all have unique IDs and do not reuse the namespace. Likewise the IDs assigned for resources during capture are not re-used on replay - the corresponding resources created on replay to stand-in for capture-time resources are given unique IDs and a mapping is stored to between the capture-time resource and the replay-time one.

static Null()¶

A helper function that explicitly creates an empty/invalid/null ResourceId.

Returns:

an empty/invalid/null ResourceId.

Return type:

ResourceId

class renderdoc.ResourceDescription¶

A description of any type of resource.

SetCustomName(givenName)¶

Utility function for setting up a custom name to overwrite the auto-generated one.

Parameters:

givenName# (str) – The custom name to use.

autogeneratedName¶

True if name was just autogenerated based on the ID, not assigned a human-readable name by the application.

Type:

bool

derivedResources¶

The ResourceId of any derived resources, such as resource views or aliases.

Can be empty if there are no derived resources.

This is the inverse of parentResources in a potentially many:many relationship, but typically it is one parent to many derived.

Type:

List[ResourceId]

initialisationChunks¶

The chunk indices in the structured file that initialised this resource.

This will at least contain the first call that created it, but may contain other auxilliary calls.

Type:

List[int]

name¶

The name given to this resource.

Type:

str

parentResources¶

The ResourceId of parent resources, of which this is derived.

Can be empty if there are no parent resources.

This is the inverse of derivedResources in a potentially many:many relationship, but typically it is one parent to many derived.

Type:

List[ResourceId]

resourceId¶

The unique ResourceId that identifies this resource.

Type:

ResourceId

type¶

The ResourceType of the resource.

Type:

ResourceType

class renderdoc.ResourceType(value)¶

The type of a resource referred to by binding or API usage.

In some cases there is a little overlap or fudging when mapping API concepts - this is primarily just intended for e.g. fuzzy user filtering or rough categorisation. Precise mapping would require API-specific concepts.

Unknown¶

An unknown type of resource.

Device¶

A system-level object, typically unique.

Queue¶

A queue representing the ability to execute commands in a single stream, possibly in parallel to other queues.

CommandBuffer¶

A recorded set of commands that can then be subsequently executed.

Texture¶

A texture - one- to three- dimensional, possibly with array layers and mip levels. See TextureDescription.

Buffer¶

A linear (possibly typed) view of memory. See BufferDescription.

View¶

A particular view into a texture or buffer, e.g. either accessing the underlying resource through a different type, or only a subset of the resource.

Sampler¶

The information regarding how a texture is accessed including wrapping, minification/magnification and other information. The precise details are API-specific and listed in the API state when bound.

SwapchainImage¶

A special class of Texture that is owned by the swapchain and is used for presentation.

Memory¶

An object corresponding to an actual memory allocation, which other resources can then be bound to.

Shader¶

A single shader object for any shader stage. May be bound directly, or used to compose into a PipelineState depending on the API.

ShaderBinding¶

An object that determines some manner of shader binding. Since this varies significantly by API, different concepts used for shader resource binding fall under this type.

PipelineState¶

A single object containing all information regarding the current GPU pipeline, containing both shader objects, potentially some shader binding information, and fixed-function state.

StateObject¶

A single object encapsulating some amount of related state that can be set together, instead of setting each individual state separately.

RenderPass¶

An object related to collecting render pass information together. This may not be an actual explicit render pass object if it doesn’t exist in the API, it may also be a collection of textures in a framebuffer that are bound together to the API for rendering.

Query¶

A query for retrieving some kind of feedback from the GPU, either as a fixed number or a boolean value which can be used in predicated rendering.

Sync¶

A synchronisation object used for either synchronisation between GPU and CPU, or GPU-to-GPU work.

Pool¶

An object which pools together other objects in an opaque way, either for runtime allocation and deallocation, or for caching purposes.

AccelerationStructure¶

A structure used to carry implementation-defined spatial partitioning data and related information, used to accelerate geometry intersection queries (e.g. for ray tracing).

DescriptorStore¶

A descriptor store, either driver or application managed. For example a Vulkan descriptor set or a D3D12 descriptor heap.

APIs without an explicit concept of descriptor storage will have virtual objects corresponding to temporary bindings.

class renderdoc.DescriptorStoreDescription¶

A description of a descriptor store.

descriptorByteSize¶

For descriptor stores which contain desriptors all of identical size, the size of each descriptor. Descriptors are assumed to be tightly packed so stride is equal to size.

Type:

int

descriptorCount¶

The number of descriptors within this storage object.

Type:

int

firstDescriptorOffset¶

The byte offset within the store to the first descriptor.

Type:

int

resourceId¶

The unique ResourceId that identifies this descriptor store.

Type:

ResourceId

Textures¶

class renderdoc.TextureDescription¶

A description of a texture resource.

arraysize¶

How many array elements this texture has, will be at least 1.

Type:

int

byteSize¶

How many bytes would be used to store this texture and all its mips/slices.

Type:

int

creationFlags¶

The way this texture will be used in the pipeline.

Type:

TextureCategory

cubemap¶

True if this texture is used as a cubemap or cubemap array.

Type:

bool

depth¶

The depth of the texture, or 1 if not applicable.

Type:

int

dimension¶

The base dimension of the texture - either 1, 2, or 3.

Type:

int

format¶

The format of each pixel in the texture.

Type:

ResourceFormat

height¶

The height of the texture, or 1 if not applicable.

Type:

int

mips¶

How many mips this texture has, will be at least 1.

Type:

int

msQual¶

The quality setting of this texture, or 0 if not applicable.

Type:

int

msSamp¶

How many multisampled samples this texture has, will be at least 1.

Type:

int

resourceId¶

The unique ResourceId that identifies this texture.

Type:

ResourceId

type¶

The TextureType of the texture.

Type:

TextureType

width¶

The width of the texture, or length for buffer textures.

Type:

int

class renderdoc.TextureType(value)¶

The dimensionality of a texture binding.

Unknown¶

An unknown type of texture.

Buffer¶

A texel buffer.

Texture1D¶

A 1D texture.

Texture1DArray¶

A 1D texture array.

Texture2D¶

A 2D texture.

TextureRect¶

A rectangle texture, a legacy format for non-power of two textures.

Texture2DArray¶

A 2D texture array.

Texture2DMS¶

A multi-sampled 2D texture.

Texture2DMSArray¶

A multi-sampled 2D texture array.

Texture3D¶

A 3D texture.

TextureCube¶

A Cubemap texture.

TextureCubeArray¶

A Cubemap texture array.

class renderdoc.TextureCategory(value)¶

A set of flags describing how this texture may be used

NoFlags¶

The texture will not be used for any of the uses below.

ShaderRead¶

The texture will be read by a shader.

ColorTarget¶

The texture will be written to as a color target.

DepthTarget¶

The texture will be written to and tested against as a depth target.

ShaderReadWrite¶

The texture will be read and written to by a shader.

SwapBuffer¶

The texture is part of a window swapchain.

class renderdoc.Subresource¶

Specifies a subresource within a texture.

mip¶

The mip level in the texture.

Type:

int

sample¶

The sample in a multisampled texture.

Type:

int

slice¶

The slice within the texture. For array textures this is an array slice. For 3D textures when a single depth slice can be referred to this refers to that depth slice. In some cases a 3D texture may not allow referring to a single depth slice - see where the Subresource is used.

Note

Cubemaps are simply 2D array textures with a special meaning, so the faces of a cubemap are the 2D array slices in the standard order: X+, X-, Y+, Y-, Z+, Z-. Cubemap arrays are 2D arrays with 6 * N faces, where each cubemap within the array takes up 6 slices in the above order.

Type:

int

Buffers¶

class renderdoc.BufferDescription¶

A description of a buffer resource.

creationFlags¶

The way this buffer will be used in the pipeline.

Type:

BufferCategory

gpuAddress¶

The known base GPU Address of this buffer. 0 if not applicable or available.

Type:

int

length¶

The byte length of the buffer.

Type:

int

resourceId¶

The unique ResourceId that identifies this buffer.

Type:

ResourceId

class renderdoc.BufferCategory(value)¶

A set of flags describing how this buffer may be used

NoFlags¶

The buffer will not be used for any of the uses below.

Vertex¶

The buffer will be used for sourcing vertex input data.

Index¶

The buffer will be used for sourcing primitive index data.

Constants¶

The buffer will be used for sourcing shader constant data.

ReadWrite¶

The buffer will be used for read and write access from shaders.

Indirect¶

The buffer will be used to provide indirect parameters for launching GPU-based actions.