QRhiVertexInputLayout Class

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

头: #include <QRhiVertexInputLayout>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
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 & v , 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 & v , size_t seed = 0)

返回哈希值为 v ,使用 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 相等。