本页内容

QRhiComputePipeline Class

计算管道状态资源。更多...

标题: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
自: Qt 6.6
继承自: QRhiResource

公共类型

enum Flag { CompileShadersWithDebugInfo }
flags Flags

公共函数

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

重新实现的公共函数

virtual QRhiResource::Type resourceType() const override

详细说明

注意: 必须设置 着色器资源绑定。在调用 create() 时,所引用的QRhiShaderResourceBindings 必须已调用过 create() 方法。

注意: 必须设置着 色器。

注意:这是一个 兼容性保证有限的 RHI API,详情请参阅QRhi 。

成员类型文档

enum QRhiComputePipeline::Flag
flags QRhiComputePipeline::Flags

用于描述管道选项的标志值。

常量值描述
QRhiComputePipeline::CompileShadersWithDebugInfo1 << 0在适用情况下,请求在编译着色器时启用调试信息。有关详细信息,请参阅QRhiGraphicsPipeline::CompileShadersWithDebugInfo 。

Flags 类型是QFlags<Flag> 的 typedef 定义。它存储 Flag 值的按“或”(OR)运算组合。

成员函数文档

QRhiComputePipeline::Flags QRhiComputePipeline::flags() const

返回当前设置的标志。

另请参阅 setFlags()。

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

重写了:QRhiResource::resourceType() const。

返回资源类型。

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

设置标志f 。

另请参阅 flags()。

void QRhiComputePipeline::setShaderResourceBindings(QRhiShaderResourceBindings *srb)

与描述资源绑定布局的srb 以及资源本身(QRhiBuffer 、QRhiTexture )相关联。后者为可选。与图形管道类似,此处传入的srb 可以不指定实际的缓冲区或纹理对象(nullptr ),只要在记录分派调用之前,通过setShaderResources()绑定了另一个layout-compatible QRhiShaderResourceBindings 即可。

另请参阅 shaderResourceBindings()。

void QRhiComputePipeline::setShaderStage(const QRhiShaderStage &stage)

设置要使用的着色器。stage 只能指向compute stage 。

另请参阅 shaderStage()。

QRhiShaderResourceBindings *QRhiComputePipeline::shaderResourceBindings() const

返回当前关联的QRhiShaderResourceBindings 对象。

另请参阅 setShaderResourceBindings()。

QRhiShaderStage QRhiComputePipeline::shaderStage() const

返回当前设置的着色器。

另请参阅 setShaderStage()。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.