QRhiComputePipeline Class | Qt GUI | Qt 6.10.3
Description: Compute pipeline state resource.

- Qt 6.10
- Qt GUI
- C++ Classes
- QtGuiPrivate
- QRhiComputePipeline
- Qt 6.10.3 Reference Documentation

# QRhiComputePipeline Class

Compute pipeline state resource. More...

Header: | `#include <rhi/qrhi.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)` `target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)`
qmake: | `QT += gui-private`
Since: | Qt 6.6
Inherits: | QRhiResource

- List of all members, including inherited members

## Public Types

enum | Flag { CompileShadersWithDebugInfo }
flags | Flags

## Public Functions

QRhiComputePipeline::Flags | flags() const
void | setFlags(QRhiComputePipeline::Flags f)
void | setShaderResourceBindings(QRhiShaderResourceBindings *srb)
void | setShaderStage(const QRhiShaderStage &stage)
QRhiShaderResourceBindings * | shaderResourceBindings() const
QRhiShaderStage | shaderStage() const

## Reimplemented Public Functions

virtual QRhiResource::Type | resourceType() const override

## Detailed Description

Note: Setting the shader resource bindings is mandatory. The referenced QRhiShaderResourceBindings must already have created() called on it by the time create() is called.

Note: Setting the shader is mandatory.

Note: This is a RHI API with limited compatibility guarantees, see QRhi for details.

## Member Type Documentation

### enum QRhiComputePipeline::Flag
flags QRhiComputePipeline::Flags

Flag values for describing pipeline options.

Constant | Value | Description
--- | --- | ---
`QRhiComputePipeline::CompileShadersWithDebugInfo` | `1 << 0` | Requests compiling shaders with debug information enabled, when applicable. See QRhiGraphicsPipeline::CompileShadersWithDebugInfo for more information.

The Flags type is a typedef for QFlags<Flag>. It stores an OR combination of Flag values.

## Member Function Documentation

### QRhiComputePipeline::Flags QRhiComputePipeline::flags() const

Returns the currently set flags.

See also setFlags().

### `[override virtual]` QRhiResource::Type QRhiComputePipeline::resourceType() const

Reimplements: QRhiResource::resourceType() const.

Returns the resource type.

### void QRhiComputePipeline::setFlags(QRhiComputePipeline::Flags f)

Sets the flags f.

See also flags().

### void QRhiComputePipeline::setShaderResourceBindings(QRhiShaderResourceBindings *srb)

Associates with srb describing the resource binding layout and the resources (QRhiBuffer, QRhiTexture) themselves. The latter is optional. As with graphics pipelines, the srb passed in here can leave the actual buffer or texture objects unspecified (`nullptr`) as long as there is another, layout-compatible QRhiShaderResourceBindings bound via setShaderResources() before recording the dispatch call.

See also shaderResourceBindings().

### void QRhiComputePipeline::setShaderStage(const QRhiShaderStage &stage)

Sets the shader to use. stage can only refer to the compute stage.

See also shaderStage().

### QRhiShaderResourceBindings *QRhiComputePipeline::shaderResourceBindings() const

Returns the currently associated QRhiShaderResourceBindings object.

See also setShaderResourceBindings().

### QRhiShaderStage QRhiComputePipeline::shaderStage() const

Returns the currently set shader.

See also setShaderStage().