이 페이지에서

QSSGRhiContext Class

QSSGRhiContext. 더 보기...

Header: #include <qssgrhicontext.h>
Since: Qt 6.7

공개 함수

void checkAndAdjustForNPoT(QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription)
QRhiCommandBuffer *commandBuffer() const
QRhiCommandBuffer::BeginPassFlags commonPassFlags() const
QRhiTexture *dummyTexture(QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub, const QSize &size = QSize(64, 64), const QColor &fillColor = Qt::black, int arraySize = 0)
bool isValid() const
int mainPassSampleCount() const
int mainPassViewCount() const
QRhiRenderPassDescriptor *mainRenderPassDescriptor() const
QRhiRenderTarget *renderTarget() const
QRhi *rhi() const
QRhiSampler *sampler(const QSSGRhiSamplerDescription &samplerDescription)

상세 설명

멤버 함수 설명

void QSSGRhiContext::checkAndAdjustForNPoT(QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription)

texture 의 픽셀 크기에 따라 samplerDescription 의 타일링 및 필터링 모드를 조정합니다.

대부분의 경우 samplerDescription 는 변경되지 않습니다. 그러나 구형 레거시 3D API를 사용하는 경우, 너비나 높이가 2의 제곱이 아닌 텍스처에 대해서는 QRhiSampler::Repeat 와 같은 타일링 모드가 지원되지 않을 가능성이 있습니다.

이 편의 함수는 실행 시점에 OpenGL ES 2.0이나 WebGL 1 구현체에서 QRhi::NPOTTextureRepeat 와 같은 기능이 지원되지 않더라도 정상적으로 작동하는 견고한 애플리케이션을 만드는 데 도움이 됩니다.

QRhiCommandBuffer *QSSGRhiContext::commandBuffer() const

Qt Quick 3D 렌더러에서 사용하는 현재 프레임의 명령 버퍼를 반환합니다.

QRhiCommandBuffer::BeginPassFlags QSSGRhiContext::commonPassFlags() const

QRhiCommandBuffer::beginPass()을 호출할 때 권장되는 플래그를 반환합니다.

QRhiTexture *QSSGRhiContext::dummyTexture(QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub, const QSize &size = QSize(64, 64), const QColor &fillColor = Qt::black, int arraySize = 0)

지정된 flags 및 픽셀 size 을 갖는 텍스처를 반환합니다.

이 함수는 주어진 색상 공간( fillColor)으로 채워진 "더미" 텍스처에 효율적으로 접근하고, 렌더링 스택의 여러 곳에서 재사용하기 위한 것입니다.

rub 이 함수는 적합한 캐시된 객체를 찾지 못할 경우 새로운 텍스처를 생성하고 그 내용을 생성하므로, ` QRhiResourceUpdateBatch `는 유효한 값이어야 합니다. 그런 다음 필요한 업로드 작업이 주어진 업데이트 배치에 큐에 추가됩니다.

arraySize 가 2 이상인 경우, 2D 텍스처 배열이 반환됩니다.

반환된 텍스처의 소유권은 Qt Quick 3D 에 귀속됩니다.

bool QSSGRhiContext::isValid() const

렌더러가 성공적으로 초기화되면 true를 반환합니다.

int QSSGRhiContext::mainPassSampleCount() const

메인 렌더 패스에서 사용된 샘플 수를 반환합니다.

int QSSGRhiContext::mainPassViewCount() const

메인 렌더링 패스에서 사용되는 멀티뷰 개수를 반환합니다. 이 값은 멀티뷰 렌더링이 사용 중인 경우 2이며, 그렇지 않은 경우(멀티뷰 미사용) 1입니다.

QRhiRenderPassDescriptor *QSSGRhiContext::mainRenderPassDescriptor() const

Qt Quick 3D 렌더러의 메인 렌더 패스에서 사용되는 ` QRhiRenderPassDescriptor `를 반환합니다.

QRhiRenderTarget *QSSGRhiContext::renderTarget() const

Qt Quick 3D 렌더러가 현재 프레임의 메인 렌더 패스에 사용하는 렌더 타겟을 반환합니다.

View3D 가 Offscreen 이외의 renderMode를 사용하는 경우, 이는 사실상 스왑체인(swapchain)의 렌더 타깃이 될 수 있습니다. 더 일반적으로는, renderMode가 기본값인 Offscreen이거나 후처리 효과가 사용되고 있는 경우 등, 렌더 타깃은 텍스처(즉, QRhiTextureRenderTarget)를 가리킵니다.

QRhi *QSSGRhiContext::rhi() const

Qt Quick 3D 렌더러에서 사용하는 ` QRhi ` 객체를 반환합니다.

QRhiSampler *QSSGRhiContext::sampler(const QSSGRhiSamplerDescription &samplerDescription)

samplerDescription 에 지정된 필터 및 타일링 모드를 가진 샘플러를 반환합니다.

생성된 QRhiSampler 객체는 캐시되어 재사용됩니다. 따라서 매번 새로운 전용 객체를 생성할 필요 없이, 주어진 설정으로 QRhiSampler 에 접근할 수 있는 편리한 방법입니다.

반환된 ` QRhiSampler `의 소유권은 ` Qt Quick 3D`에 남아 있습니다.

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