Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qrhinull_p.h>
Public Member Functions | |
QNullSwapChain (QRhiImplementation *rhi) | |
~QNullSwapChain () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
QRhiCommandBuffer * | currentFrameCommandBuffer () override |
QRhiRenderTarget * | currentFrameRenderTarget () override |
QSize | surfacePixelSize () override |
bool | isFormatSupported (Format f) override |
QRhiRenderPassDescriptor * | newCompatibleRenderPassDescriptor () override |
bool | createOrResize () override |
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size of the targeted surface. | |
Public Member Functions inherited from QRhiSwapChain | |
QRhiResource::Type | resourceType () const override |
QWindow * | window () const |
void | setWindow (QWindow *window) |
Sets the window. | |
QRhiSwapChainProxyData | proxyData () const |
void | setProxyData (const QRhiSwapChainProxyData &d) |
Sets the proxy data d. | |
Flags | flags () const |
void | setFlags (Flags f) |
Sets the flags f. | |
Format | format () const |
void | setFormat (Format f) |
Sets the format f. | |
QRhiRenderBuffer * | depthStencil () const |
void | setDepthStencil (QRhiRenderBuffer *ds) |
Sets the renderbuffer ds for use as a depth-stencil buffer. | |
int | sampleCount () const |
void | setSampleCount (int samples) |
Sets the sample count. | |
QRhiRenderPassDescriptor * | renderPassDescriptor () const |
void | setRenderPassDescriptor (QRhiRenderPassDescriptor *desc) |
Associates with the QRhiRenderPassDescriptor desc. | |
QRhiShadingRateMap * | shadingRateMap () const |
void | setShadingRateMap (QRhiShadingRateMap *map) |
Associates with the specified QRhiShadingRateMap map. | |
QSize | currentPixelSize () const |
virtual QRhiRenderTarget * | currentFrameRenderTarget (StereoTargetBuffer targetBuffer) |
virtual QRhiSwapChainHdrInfo | hdrInfo () |
\variable QRhiSwapChainHdrInfo::limitsType | |
Public Member Functions inherited from QRhiResource | |
virtual | ~QRhiResource () |
Destructor. | |
void | deleteLater () |
When called without a frame being recorded, this function is equivalent to deleting the object. | |
QByteArray | name () const |
void | setName (const QByteArray &name) |
Sets a name for the object. | |
quint64 | globalResourceId () const |
QRhi * | rhi () const |
Public Attributes | |
QWindow * | window = nullptr |
QNullSwapChainRenderTarget | rt |
QNullCommandBuffer | cb |
int | frameCount = 0 |
Definition at line 151 of file qrhinull_p.h.
QNullSwapChain::QNullSwapChain | ( | QRhiImplementation * | rhi | ) |
Definition at line 1001 of file qrhinull.cpp.
References QNullSwapChain().
Referenced by QNullSwapChain().
QNullSwapChain::~QNullSwapChain | ( | ) |
Definition at line 1008 of file qrhinull.cpp.
References destroy().
|
overridevirtual |
Creates the swapchain if not already done and resizes the swapchain buffers to match the current size of the targeted surface.
Call this whenever the size of the target surface is different than before.
true
when successful, false
when a graphics operation failed. Regardless of the return value, calling destroy() is always safe. Implements QRhiSwapChain.
Definition at line 1048 of file qrhinull.cpp.
References destroy(), and frameCount.
|
overridevirtual |
Implements QRhiSwapChain.
Definition at line 1020 of file qrhinull.cpp.
|
overridevirtual |
Implements QRhiSwapChain.
Definition at line 1025 of file qrhinull.cpp.
|
overridevirtual |
Releases (or requests deferred releasing of) the underlying native graphics resources.
Safe to call multiple times, subsequent invocations will be a no-op then.
Once destroy() is called, the QRhiResource instance can be reused, by calling create()
again. That will then result in creating new native graphics resources underneath.
The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.
Implements QRhiResource.
Definition at line 1013 of file qrhinull.cpp.
Referenced by ~QNullSwapChain(), and createOrResize().
|
overridevirtual |
The main use of this function is to call it before the first createOrResize() after the window is already set. This allow the QRhi backends to perform platform or windowing system specific queries to determine if the window (and the screen it is on) is capable of true HDR output with the specified format.
When the format is reported as supported, call setFormat() to set the requested format and call createOrResize(). Be aware of the consequences however: successfully requesting a HDR format will involve having to deal with a different color space, possibly doing white level correction for non-HDR-aware content, adjusting tonemapping methods, adjusting offscreen render target settings, etc.
Implements QRhiSwapChain.
Definition at line 1035 of file qrhinull.cpp.
|
overridevirtual |
The returned value is used in two ways: it can be passed to setRenderPassDescriptor() and QRhiGraphicsPipeline::setRenderPassDescriptor(). A render pass descriptor describes the attachments (color, depth/stencil) and the load/store behavior that can be affected by flags(). A QRhiGraphicsPipeline can only be used in combination with a swapchain that has a \l{QRhiRenderPassDescriptor::isCompatible()}{compatible} QRhiRenderPassDescriptor set.
Implements QRhiSwapChain.
Definition at line 1040 of file qrhinull.cpp.
|
overridevirtual |
{QWindow::size() * QWindow::devicePixelRatio()}. With some graphics APIs and windowing system interfaces (for example, Vulkan) there is a theoretical possibility for a surface to assume a size different from the associated window. To support these cases, {rendering logic must always base size-derived calculations (such as, viewports) on the size reported from QRhiSwapChain, and never on the size queried from QWindow}.Implements QRhiSwapChain.
Definition at line 1030 of file qrhinull.cpp.
QNullCommandBuffer QNullSwapChain::cb |
Definition at line 168 of file qrhinull_p.h.
int QNullSwapChain::frameCount = 0 |
Definition at line 169 of file qrhinull_p.h.
Referenced by createOrResize(), and QRhiNull::endFrame().
QNullSwapChainRenderTarget QNullSwapChain::rt |
Definition at line 167 of file qrhinull_p.h.
Definition at line 166 of file qrhinull_p.h.