QRhiComputePipeline Class

计算管道状态资源。更多

头文件: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
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 必须已被调用 created()。

注意: 必须设置着色器。

注: 这是一个 RHI API,兼容性保证有限,详情请查看QRhi

成员类型文档

枚举 QRhiComputePipeline::Flag
flags QRhiComputePipeline::Flags

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

常量说明
QRhiComputePipeline::CompileShadersWithDebugInfo1 << 0要求在编译着色器时启用调试信息(如适用)。更多信息请参阅QRhiGraphicsPipeline::CompileShadersWithDebugInfo

Flags 类型是QFlags<Flag> 的类型定义。它存储 Flag 值的 OR 组合。

成员函数文档

QRhiComputePipeline::Flags QRhiComputePipeline::flags() const

返回当前设置的标志。

另请参见 setFlags()。

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

重实现:QRhiResource::resourceType() 常量。

返回资源类型。

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().

© 2025 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.