이 페이지에서

QRhiVertexInputBinding Class

정점 입력 바인딩에 대해 설명합니다. 더 보기...

헤더: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
다음부터: Qt 6.6부터

공개 유형

enum Classification { PerVertex, PerInstance }

공개 함수

QRhiVertexInputBinding()
QRhiVertexInputBinding(quint32 stride, QRhiVertexInputBinding::Classification cls = PerVertex, quint32 stepRate = 1)
QRhiVertexInputBinding::Classification classification() const
quint32 instanceStepRate() const
void setClassification(QRhiVertexInputBinding::Classification c)
void setInstanceStepRate(quint32 rate)
void setStride(quint32 s)
quint32 stride() const
size_t qHash(const QRhiVertexInputBinding &key, size_t seed = 0)
bool operator!=(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b)
bool operator==(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b)

상세 설명

스트라이드(바이트 단위, 4의 배수여야 함), 분류 및 선택적으로 인스턴스 단계 속도를 지정합니다.

예를 들어, 다음과 같은 입력값을 갖는 버텍스 셰이더를 가정해 봅시다.

layout(location = 0) in vec4 position;
layout(location = 1) in vec2 texcoord;

이제 3성분 버텍스 위치 (x, y, z) 와 2성분 텍스처 좌표 (u, v) 가 버퍼(또는 별도의 버퍼들) 내에 인터리브되지 않은 형식으로 제공된다고 가정해 봅시다. 이 경우 두 개의 바인딩을 다음과 같이 정의할 수 있습니다:

QRhiVertexInputLayout inputLayout;
inputLayout.setBindings({
    { 3 * sizeof(float) },
    { 2 * sizeof(float) }
});

인스턴싱이 사용되지 않으므로 여기서는 스트라이드만 중요합니다. 바인딩 번호는 QRhiVertexInputLayout 의 바인딩 벡터 내 QRhiVertexInputBinding 요소의 인덱스로 주어집니다.

이러한 정점 입력 레이아웃을 가진 그래픽 파이프라인이 바인딩되면, 위치 데이터가 먼저 오고 텍스처 좌표가 그 다음에 오는 단일 버퍼가 있다고 가정할 때, 36개의 정점을 가진 큐브를 그리기 위해 정점 입력을 다음과 같이 설정할 수 있습니다:

const QRhiCommandBuffer::VertexInput vbufBindings[] = {
    { cubeBuf, 0 },
    { cubeBuf, 36 * 3 * sizeof(float) }
};
cb->setVertexInput(0, 2, vbufBindings);

startBinding + i 에서 정의된 인덱스(여기서 i 는 setVertexInput()의 두 번째 인자로 전달된 인덱스)가 QRhiVertexInputLayout 의 bindings 벡터 내 해당 항목의 인덱스와 일치하는 점에 유의하십시오.

참고: stride는 항상 4의 배수여야 합니다.

참고: 이 함수는 호환성 보장이 제한된 RHI API입니다. 자세한 내용은 QRhi 를 참조하십시오.

QRhiCommandBuffer::setVertexInput()도 참조하십시오 .

멤버 유형 문서

enum QRhiVertexInputBinding::Classification

입력 데이터의 분류를 설명합니다.

상수값설명
QRhiVertexInputBinding::PerVertex0데이터는 정점별입니다.
QRhiVertexInputBinding::PerInstance1데이터는 인스턴스 단위입니다

멤버 함수 문서

[constexpr noexcept default] QRhiVertexInputBinding::QRhiVertexInputBinding()

기본 정점 입력 바인딩 설명을 생성합니다.

QRhiVertexInputBinding::QRhiVertexInputBinding(quint32 stride, QRhiVertexInputBinding::Classification cls = PerVertex, quint32 stepRate = 1)

지정된 stride, 분류 cls 및 인스턴스 단계 속도 stepRate 을 사용하여 정점 입력 바인딩 설명을 생성합니다.

참고: stepRate 값이 1이 아닌 경우, QRhi::CustomInstanceStepRate 가 지원된다고 보고된 경우에만 지원됩니다.

QRhiVertexInputBinding::Classification QRhiVertexInputBinding::classification() const

입력 데이터의 분류 결과를 반환합니다.

setClassification()도 참조하십시오 .

quint32 QRhiVertexInputBinding::instanceStepRate() const

인스턴스의 단계 속도를 반환합니다.

setInstanceStepRate()도 참조하십시오 .

void QRhiVertexInputBinding::setClassification(QRhiVertexInputBinding::Classification c)

입력 데이터 분류 c 를 설정합니다. 기본적으로 이 값은 PerVertex 로 설정되어 있습니다.

classification()도 참조하십시오 .

void QRhiVertexInputBinding::setInstanceStepRate(quint32 rate)

인스턴스 단계 rate 를 설정합니다. 기본적으로 이 값은 1로 설정되어 있습니다.

instanceStepRate()도 참조하십시오 .

void QRhiVertexInputBinding::setStride(quint32 s)

스트라이드를 s 로 설정합니다.

stride()도 참조하십시오 .

quint32 QRhiVertexInputBinding::stride() const

스트라이드를 바이트 단위로 반환합니다.

setStride()도 참조하십시오 .

관련 비회원 함수

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

seed 를 계산의 시드로 사용하여, key 에 대한 해시 값을 반환합니다.

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

두 개의 ` QRhiVertexInputBinding ` 객체 a 와 b 의 값이 같으면 ` false `를 반환하고, 그렇지 않으면 ` true`를 반환합니다.

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

두 개의 ` QRhiVertexInputBinding ` 객체 a 와 b 의 값이 같을 경우 ` true `를 반환합니다.

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