Pipeline Abstraction¶
Contents
Pipeline¶
-
class
qrenderdoc.
CommonPipelineState
¶ 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
-
DefaultType
¶ The default
GraphicsAPI
to pretend to contain, if no capture is loaded.
-
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
-
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:
-
GetDepthTarget
()¶ Retrieves the read/write resources bound to the depth-stencil output.
Returns: The currently bound depth-stencil resource. Return type: BoundResource
-
GetIBuffer
()¶ Retrieves the current index buffer binding.
Returns: A tuple with the buffer object bound to the index buffer slot, and the byte offset to the start of the index data. Return type: tuple
ofResourceId
andint
-
GetOutputTargets
()¶ Retrieves the resources bound to the colour outputs.
Returns: The currently bound output targets. Return type: list
ofBoundResource
.
-
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: dict
withBindpointMap
keys, to lists ofBoundResource
.
-
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: dict
withBindpointMap
keys, to lists ofBoundResource
.
-
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
-
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
orhlsl
.Returns: The file extension with no .
.Return type: str
-
GetShaderName
(stage)¶ Retrieves the name of the shader object at a shader stage.
Parameters: stage (ShaderStage) – The shader stage to fetch. Returns: The object name for the given shader. 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
orNone
-
GetStripRestartIndex
(indexByteWidth)¶ 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
ofBoundVBuffer
.
-
GetVertexInputs
()¶ Retrieves the currently specified vertex attributes.
Returns: The list of current vertex attributes. Return type: list
ofVertexInputAttribute
.
-
GetViewport
(index)¶ Retrieves the viewport for a given index.
Parameters: index (int) – The viewport index to retrieve. Returns: The viewport for the given index. Return type: Viewport
-
HasAlignedPostVSData
()¶ 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.Returns: A boolean indicating if post-VS data is aligned. Return type: bool
-
IsLogD3D11
()¶ Determines whether or not a D3D11 capture is currently loaded.
Returns: A boolean indicating if a D3D11 capture is currently loaded. Return type: bool
-
IsLogD3D12
()¶ Determines whether or not a D3D12 capture is currently loaded.
Returns: A boolean indicating if a D3D12 capture is currently loaded. Return type: bool
-
IsLogGL
()¶ Determines whether or not an OpenGL capture is currently loaded.
Returns: A boolean indicating if an OpenGL capture is currently loaded. Return type: bool
-
IsLogVK
()¶ 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
-
LogLoaded
()¶ Determines whether or not a capture is currently loaded.
Returns: A boolean indicating if a capture is currently loaded. Return type: bool
-
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
-
SetStates
(props, d3d11, d3d12, gl, vk)¶ Set the source API-specific states to read data from.
Parameters: - props (APIProperties) – The properties of the current capture.
- d3d11 (D3D11_State) – The D3D11 state.
- d3d12 (D3D12_State) – The D3D11 state.
- gl (GL_State) – The OpenGL state.
- vk (VK_State) – The Vulkan state.
-
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
-
Bindings¶
-
class
qrenderdoc.
BoundResource
¶ Information about a single resource bound to a slot in an API-specific way.
-
FirstSlice
¶ For textures, the first array slice available on this binding. or -1 for all slices.
-
HighestMip
¶ For textures, the highest mip level available on this binding, or -1 for all mips
-
Id
¶ A
ResourceId
identifying the bound resource.
-
-
class
qrenderdoc.
BoundVBuffer
¶ Information about a single vertex buffer binding.
-
Buffer
¶ A
ResourceId
identifying the buffer.
-
ByteOffset
¶ The offset in bytes from the start of the buffer to the vertex data.
-
ByteStride
¶ The stride in bytes between the start of one vertex and the start of the next.
-
-
class
qrenderdoc.
BoundCBuffer
¶ Information about a single constant buffer binding.
-
Buffer
¶ A
ResourceId
identifying the buffer.
-
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.
-
-
class
qrenderdoc.
VertexInputAttribute
¶ Information about a vertex input attribute feeding the vertex shader.
-
Format
¶ A
ResourceFormat
with the interpreted format of this attribute.
-
GenericValue
¶ A
PixelValue
with the generic value for this attribute if it has no VB bound.
-
InstanceRate
¶ If
PerInstance
isTrue
, 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.
-
RelativeByteOffset
¶ The byte offset from the start of the vertex data for this VB to this attribute.
-
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.
-