QRhiVertexInputLayout 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

パブリック関数

QRhiVertexInputLayout()
const QRhiVertexInputAttribute *attributeAt(qsizetype index) const
qsizetype attributeCount() const
const QRhiVertexInputBinding *bindingAt(qsizetype index) const
qsizetype bindingCount() const
const QRhiVertexInputAttribute *cbeginAttributes() const
const QRhiVertexInputBinding *cbeginBindings() const
const QRhiVertexInputAttribute *cendAttributes() const
const QRhiVertexInputBinding *cendBindings() const
void setAttributes(std::initializer_list<QRhiVertexInputAttribute> list)
void setAttributes(InputIterator first, InputIterator last)
void setBindings(std::initializer_list<QRhiVertexInputBinding> list)
void setBindings(InputIterator first, InputIterator last)
size_t qHash(const QRhiVertexInputLayout &key, size_t seed = 0)
bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b)
bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b)

詳細説明

頂点入力レイアウトは、QRhiVertexInputBindingQRhiVertexInputAttribute のコレクションによって定義されます。

例として、3 つのコンポーネントの頂点位置と 2 つのコンポーネントの UV 座標がインターリーブされた 1 つのバッファがあると仮定します (x,y,z,u,v)。頂点シェーダによって位置と UV は入力位置 0 と 1 に期待され、頂点バッファは後でsetVertexInput() を使用して結合点 0 で結合されます:

QRhiVertexInputLayout inputLayout;
inputLayout.setBindings({
    { 5 * sizeof(float) }
});
inputLayout.setAttributes({
    { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
    { 0, 1, QRhiVertexInputAttribute::Float2, 3 * sizeof(float) }
});

注意: これは互換性保証に制限のあるRHI APIです。詳細はQRhi を参照してください。

メンバ関数ドキュメント

[constexpr noexcept] QRhiVertexInputLayout::QRhiVertexInputLayout()

空の頂点入力レイアウト記述を構築します。

const QRhiVertexInputAttribute *QRhiVertexInputLayout::attributeAt(qsizetype index) const

与えられたindex にある属性を返します。

qsizetype QRhiVertexInputLayout::attributeCount() const

属性の数を返します。

const QRhiVertexInputBinding *QRhiVertexInputLayout::bindingAt(qsizetype index) const

与えられたindex でのバインディングを返します。

qsizetype QRhiVertexInputLayout::bindingCount() const

バインディングの数を返します。

const QRhiVertexInputAttribute *QRhiVertexInputLayout::cbeginAttributes() const

属性リストの最初の項目を指す定数イテレータを返します。

const QRhiVertexInputBinding *QRhiVertexInputLayout::cbeginBindings() const

バインディングリストの最初の項目を指すイテレータを返します。

const QRhiVertexInputAttribute *QRhiVertexInputLayout::cendAttributes() const

属性リストの最後の項目の直後を指す定数イテレータを返します。

const QRhiVertexInputBinding *QRhiVertexInputLayout::cendBindings() const

バインディングリストの最後の項目の直後を指すイテレータを返します。

void QRhiVertexInputLayout::setAttributes(std::initializer_list<QRhiVertexInputAttribute> list)

指定されたlist の属性を設定する。

template <typename InputIterator> void QRhiVertexInputLayout::setAttributes(InputIterator first, InputIterator last)

イテレータfirstlast を使って属性を設定する。

void QRhiVertexInputLayout::setBindings(std::initializer_list<QRhiVertexInputBinding> list)

指定 さ れたlist のバ イ ンデ ィ ン グ を設定 し ます。

template <typename InputIterator> void QRhiVertexInputLayout::setBindings(InputIterator first, InputIterator last)

イテレータfirstlast を使ってバインディングを設定します。

関連する非会員

[noexcept] size_t qHash(const QRhiVertexInputLayout &key, size_t seed = 0)

key のハッシュ値を返す。計算のシードにはseed を使用する。

[noexcept] bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b)

2つのQRhiVertexInputLayout オブジェクトab の値が等しい場合はfalse を返し、そうでない場合はtrue を返す。

[noexcept] bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b)

2つのQRhiVertexInputLayout オブジェクトab の値が等しい場合、true を返す。

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