QRhiGraphicsPipeline 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 |
パブリックな型
(since 6.6) struct | StencilOpState |
(since 6.6) struct | TargetBlend |
enum | BlendFactor { Zero, One, SrcColor, OneMinusSrcColor, DstColor, …, OneMinusSrc1Alpha } |
enum | BlendOp { Add, Subtract, ReverseSubtract, Min, Max } |
flags | ColorMask |
enum | ColorMaskComponent { R, G, B, A } |
enum | CompareOp { Never, Less, Equal, LessOrEqual, Greater, …, Always } |
enum | CullMode { None, Front, Back } |
enum | Flag { UsesBlendConstants, UsesStencilRef, UsesScissor, CompileShadersWithDebugInfo, UsesShadingRate } |
flags | Flags |
enum | FrontFace { CCW, CW } |
enum | PolygonMode { Fill, Line } |
enum | StencilOp { StencilZero, Keep, Replace, IncrementAndClamp, DecrementAndClamp, …, DecrementAndWrap } |
enum | Topology { Triangles, TriangleStrip, TriangleFan, Lines, LineStrip, …, Patches } |
パブリック関数
const QRhiShaderStage * | cbeginShaderStages() const |
const QRhiGraphicsPipeline::TargetBlend * | cbeginTargetBlends() const |
const QRhiShaderStage * | cendShaderStages() const |
const QRhiGraphicsPipeline::TargetBlend * | cendTargetBlends() const |
virtual bool | create() = 0 |
QRhiGraphicsPipeline::CullMode | cullMode() const |
int | depthBias() const |
QRhiGraphicsPipeline::CompareOp | depthOp() const |
QRhiGraphicsPipeline::Flags | flags() const |
QRhiGraphicsPipeline::FrontFace | frontFace() const |
bool | hasDepthTest() const |
bool | hasDepthWrite() const |
bool | hasStencilTest() const |
float | lineWidth() const |
(since 6.7) int | multiViewCount() const |
int | patchControlPointCount() const |
QRhiGraphicsPipeline::PolygonMode | polygonMode() const |
QRhiRenderPassDescriptor * | renderPassDescriptor() const |
int | sampleCount() const |
void | setCullMode(QRhiGraphicsPipeline::CullMode mode) |
void | setDepthBias(int bias) |
void | setDepthOp(QRhiGraphicsPipeline::CompareOp op) |
void | setDepthTest(bool enable) |
void | setDepthWrite(bool enable) |
void | setFlags(QRhiGraphicsPipeline::Flags f) |
void | setFrontFace(QRhiGraphicsPipeline::FrontFace f) |
void | setLineWidth(float width) |
(since 6.7) void | setMultiViewCount(int count) |
void | setPatchControlPointCount(int count) |
void | setPolygonMode(QRhiGraphicsPipeline::PolygonMode mode) |
void | setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) |
void | setSampleCount(int s) |
void | setShaderResourceBindings(QRhiShaderResourceBindings *srb) |
void | setShaderStages(std::initializer_list<QRhiShaderStage> list) |
void | setShaderStages(InputIterator first, InputIterator last) |
void | setSlopeScaledDepthBias(float bias) |
void | setStencilBack(const QRhiGraphicsPipeline::StencilOpState &state) |
void | setStencilFront(const QRhiGraphicsPipeline::StencilOpState &state) |
void | setStencilReadMask(quint32 mask) |
void | setStencilTest(bool enable) |
void | setStencilWriteMask(quint32 mask) |
void | setTargetBlends(std::initializer_list<QRhiGraphicsPipeline::TargetBlend> list) |
void | setTargetBlends(InputIterator first, InputIterator last) |
void | setTopology(QRhiGraphicsPipeline::Topology t) |
void | setVertexInputLayout(const QRhiVertexInputLayout &layout) |
QRhiShaderResourceBindings * | shaderResourceBindings() const |
const QRhiShaderStage * | shaderStageAt(qsizetype index) const |
qsizetype | shaderStageCount() const |
float | slopeScaledDepthBias() const |
QRhiGraphicsPipeline::StencilOpState | stencilBack() const |
QRhiGraphicsPipeline::StencilOpState | stencilFront() const |
quint32 | stencilReadMask() const |
quint32 | stencilWriteMask() const |
const QRhiGraphicsPipeline::TargetBlend * | targetBlendAt(qsizetype index) const |
qsizetype | targetBlendCount() const |
QRhiGraphicsPipeline::Topology | topology() const |
QRhiVertexInputLayout | vertexInputLayout() const |
再実装されたパブリック関数
virtual QRhiResource::Type | resourceType() const override |
詳細説明
グラフィックス・パイプラインを表します。基盤となるネイティブ・グラフィックスAPIにおいて、これが具体的に何にマッピングされるかはさまざまです。パイプラインオブジェクトの概念がある場合、例えばVulkanでは、create ()を呼び出すと、QRhi バックエンドがそのようなオブジェクトを作成します。その他の場所、たとえばOpenGLでは、QRhiGraphicsPipelineは単にさまざまな状態を収集するだけで、create ()の主なタスクは対応するシェーダープログラムをセットアップすることですが、要求された状態を見るのは後の時点に延期されます。
すべてのQRhiResource サブクラスと同様に、2 段階の初期化パターンが適用されます。たとえば、setDepthTest() のように、セッターを介して値を設定することは、create() を呼び出した後にのみ有効です。QRhiGraphicsPipeline がcreate() で初期化された後は、値を変更しないでください。状態を変更するには、新しい値を設定し、create() を再度呼び出します。しかし、この操作では、すべてのネイティブ・リソースが解放され、新しいリソースが作成されます。その結果、重く高価な操作になる可能性がある。むしろ、異なるステートを持つ複数のパイプラインを作成し、レンダー パスを記録するときにswitch between them を使用することをお勧めします。
注意: シェーダステージの設定は必須です。少なくとも 1 つのステージがあり、頂点ステージがなければなりません。
注: シェーダーリソースバインディングの設定は必須です。参照されるQRhiShaderResourceBindings は、create() が呼び出されるまでに、create() がすでに呼び出されている必要があります。どのステージのどのシェーダもリソースを期待していない限り、バインディングを持たないQRhiShaderResourceBindings との関連付けも有効です。実際のリソースを指定しないQRhiShaderResourceBindings オブジェクト(すなわち、バイン ディングポイントのためのバッファ、テクスチャなどがnullptr
に設定され ている)を使用することも、すべてのバインディングのリソースを指定するlayout-compatible QRhiShaderResourceBindings が、レンダーパスを記録するときにsetShaderResources() を介して設定される限り、有効です。
注: レンダーパス記述子の設定は必須です。setRenderPassDescriptor() に渡すことができるQRhiRenderPassDescriptor を取得するには、QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor() またはQRhiSwapChain::newCompatibleRenderPassDescriptor() を使用します。
注 :頂点入力レイアウトの設定は必須です。
注 :sampleCount() のデフォルトは 1 で、レンダーターゲットのカラーおよび深度ステンシルアタッチメントのサンプルカウントと一致しなければならない。
注 : デフォルトでは、深度テスト、深度書き込み、ステンシル テストは無効になっています。フェース カリング モードのデフォルトは、カリングなしです。
注: stencilReadMask() とstencilWriteMask() は両方の面に適用されます。どちらもデフォルトは0xFFです。
使用例
グラフィックスパイプラインのすべての設定には、多くのアプリケーションに適したデフォルト値があります。したがって、グラフィックスパイプラインを作成する最小限の例は次のようになります。これは、頂点シェーダが入力位置 0 で単一のvec3 position
入力を取ると仮定しています。QRhiShaderResourceBindings およびQRhiRenderPassDescriptor オブジェクトと、頂点およびフラグメントステージ用のQShader コレクションを使用すると、次のようなパイプラインを作成できます:
QRhiShaderResourceBindings *srb; QRhiRenderPassDescriptor *rpDesc; QShader vs, fs; // ... QRhiVertexInputLayout inputLayout; inputLayout.setBindings({ { 3 * sizeof(float) } }); inputLayout.setAttributes({ { 0, 0, QRhiVertexInputAttribute::Float3, 0 } }); QRhiGraphicsPipeline *ps = rhi->newGraphicsPipeline(); ps->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } }); ps->setVertexInputLayout(inputLayout); ps->setShaderResourceBindings(srb); ps->setRenderPassDescriptor(rpDesc); if (!ps->create()) { error(); }
上記のコードは、多くの設定とステートにデフォルトを使用するパイプラインオブジェクトを作成します。たとえば、Triangles トポロジーを使用し、バックフェイスカリングは使用せず、ブレンディングは無効ですが、カラー書き込みは4つのチャンネルすべてで有効で、深度テスト/書き込みは無効で、ステンシル操作は無効です。
注: これは互換性保証に制限のある RHI API である。詳細はQRhi を参照。
QRhiCommandBuffer およびQRhiも参照の こと。
メンバー型ドキュメント
enum QRhiGraphicsPipeline::BlendFactor
ブレンド係数を指定
定数 | 値 |
---|---|
QRhiGraphicsPipeline::Zero | 0 |
QRhiGraphicsPipeline::One | 1 |
QRhiGraphicsPipeline::SrcColor | 2 |
QRhiGraphicsPipeline::OneMinusSrcColor | 3 |
QRhiGraphicsPipeline::DstColor | 4 |
QRhiGraphicsPipeline::OneMinusDstColor | 5 |
QRhiGraphicsPipeline::SrcAlpha | 6 |
QRhiGraphicsPipeline::OneMinusSrcAlpha | 7 |
QRhiGraphicsPipeline::DstAlpha | 8 |
QRhiGraphicsPipeline::OneMinusDstAlpha | 9 |
QRhiGraphicsPipeline::ConstantColor | 10 |
QRhiGraphicsPipeline::OneMinusConstantColor | 11 |
QRhiGraphicsPipeline::ConstantAlpha | 12 |
QRhiGraphicsPipeline::OneMinusConstantAlpha | 13 |
QRhiGraphicsPipeline::SrcAlphaSaturate | 14 |
QRhiGraphicsPipeline::Src1Color | 15 |
QRhiGraphicsPipeline::OneMinusSrc1Color | 16 |
QRhiGraphicsPipeline::Src1Alpha | 17 |
QRhiGraphicsPipeline::OneMinusSrc1Alpha | 18 |
enum QRhiGraphicsPipeline::BlendOp
ブレンド操作を指定する
定数 | 値 |
---|---|
QRhiGraphicsPipeline::Add | 0 |
QRhiGraphicsPipeline::Subtract | 1 |
QRhiGraphicsPipeline::ReverseSubtract | 2 |
QRhiGraphicsPipeline::Min | 3 |
QRhiGraphicsPipeline::Max | 4 |
enum QRhiGraphicsPipeline::ColorMaskComponent
flags QRhiGraphicsPipeline::ColorMask
色書き込みマスクを指定するためのフラグ値
定数 | 値 |
---|---|
QRhiGraphicsPipeline::R | 1 << 0 |
QRhiGraphicsPipeline::G | 1 << 1 |
QRhiGraphicsPipeline::B | 1 << 2 |
QRhiGraphicsPipeline::A | 1 << 3 |
ColorMask 型はQFlags<ColorMaskComponent> の typedef です。ColorMaskComponentの値のORの組み合わせを格納します。
enum QRhiGraphicsPipeline::CompareOp
深度またはステンシル比較関数を指定します。
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::Never | 0 | |
QRhiGraphicsPipeline::Less | 1 | (深度のデフォルト) |
QRhiGraphicsPipeline::Equal | 2 | |
QRhiGraphicsPipeline::LessOrEqual | 3 | |
QRhiGraphicsPipeline::Greater | 4 | |
QRhiGraphicsPipeline::NotEqual | 5 | |
QRhiGraphicsPipeline::GreaterOrEqual | 6 | |
QRhiGraphicsPipeline::Always | 7 | (ステンシルのデフォルト) |
enum QRhiGraphicsPipeline::CullMode
カリングモードを指定する
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::None | 0 | カリングなし(デフォルト) |
QRhiGraphicsPipeline::Front | 1 | 前面をカリング |
QRhiGraphicsPipeline::Back | 2 | 裏面をカリング |
enum QRhiGraphicsPipeline::Flag
flags QRhiGraphicsPipeline::Flags
パイプラインの動的状態やその他のオプションを記述するためのフラグ値。ビューポートは常に動的です。
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::UsesBlendConstants | 1 << 0 | ブレンドカラー定数がQRhiCommandBuffer::setBlendConstants() によって設定されることを示します。 |
QRhiGraphicsPipeline::UsesStencilRef | 1 << 1 | ステンシル参照値がQRhiCommandBuffer::setStencilRef() によって設定されることを示します。 |
QRhiGraphicsPipeline::UsesScissor | 1 << 2 | シザー矩形がQRhiCommandBuffer::setScissor() によって設定されることを示します。 |
QRhiGraphicsPipeline::CompileShadersWithDebugInfo | 1 << 3 | デバッグ情報を有効にしてシェーダーをコンパイルすることを要求します。これは、ソースコードからのランタイムシェーダコンパイルが関係し、基礎となるインフラストラクチャがこれをサポートしている場合にのみ関連します。具体的な例では、GLSL から SPIR-V へのコンパイルは実行時に行われないため、Vulkan と SPIR-V では関係ありません。一方、Direct3DとHLSLについては、複数の選択肢があります。QShader パッケージがコンパイル済みのバイトコード(DXBC )と共に出荷される場合、デバッグ情報は、VulkanとSPIR-Vの場合と同様に、.qsb ファイルを生成するツールを通じて要求されます。しかし、HLSL ソースコードが事前または実行時に生成されるQShader パッケージにある場合、コンパイルの第 1 フェーズ(HLSL ソースから中間フォーマットへの変換)は、このフラグを考慮した上で、実行時にも行われます。デバッグ情報は、特に RenderDoc のようなツールに関連します。パイプラインを調査するときや、頂点シェーダーやフラグメントシェーダーのデバッグを実行するときに、オリジナルのソースコードを見ることができるからです。 |
QRhiGraphicsPipeline::UsesShadingRate | 1 << 4 | QRhiCommandBuffer::setShadingRate ()を介して描画ごと(パイプラインごと)のシェーディングレート値が設定されることを示します。このフラグを指定せずに setShadingRate() を呼び出すと、基盤となるグラフィックス API によって予期しないさまざまな結果になる可能性があります。 |
Flags 型はQFlags<Flag> の typedef です。これはFlag値のORの組み合わせを格納します。
enum QRhiGraphicsPipeline::FrontFace
前面の巻き順を指定
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::CCW | 0 | 反時計回り(デフォルト) |
QRhiGraphicsPipeline::CW | 1 | 時計回り |
enum QRhiGraphicsPipeline::PolygonMode
ポリゴンのラスタライズモードを指定
ポリゴンモード(メタルでは三角形塗りつぶしモード、D3Dでは塗りつぶしモード)は、ポリゴンのラスタライズ時に使用する塗りつぶしモードを指定します。ポリゴンはソリッド(Fill)またはワイヤーメッシュ(Line)として描画されます。
非塗りつぶしポリゴンモードのサポートはオプションで、QRhi::NonFillPolygonMode 機能で示されます。OpenGL ESと一部のVulkan実装では、この機能はサポートされていないと報告される可能性が高く、その場合、Fill以外の値は使用できません。
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::Fill | 0 | ポリゴンの内部が塗りつぶされます(デフォルト)。 |
QRhiGraphicsPipeline::Line | 1 | ポリゴンの境界は線分として描画されます。 |
enum QRhiGraphicsPipeline::StencilOp
ステンシル操作を指定します。
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::StencilZero | 0 | |
QRhiGraphicsPipeline::Keep | 1 | (デフォルト) |
QRhiGraphicsPipeline::Replace | 2 | |
QRhiGraphicsPipeline::IncrementAndClamp | 3 | |
QRhiGraphicsPipeline::DecrementAndClamp | 4 | |
QRhiGraphicsPipeline::Invert | 5 | |
QRhiGraphicsPipeline::IncrementAndWrap | 6 | |
QRhiGraphicsPipeline::DecrementAndWrap | 7 |
enum QRhiGraphicsPipeline::Topology
プリミティブトポロジーを指定
定数 | 値 | 説明 |
---|---|---|
QRhiGraphicsPipeline::Triangles | 0 | (デフォルト) |
QRhiGraphicsPipeline::TriangleStrip | 1 | |
QRhiGraphicsPipeline::TriangleFan | 2 | (QRhi::TriangleFanTopology がサポートされている場合のみ使用可能) |
QRhiGraphicsPipeline::Lines | 3 | |
QRhiGraphicsPipeline::LineStrip | 4 | |
QRhiGraphicsPipeline::Points | 5 | |
QRhiGraphicsPipeline::Patches | 6 | (QRhi::Tessellation がサポートされている場合にのみ利用可能で、パイプラインにテッセレーションステージが存在する必要があります) |
メンバー関数ドキュメント
const QRhiShaderStage *QRhiGraphicsPipeline::cbeginShaderStages() const
シェーダーステージリストの最初の項目を指すイテレータを返します。
const QRhiGraphicsPipeline::TargetBlend *QRhiGraphicsPipeline::cbeginTargetBlends() const
レンダーターゲットブレンド設定リストの最初の項目を指すイテレータを返します。
const QRhiShaderStage *QRhiGraphicsPipeline::cendShaderStages() const
シェーダーステージリストの最後のアイテムの直後を指すイテレータを返します。
const QRhiGraphicsPipeline::TargetBlend *QRhiGraphicsPipeline::cendTargetBlends() const
レンダーターゲットブレンド設定リストの最後の項目の直後を指すイテレータを返します。
[pure virtual]
bool QRhiGraphicsPipeline::create()
対応するネイティブ・グラフィックス・リソースを作成する。以前の create() で対応するdestroy() がなかったためにすでにリソースが存在する場合は、destroy() が暗黙的に最初に呼び出されます。
グラフィックス操作に成功した場合はtrue
を、失敗した場合はfalse
を返します。返り値にかかわらず、destroy ()を呼び出すと常に安全である。
注意: 特に、シェーダがソースからコンパイル/最適化されたり、中間バイトコード フォーマットから GPU 独自の命令セットにコンパイル/最適化されたりする場合、基礎となるグ ラフィックス API によっては、これは高価な操作になる可能性があります。該当する場合、QRhi バックエンドは、これを加速するために関連する非パーシステント機能を自動的にセットアップします。たとえば、Vulkan バックエンドは、アプリケーションのライフタイム中にデータの再利用を改善するためにVkPipelineCache
を自動的に作成します。
注意: ドライバは、シェーダとパイプラインデータのために様々な永続的な(ディスクベースの)キャッシング戦略を採用することがあります。グラフィックス API とQRhi バックエンドによっては、QRhi 内にそのようなキャッシュを手動で管理する機能があり、パイプラインの作成時間を短縮するために、アプリケーションの将来の実行で再ロードできるシリアライズ可能なブロブを取得できます。詳細はQRhi::pipelineCacheData() とQRhi::setPipelineCacheData() を参照のこと。また、Qt Quick のような、より高いレベルの Qt フレームワークによって管理されるQRhi インスタンスで作業する場合、このようなディスクベースのキャッシュが自動的に行われる可能性があります。例えば、QQuickWindow は、デフォルトでディスクベースのパイプラインキャッシュを使用します(これは、ドライバレベルのキャッシュに加えて行われます)。
QRhiGraphicsPipeline::CullMode QRhiGraphicsPipeline::cullMode() const
現在設定されている顔のカリングモードを返します。
setCullMode()も参照してください 。
int QRhiGraphicsPipeline::depthBias() const
現在設定されている深度バイアスを返します。
setDepthBias()も参照 。
QRhiGraphicsPipeline::CompareOp QRhiGraphicsPipeline::depthOp() const
深さ比較関数を返します。
setDepthOp()も参照 。
QRhiGraphicsPipeline::Flags QRhiGraphicsPipeline::flags() const
現在設定されているフラグを返す。
setFlags()も参照 。
QRhiGraphicsPipeline::FrontFace QRhiGraphicsPipeline::frontFace() const
現在設定されているフロント・フェイス・モードを返す。
setFrontFace()も参照 。
bool QRhiGraphicsPipeline::hasDepthTest() const
深さテストが有効な場合はtrueを返す。
bool QRhiGraphicsPipeline::hasDepthWrite() const
深度書き込みが有効な場合はtrueを返す。
bool QRhiGraphicsPipeline::hasStencilTest() const
ステンシルテストが有効な場合はtrueを返す。
float QRhiGraphicsPipeline::lineWidth() const
現在設定されている線幅を返します。デフォルトは 1.0f です。
setLineWidth()も参照 。
[since 6.7]
int QRhiGraphicsPipeline::multiViewCount() const
ビュー数を返します。デフォルトは 0 で、マルチビューレンダリングがないことを示します。
この関数は Qt 6.7 で導入されました。
setMultiViewCount()も参照してください 。
int QRhiGraphicsPipeline::patchControlPointCount() const
現在設定されているパッチ・コントロール・ポイント数を返す。
setPatchControlPointCount()も参照 。
QRhiGraphicsPipeline::PolygonMode QRhiGraphicsPipeline::polygonMode() const
ポリゴンモードを返します。
setPolygonMode()も参照 。
QRhiRenderPassDescriptor *QRhiGraphicsPipeline::renderPassDescriptor() const
現在設定されているQRhiRenderPassDescriptor を返す。
setRenderPassDescriptor()も参照 。
[override virtual]
QRhiResource::Type QRhiGraphicsPipeline::resourceType() const
再実装:QRhiResource::resourceType() const.
リソース型を返します。
int QRhiGraphicsPipeline::sampleCount() const
現在設定されているサンプル数を返す。1 は、マルチサンプル・アンチエイリアスを行わないことを意味します。
setSampleCount()も参照 。
void QRhiGraphicsPipeline::setCullMode(QRhiGraphicsPipeline::CullMode mode)
指定された顔のカリングmode を設定します。
cullMode()も参照 。
void QRhiGraphicsPipeline::setDepthBias(int bias)
深さを設定するbias 。デフォルト値は0。
depthBias()も参照 。
void QRhiGraphicsPipeline::setDepthOp(QRhiGraphicsPipeline::CompareOp op)
深さ比較関数op を設定する。
depthOp()も参照 。
void QRhiGraphicsPipeline::setDepthTest(bool enable)
enable に基づいて深度テストを有効または無効にする。デフォルトでは、深度テストと深度データの書き出しの両方が無効になっている。
hasDepthTest() およびsetDepthWrite()も参照のこと 。
void QRhiGraphicsPipeline::setDepthWrite(bool enable)
enable に基づいて、深度バッファへの深度データの書き出しを制御する。デフォルトでは無効になっている。深度書き込みは通常、深度テストとともに有効にされる。
注意: 深度テストが有効になっていない状態で深度書き込みを有効にすると、望ましい結果にならない可能性があるので、避けるべきである。
hasDepthWrite() およびsetDepthTest()も参照のこと 。
void QRhiGraphicsPipeline::setFlags(QRhiGraphicsPipeline::Flags f)
フラグを設定するf 。
flags()も参照 。
void QRhiGraphicsPipeline::setFrontFace(QRhiGraphicsPipeline::FrontFace f)
フロント・フェース・モードf を設定する。
frontFace()も参照 。
void QRhiGraphicsPipeline::setLineWidth(float width)
width 行を設定する。実行時にQRhi::WideLines 機能がサポートされていないと報告された場合、1.0f 以外の値は無視される。
lineWidth()も参照 。
[since 6.7]
void QRhiGraphicsPipeline::setMultiViewCount(int count)
マルチビューレンダリングのためのビューcount を設定する。デフォルトは0で、マルチビューレンダリングを行わないことを示します。マルチビューレンダリングをトリガするには、count が2以上である必要があります。
マルチビューは、MultiView feature がサポートされていると報告された場合にのみ利用可能です。レンダーターゲットは 2D テクスチャ配列でなければならず、レンダーターゲットのカラーアタッチメントは同じcount セットでなければなりません。
マルチビューレンダリングの詳細についてはQRhiColorAttachment::setMultiViewCount() を参照してください。
この関数は Qt 6.7 で導入されました。
multiViewCount()、QRhi::MultiView 、QRhiColorAttachment::setMultiViewCount()も参照してください 。
void QRhiGraphicsPipeline::setPatchControlPointCount(int count)
パッチ制御点の数をcount に設定します。デフォルト値は 3 です。これは、トポロジーをPatches に設定した場合にのみ使用されます。
patchControlPointCount()も参照のこと 。
void QRhiGraphicsPipeline::setPolygonMode(QRhiGraphicsPipeline::PolygonMode mode)
ポリゴンmode を設定します。デフォルトは Fill です。
polygonMode() およびQRhi::NonFillPolygonModeも参照してください 。
void QRhiGraphicsPipeline::setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
指定されたQRhiRenderPassDescriptor desc と関連する。
renderPassDescriptor()も参照のこと 。
void QRhiGraphicsPipeline::setSampleCount(int s)
サンプル数を設定する。s の代表的な値は、1、4、または 8 です。パイプラインは常にレンダーターゲットと互換性がなければならない。
sampleCount() およびQRhi::supportedSampleCounts()も参照 。
void QRhiGraphicsPipeline::setShaderResourceBindings(QRhiShaderResourceBindings *srb)
リソースバインディングのレイアウトを記述するsrb と、リソース (QRhiBuffer,QRhiTexture) 自身を関連付けます。パイプラインの作成時に重要なのはレイアウトだけなので、後者はオプションです。したがって、ここで渡されるsrb は、描画コールを記録する前にsetShaderResources() を介して別のlayout-compatible QRhiShaderResourceBindings がバインドされている限り、実際のバッファオブジェクトやテクスチャオブジェクトを指定しないまま (nullptr
) にすることができます。
shaderResourceBindings()も参照してください 。
void QRhiGraphicsPipeline::setShaderStages(std::initializer_list<QRhiShaderStage> list)
シェーダー・ステージのlist を設定する。
template <typename InputIterator> void QRhiGraphicsPipeline::setShaderStages(InputIterator first, InputIterator last)
イテレータfirst およびlast からシェーダステージのリストを設定します。
void QRhiGraphicsPipeline::setSlopeScaledDepthBias(float bias)
傾きをスケーリングした深さを設定するbias 。デフォルト値は 0。
slopeScaledDepthBias()も参照 。
void QRhiGraphicsPipeline::setStencilBack(const QRhiGraphicsPipeline::StencilOpState &state)
裏面のステンシルテストstate を設定する。
stencilBack()も参照 。
void QRhiGraphicsPipeline::setStencilFront(const QRhiGraphicsPipeline::StencilOpState &state)
前面のステンシルテストstate を設定する。
stencilFront()も参照 。
void QRhiGraphicsPipeline::setStencilReadMask(quint32 mask)
mask を設定する。デフォルト値は 0xFF である。
stencilReadMask()も参照のこと 。
void QRhiGraphicsPipeline::setStencilTest(bool enable)
enable に基づくステンシルテストを有効または無効にする。デフォルトでは無効になっている。
hasStencilTest()も参照 。
void QRhiGraphicsPipeline::setStencilWriteMask(quint32 mask)
ステンシル書き込みmask を設定する。デフォルト値は 0xFF である。
stencilWriteMask()も参照のこと 。
void QRhiGraphicsPipeline::setTargetBlends(std::initializer_list<QRhiGraphicsPipeline::TargetBlend> list)
レンダーターゲットのブレンド設定のlist を設定する。これは、複数のレンダーターゲットが使用される場合(つまり、複数のQRhiColorAttachment を持つQRhiTextureRenderTarget )、レンダーターゲット(カラーアタッチメント)ごとにTargetBlend 構造が必要なため、リストになっています。
デフォルトでは、デフォルト構造のTargetBlend セットは1つです。
QRhi::MaxColorAttachmentsも参照してください 。
template <typename InputIterator> void QRhiGraphicsPipeline::setTargetBlends(InputIterator first, InputIterator last)
イテレータfirst とlast から、レンダーターゲットのブレンド設定のリストを設定します。
void QRhiGraphicsPipeline::setTopology(QRhiGraphicsPipeline::Topology t)
プリミティブ・トポロジーを設定するt 。
topology()も参照 。
void QRhiGraphicsPipeline::setVertexInputLayout(const QRhiVertexInputLayout &layout)
頂点入力layout を指定する。
vertexInputLayout()も参照 。
QRhiShaderResourceBindings *QRhiGraphicsPipeline::shaderResourceBindings() const
現在関連付けられているQRhiShaderResourceBindings オブジェクトを返す。
setShaderResourceBindings()も参照 。
const QRhiShaderStage *QRhiGraphicsPipeline::shaderStageAt(qsizetype index) const
指定されたindex におけるシェーダステージを返します。
qsizetype QRhiGraphicsPipeline::shaderStageCount() const
このパイプラインのシェーダステージの数を返します。
float QRhiGraphicsPipeline::slopeScaledDepthBias() const
現在設定されている勾配をスケーリングした深度バイアスを返します。
setSlopeScaledDepthBias()も参照 。
QRhiGraphicsPipeline::StencilOpState QRhiGraphicsPipeline::stencilBack() const
バックフェースの現在のステンシルテスト状態を返す。
setStencilBack()も参照 。
QRhiGraphicsPipeline::StencilOpState QRhiGraphicsPipeline::stencilFront() const
前面に対する現在のステンシルテスト状態を返す。
setStencilFront()も参照 。
quint32 QRhiGraphicsPipeline::stencilReadMask() const
現在のステンシル読み取りマスクを返す。
setStencilReadMask()も参照 。
quint32 QRhiGraphicsPipeline::stencilWriteMask() const
現在のステンシル書き込みマスクを返す。
setStencilWriteMask()も参照 。
const QRhiGraphicsPipeline::TargetBlend *QRhiGraphicsPipeline::targetBlendAt(qsizetype index) const
指定されたindex におけるレンダーターゲットのブレンド設定を返します。
qsizetype QRhiGraphicsPipeline::targetBlendCount() const
レンダーターゲットのブレンド設定の数を返します。
QRhiGraphicsPipeline::Topology QRhiGraphicsPipeline::topology() const
現在設定されているプリミティブトポロジーを返す。
setTopology()も参照 。
QRhiVertexInputLayout QRhiGraphicsPipeline::vertexInputLayout() const
現在設定されている頂点入力レイアウト仕様を返す。
setVertexInputLayout()も参照してください 。
© 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.