QRhiRenderTarget Class

Represents an onscreen (swapchain) or offscreen (texture) render target. 更多...

头: #include <QRhiRenderTarget>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6
继承: QRhiResource
继承者:

QRhiSwapChainRenderTarget and QRhiTextureRenderTarget

公共函数

virtual float devicePixelRatio () const = 0
virtual QSize pixelSize () const = 0
QRhiRenderPassDescriptor * renderPassDescriptor () const
virtual int sampleCount () const = 0
void setRenderPassDescriptor (QRhiRenderPassDescriptor * desc )

详细描述

Applications do not create an instance of this class directly. Rather, it is the subclass QRhiTextureRenderTarget that is instantiable by clients of the API via newTextureRenderTarget (). The other subclass is QRhiSwapChainRenderTarget , which is the type QRhiSwapChain returns when calling currentFrameRenderTarget ().

注意: This is a RHI API with limited compatibility guarantees, see QRhi 了解细节。

另请参阅 QRhiSwapChainRenderTarget and QRhiTextureRenderTarget .

成员函数文档编制

[pure virtual] float QRhiRenderTarget:: devicePixelRatio () const

Returns the device pixel ratio. For QRhiTextureRenderTarget this is always 1. For targets retrieved from a QRhiSwapChain the value reflects the 设备像素比率 of the targeted QWindow .

[pure virtual] QSize QRhiRenderTarget:: pixelSize () const

Returns the size in pixels.

Valid only after create() has been called successfully. Until then the result is a default-constructed QSize .

采用 QRhiTextureRenderTarget the returned size is the size of the associated attachments at the time of create(), in practice the size of the first color attachment, or the depth/stencil buffer if there are no color attachments. If the associated textures or renderbuffers are resized and rebuilt afterwards, then pixelSize() performs an implicit call to create() in order to rebuild the underlying data structures. This implicit check is similar to what QRhiCommandBuffer::beginPass () does, and ensures that the returned size is always up-to-date.

QRhiRenderPassDescriptor *QRhiRenderTarget:: renderPassDescriptor () const

Returns the associated QRhiRenderPassDescriptor .

另请参阅 setRenderPassDescriptor ().

[pure virtual] int QRhiRenderTarget:: sampleCount () const

Returns the sample count or 1 if multisample antialiasing is not relevant for this render target.

void QRhiRenderTarget:: setRenderPassDescriptor ( QRhiRenderPassDescriptor * desc )

设置 QRhiRenderPassDescriptor desc for use with this render target.

另请参阅 renderPassDescriptor ().