QRhiVertexInputLayout Class

Describes the layout of vertex inputs consumed by a vertex shader. 更多...

頭: #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

公共函數

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 )

詳細描述

The vertex input layout is defined by the collections of QRhiVertexInputBinding and QRhiVertexInputAttribute .

As an example, let's assume that we have a single buffer with 3 component vertex positions and 2 component UV coordinates interleaved ( x , y , z , u , v ), that the position and UV are expected at input locations 0 and 1 by the vertex shader, and that the vertex buffer will be bound at binding point 0 using setVertexInput () later on:

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

注意: This is a RHI API with limited compatibility guarantees, see QRhi 瞭解細節。

成員函數文檔編製

[constexpr noexcept] QRhiVertexInputLayout:: QRhiVertexInputLayout ()

Constructs an empty vertex input layout description.

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

Returns the attribute at the given index .

qsizetype QRhiVertexInputLayout:: attributeCount () const

Returns the number of attributes.

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

Returns the binding at the given index .

qsizetype QRhiVertexInputLayout:: bindingCount () const

Returns the number of bindings.

const QRhiVertexInputAttribute *QRhiVertexInputLayout:: cbeginAttributes () const

Returns a const iterator pointing to the first item in the attribute list.

const QRhiVertexInputBinding *QRhiVertexInputLayout:: cbeginBindings () const

Returns a const iterator pointing to the first item in the binding list.

const QRhiVertexInputAttribute *QRhiVertexInputLayout:: cendAttributes () const

Returns a const iterator pointing just after the last item in the attribute list.

const QRhiVertexInputBinding *QRhiVertexInputLayout:: cendBindings () const

Returns a const iterator pointing just after the last item in the binding list.

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

Sets the attributes from the specified list .

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

Sets the attributes using the iterators first and last .

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

Sets the bindings from the specified list .

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

Sets the bindings using the iterators first and last .

相關非成員

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

返迴哈希值為 key ,使用 seed 做計算種子。

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

返迴 false if the values in the two QRhiVertexInputLayout 對象 a and b 相等;否則返迴 true .

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

返迴 true if the values in the two QRhiVertexInputLayout 對象 a and b 相等。