# Resources

Contents

- Resources

  - General

  - Textures

  - Buffers

## 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`.

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.

  `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.

  `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`

    The `ResourceType` of the resource.

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.

## Textures

class `renderdoc.``TextureDescription`

  A description of a texture resource.

  `arraysize`

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

  `byteSize`

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

  `creationFlags`

    The way this texture will be used in the pipeline.

  `cubemap`

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

  `depth`

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

  `dimension`

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

  `format`

    The format of each pixel in the texture.

    Type

      ResourceFormat

  `height`

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

  `mips`

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

  `msQual`

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

  `msSamp`

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

  `resourceId`

    The unique `ResourceId` that identifies this texture.

  `type`

    The `TextureType` of the texture.

  `width`

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

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.

  `sample`

    The sample in a multisampled texture.

  `slice`

    The slice within the texture. For 3D textures this is a depth slice, for arrays it is an array slice.

    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.

## Buffers

class `renderdoc.``BufferDescription`

  A description of a buffer resource.

  `creationFlags`

    The way this buffer will be used in the pipeline.

  `gpuAddress`

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

  `length`

    The byte length of the buffer.

  `resourceId`

    The unique `ResourceId` that identifies this buffer.

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 drawcalls.