QtBase
v6.3.1
|
#include <qrhi_p.h>
Public Types | |
enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , RenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer } |
Public Member Functions | |
virtual | ~QRhiResource () |
virtual Type | resourceType () const =0 |
virtual void | destroy ()=0 |
void | deleteLater () |
QByteArray | name () const |
void | setName (const QByteArray &name) |
quint64 | globalResourceId () const |
Protected Member Functions | |
QRhiResource (QRhiImplementation *rhi) | |
Protected Attributes | |
QRhiImplementation * | m_rhi = nullptr |
quint64 | m_id |
QByteArray | m_objectName |
Friends | |
class | QRhiImplementation |
enum QRhiResource::Type |
|
virtual |
Destructor.
Releases (or requests deferred releasing of) the underlying native graphics resources, if there are any.
|
protected |
void QRhiResource::deleteLater | ( | ) |
When called without a frame being recorded, this function is equivalent to deleting the object. Between a QRhi::beginFrame() and QRhi::endFrame() however the behavior is different: the QRhiResource will not be destroyed until the frame is submitted via QRhi::endFrame(), thus satisfying the QRhi requirement of not altering QRhiResource objects that are referenced by the frame being recorded.
Definition at line 2034 of file qrhi.cpp.
|
pure virtual |
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 destroying a QRhiResource.
Implemented in QVkSwapChain, QVkCommandBuffer, QVkComputePipeline, QVkGraphicsPipeline, QVkShaderResourceBindings, QVkTextureRenderTarget, QVkReferenceRenderTarget, QVkRenderPassDescriptor, QVkSampler, QVkTexture, QVkRenderBuffer, QVkBuffer, QNullSwapChain, QNullCommandBuffer, QNullComputePipeline, QNullGraphicsPipeline, QNullShaderResourceBindings, QNullTextureRenderTarget, QNullReferenceRenderTarget, QNullRenderPassDescriptor, QNullSampler, QNullTexture, QNullRenderBuffer, QNullBuffer, QMetalSwapChain, QMetalCommandBuffer, QMetalComputePipeline, QMetalGraphicsPipeline, QMetalShaderResourceBindings, QMetalTextureRenderTarget, QMetalReferenceRenderTarget, QMetalRenderPassDescriptor, QMetalSampler, QMetalTexture, QMetalRenderBuffer, QMetalBuffer, QGles2SwapChain, QGles2CommandBuffer, QGles2ComputePipeline, QGles2GraphicsPipeline, QGles2ShaderResourceBindings, QGles2TextureRenderTarget, QGles2ReferenceRenderTarget, QGles2RenderPassDescriptor, QGles2Sampler, QGles2Texture, QGles2RenderBuffer, QGles2Buffer, QD3D11SwapChain, QD3D11CommandBuffer, QD3D11ComputePipeline, QD3D11GraphicsPipeline, QD3D11ShaderResourceBindings, QD3D11TextureRenderTarget, QD3D11ReferenceRenderTarget, QD3D11RenderPassDescriptor, QD3D11Sampler, QD3D11Texture, QD3D11RenderBuffer, and QD3D11Buffer.
quint64 QRhiResource::globalResourceId | ( | ) | const |
User code rarely needs to deal with the value directly. It is used internally for tracking and bookkeeping purposes.
QByteArray QRhiResource::name | ( | ) | const |
|
pure virtual |
Implemented in QRhiCommandBuffer, QRhiComputePipeline, QRhiSwapChain, QRhiGraphicsPipeline, QRhiShaderResourceBindings, QRhiTextureRenderTarget, QRhiRenderTarget, QRhiRenderPassDescriptor, QRhiRenderBuffer, QRhiSampler, QRhiTexture, and QRhiBuffer.
void QRhiResource::setName | ( | const QByteArray & | name | ) |
Sets a name for the object.
This has two uses: to get descriptive names for the native graphics resources visible in graphics debugging tools, such as \l{https://renderdoc.org/}{RenderDoc} and \l{https://developer.apple.com/xcode/}{XCode}, and in the output stream of QRhiProfiler.
When it comes to naming native objects by relaying the name via the appropriate graphics API, note that the name is ignored when QRhi::DebugMarkers are not supported, and may, depending on the backend, also be ignored when QRhi::EnableDebugMarkers is not set.
Definition at line 2068 of file qrhi.cpp.
|
friend |
|
protected |
|
protected |