PySide6.QtGui.QRhiVertexInputLayout

class QRhiVertexInputLayout

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

Details

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) }
});

Note

This is a RHI API with limited compatibility guarantees, see QRhi for details.

Added in version 6.6.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()

Constructs an empty vertex input layout description.

attributeAt(index)
Parameters:

index – int

Return type:

QRhiVertexInputAttribute

Returns the attribute at the given index.

attributeCount()
Return type:

int

Returns the number of attributes.

bindingAt(index)
Parameters:

index – int

Return type:

QRhiVertexInputBinding

Returns the binding at the given index.

bindingCount()
Return type:

int

Returns the number of bindings.

cbeginAttributes()
Return type:

QRhiVertexInputAttribute

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

cbeginBindings()
Return type:

QRhiVertexInputBinding

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

cendAttributes()
Return type:

QRhiVertexInputAttribute

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

cendBindings()
Return type:

QRhiVertexInputBinding

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

__ne__(b)
Parameters:

bQRhiVertexInputLayout

Return type:

bool

__eq__(b)
Parameters:

bQRhiVertexInputLayout

Return type:

bool

setAttributes(attributes)
Parameters:

attributes – .list of QRhiVertexInputAttribute

setBindings(bindings)
Parameters:

bindings – .list of QRhiVertexInputBinding