# Common Pipeline State Abstraction

class `renderdoc.``PipeState`

  An API-agnostic view of the common aspects of the pipeline state. This allows simple access to e.g. find out the bound resources or vertex buffers, or certain pipeline state which is available on all APIs.

  For more detailed or precise information without abstraction, access the specific pipeline state for the capture that’s open.

  `Abbrev`(stage)

    Retrieves a suitable two or three letter abbreviation of the given shader stage.

    Parameters: | stage (ShaderStage) – The shader stage to abbreviate.
    Returns: | The abbreviation of the stage.
    Return type: | `str`

  `GetBindpointMapping`(stage)

    Retrieves the current bindpoint mapping for a shader stage.

    This returns an empty bindpoint mapping if no shader is bound.

    Parameters: | stage (ShaderStage) – The shader stage to fetch.
    Returns: | The bindpoint mapping for the given shader.
    Return type: | ShaderBindpointMapping

  `GetComputePipelineObject`()

    Retrieves the the compute pipeline state object, if applicable.

    Returns: | The object ID for the given pipeline object.
    Return type: | ResourceId

  `GetConstantBuffer`(stage, BufIdx, ArrayIdx)

    Retrieves the constant buffer at a given binding.

    Parameters: | stage (ShaderStage) – The shader stage to fetch from. BufIdx (int) – The index in the shader’s ConstantBlocks array to look up. ArrayIdx (int) – For APIs that support arrays of constant buffers in a single binding, the index in that array to look up.
    Returns: | The constant buffer at the specified binding.
    Return type: | BoundCBuffer

  `GetDepthTarget`()

    Retrieves the read/write resources bound to the depth-stencil output.

    Returns: | The currently bound depth-stencil resource.
    Return type: | BoundResource

  `GetGraphicsPipelineObject`()

    Retrieves the the graphics pipeline state object, if applicable.

    Returns: | The object ID for the given pipeline object.
    Return type: | ResourceId

  `GetIBuffer`()

    Retrieves the current index buffer binding.

    Returns: | A `BoundVBuffer` with the index buffer details. The stride is always 0.
    Return type: | `BoundVBuffer`

  `GetOutputTargets`()

    Retrieves the resources bound to the color outputs.

    Returns: | The currently bound output targets.
    Return type: | `list` of `BoundResource`.

  `GetReadOnlyResources`(stage)

    Retrieves the read-only resources bound to a particular shader stage.

    Parameters: | stage (ShaderStage) – The shader stage to fetch from.
    Returns: | The currently bound read-only resoruces.
    Return type: | `list` of `BoundResourceArray` entries

  `GetReadWriteResources`(stage)

    Retrieves the read/write resources bound to a particular shader stage.

    Parameters: | stage (ShaderStage) – The shader stage to fetch from.
    Returns: | The currently bound read/write resoruces.
    Return type: | `list` of `BoundResourceArray` entries

  `GetResourceLayout`(id)

    For APIs that have explicit barriers, retrieves the current layout of a resource.

    Returns: | The name of the current resource layout.
    Return type: | `str`

  `GetScissor`(index)

    Retrieves the scissor region for a given index.

    Parameters: | index (int) – The index to retrieve.
    Returns: | The scissor region for the given index.
    Return type: | Scissor

  `GetShader`(stage)

    Retrieves the object ID of the shader bound at a shader stage.

    Parameters: | stage (ShaderStage) – The shader stage to fetch.
    Returns: | The object ID for the given shader.
    Return type: | ResourceId

  `GetShaderEntryPoint`(stage)

    Retrieves the name of the entry point function for a shader stage.

    For some APIs that don’t distinguish by entry point, this may be empty.

    Parameters: | stage (ShaderStage) – The shader stage to fetch.
    Returns: | The entry point name for the given shader.
    Return type: | `str`

  `GetShaderExtension`()

    Retrieves the common file extension for high level shaders in the current API.

    Typically this is `glsl` or `hlsl`.

    Returns: | The file extension with no `.`.
    Return type: | `str`

  `GetShaderReflection`(stage)

    Retrieves the shader reflection information for a shader stage.

    This returns `None` if no shader is bound.

    Parameters: | stage (ShaderStage) – The shader stage to fetch.
    Returns: | The reflection data for the given shader.
    Return type: | `ShaderBindpointMapping` or `None`

  `GetStripRestartIndex`()

    Retrieves the primitive restart index.

    Parameters: | indexByteWidth (int) – The width in bytes of the indices.
    Returns: | The index value that represents a strip restart not a real index.
    Return type: | `int`

  `GetVBuffers`()

    Retrieves the currently bound vertex buffers.

    Returns: | The list of bound vertex buffers.
    Return type: | `list` of `BoundVBuffer`.

  `GetVertexInputs`()

    Retrieves the currently specified vertex attributes.

    Returns: | The list of current vertex attributes.
    Return type: | `list` of `VertexInputAttribute`.

  `GetViewport`(index)

    Retrieves the viewport for a given index.

    Parameters: | index (int) – The index to retrieve.
    Returns: | The viewport for the given index.
    Return type: | Viewport

  `HasAlignedPostVSData`(stage)

    Determines whether or not the PostVS data is aligned in the typical fashion (ie. vectors not crossing `float4` boundaries). APIs that use stream-out or transform feedback have tightly packed data, but APIs that rewrite shaders to dump data might have these alignment requirements.

    Parameters: | stage (MeshDataStage) – The mesh data stage for the output data.
    Returns: | A boolean indicating if post-VS data is aligned.
    Return type: | `bool`

  `IsCaptureD3D11`()

    Determines whether or not a D3D11 capture is currently loaded.

    Returns: | A boolean indicating if a D3D11 capture is currently loaded.
    Return type: | `bool`

  `IsCaptureD3D12`()

    Determines whether or not a D3D12 capture is currently loaded.

    Returns: | A boolean indicating if a D3D12 capture is currently loaded.
    Return type: | `bool`

  `IsCaptureGL`()

    Determines whether or not an OpenGL capture is currently loaded.

    Returns: | A boolean indicating if an OpenGL capture is currently loaded.
    Return type: | `bool`

  `IsCaptureLoaded`()

    Determines whether or not a capture is currently loaded.

    Returns: | A boolean indicating if a capture is currently loaded.
    Return type: | `bool`

  `IsCaptureVK`()

    Determines whether or not a Vulkan capture is currently loaded.

    Returns: | A boolean indicating if a Vulkan capture is currently loaded.
    Return type: | `bool`

  `IsStripRestartEnabled`()

    Determines whether or not primitive restart is enabled.

    Returns: | A boolean indicating if primitive restart is enabled.
    Return type: | `bool`

  `IsTessellationEnabled`()

    Determines whether or not tessellation is currently enabled.

    Returns: | A boolean indicating if tessellation is currently enabled.
    Return type: | `bool`

  `MultiviewBroadcastCount`()

    Returns the number of views being broadcast to simultaneously during rendering.

  `OutputAbbrev`()

    Retrieves a suitable two or three letter abbreviation of the output stage. Typically ‘OM’ or ‘FBO’.

    Returns: | The abbreviation of the output stage.
    Return type: | `str`

  `SupportsBarriers`()

    Determines whether or not the current capture uses explicit barriers.

    Returns: | A boolean indicating if explicit barriers are used.
    Return type: | `bool`

  `SupportsResourceArrays`()

    Determines whether or not the current capture supports binding arrays of resources.

    Returns: | A boolean indicating if binding arrays of resources is supported.
    Return type: | `bool`

## Viewport

class `renderdoc.``Viewport`

  Information about a viewport.

  `enabled`

    Is this viewport enabled.

  `height`

    The height of the viewport.

  `maxDepth`

    The maximum depth of the viewport.

  `minDepth`

    The minimum depth of the viewport.

  `width`

    The width of the viewport.

  `x`

    The X co-ordinate of the viewport.

  `y`

    The Y co-ordinate of the viewport.

## Scissor

class `renderdoc.``Scissor`

  Describes a single scissor region.

  `enabled`

    `True` if this scissor region is enabled.

  `height`

    Height of the scissor region.

  `width`

    Width of the scissor region.

  `x`

    X co-ordinate of the scissor region.

  `y`

    Y co-ordinate of the scissor region.

## BlendEquation

class `renderdoc.``BlendEquation`

  Describes the details of a blend operation.

  `destination`

    The `BlendMultiplier` for the destination blend value.

  `operation`

    The `BlendOperation` to use in the blend calculation.

  `source`

    The `BlendMultiplier` for the source blend value.

## ColorBlend

class `renderdoc.``ColorBlend`

  Describes the blend configuration for a given output target.

  `alphaBlend`

    A `BlendEquation` describing the blending for alpha values.

  `colorBlend`

    A `BlendEquation` describing the blending for color values.

  `enabled`

    `True` if blending is enabled for this target.

  `logicOperation`

    The `LogicOperation` to use for logic operations, if `logicOperationEnabled` is `True`.

  `logicOperationEnabled`

    `True` if the logic operation in `logicOperation` should be used.

  `writeMask`

    The mask for writes to the render target.

## StencilFace

class `renderdoc.``StencilFace`

  Describes the details of a stencil operation.

  `compareMask`

    The mask for testing stencil values.

  `depthFailOperation`

    the `StencilOperation` to apply if the depth-test fails.

  `failOperation`

    The `StencilOperation` to apply if the stencil-test fails.

  `function`

    the `CompareFunction` to use for testing stencil values.

  `passOperation`

    the `StencilOperation` to apply if the stencil-test passes.

  `reference`

    The current stencil reference value.

  `writeMask`

    The mask for writing stencil values.

## BoundResource

class `renderdoc.``BoundResource`

  Information about a single resource bound to a slot in an API-specific way.

  `dynamicallyUsed`

    `True` if this binding element is dynamically used.

    Some APIs provide fine-grained usage based on dynamic shader feedback, to support ‘bindless’ scenarios where only a small sparse subset of bound resources are actually used.

  `firstMip`

    For textures, the highest mip level available on this binding, or -1 for all mips

  `firstSlice`

    For textures, the first array slice available on this binding. or -1 for all slices.

  `resourceId`

    A `ResourceId` identifying the bound resource.

  `typeHint`

    For textures, a `CompType` hint for how to interpret typeless textures.

## BoundResourceArray

class `renderdoc.``BoundResourceArray`

  Contains all of the bound resources at a particular bindpoint. In APIs that don’t support resource arrays, there will only be one bound resource.

  `bindPoint`

    The bind point for this array of bound resources.

  `dynamicallyUsedCount`

    Lists how many bindings in `resources` are dynamically used.

    Some APIs provide fine-grained usage based on dynamic shader feedback, to support ‘bindless’ scenarios where only a small sparse subset of bound resources are actually used.

  `resources`

    The resources at this bind point

## BoundVBuffer

class `renderdoc.``BoundVBuffer`

  Information about a single vertex or index buffer binding.

  `byteOffset`

    The offset in bytes from the start of the buffer to the data.

  `byteStride`

    The stride in bytes between the start of one element and the start of the next.

  `resourceId`

    A `ResourceId` identifying the buffer.

## BoundCBuffer

class `renderdoc.``BoundCBuffer`

  Information about a single constant buffer binding.

  `byteOffset`

    The offset in bytes from the start of the buffer to the constant data.

  `byteSize`

    The size in bytes for the constant buffer. Access outside this size returns 0.

  `resourceId`

    A `ResourceId` identifying the buffer.

## VertexInputAttribute

class `renderdoc.``VertexInputAttribute`

  Information about a vertex input attribute feeding the vertex shader.

  `byteOffset`

    The byte offset from the start of the vertex data for this VB to this attribute.

  `format`

    A `ResourceFormat` with the interpreted format of this attribute.

  `genericEnabled`

    `True` if this attribute is using `genericValue` for its data.

  `genericValue`

    A `PixelValue` with the generic value for this attribute if it has no VB bound.

  `instanceRate`

    If `perInstance` is `True`, the number of instances that source the same value from the vertex buffer before advancing to the next value.

  `name`

    The name of this input. This may be a variable name or a semantic name.

  `perInstance`

    `True` if this attribute runs at instance rate.

  `used`

    `True` if this attribute is enabled and used by the vertex shader.

  `vertexBuffer`

    The index of the vertex buffer used to provide this attribute.