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.
Returns the attribute at the given index .
Returns the number of attributes.
Returns the binding at the given index .
Returns the number of bindings.
Returns a const iterator pointing to the first item in the attribute list.
Returns a const iterator pointing to the first item in the binding list.
Returns a const iterator pointing just after the last item in the attribute list.
Returns a const iterator pointing just after the last item in the binding list.
Sets the attributes from the specified list .
Sets the attributes using the iterators first and last .
Sets the bindings from the specified list .
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
相等。