Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qrhigles2_p.h>
Public Member Functions | |
QGles2TextureRenderTarget (QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags) | |
~QGles2TextureRenderTarget () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
QSize | pixelSize () const override |
float | devicePixelRatio () const override |
int | sampleCount () const override |
QRhiRenderPassDescriptor * | newCompatibleRenderPassDescriptor () override |
bool | create () override |
Creates the corresponding native graphics resources. | |
Public Member Functions inherited from QRhiTextureRenderTarget | |
QRhiResource::Type | resourceType () const override |
QRhiTextureRenderTargetDescription | description () const |
void | setDescription (const QRhiTextureRenderTargetDescription &desc) |
Sets the render target description desc. | |
Flags | flags () const |
void | setFlags (Flags f) |
Sets the flags to f. | |
Public Member Functions inherited from QRhiRenderTarget | |
QRhiRenderPassDescriptor * | renderPassDescriptor () const |
void | setRenderPassDescriptor (QRhiRenderPassDescriptor *desc) |
Sets the QRhiRenderPassDescriptor desc for use with this render target. | |
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 | |
QGles2RenderTargetData | d |
GLuint | framebuffer = 0 |
GLuint | nonMsaaThrowawayDepthTexture = 0 |
Friends | |
class | QRhiGles2 |
Definition at line 203 of file qrhigles2_p.h.
QGles2TextureRenderTarget::QGles2TextureRenderTarget | ( | QRhiImplementation * | rhi, |
const QRhiTextureRenderTargetDescription & | desc, | ||
Flags | flags ) |
Definition at line 5874 of file qrhigles2.cpp.
QGles2TextureRenderTarget::~QGles2TextureRenderTarget | ( | ) |
Definition at line 5882 of file qrhigles2.cpp.
References destroy().
|
overridevirtual |
Creates the corresponding native graphics resources.
If there are already resources present due to an earlier create() with no corresponding destroy(), then destroy() is called implicitly first.
true
when successful, false
when a graphics operation failed. Regardless of the return value, calling destroy() is always safe. Implements QRhiTextureRenderTarget.
Definition at line 5916 of file qrhigles2.cpp.
References QRhiTextureRenderTargetDescription::cbeginColorAttachments(), QRhiTextureRenderTargetDescription::cendColorAttachments(), QRhiTextureRenderTargetDescription::colorAttachmentCount(), QGles2RenderTargetData::colorAttCount, QByteArray::constData(), QRhiTexture::CubeMap, QGles2RenderTargetData::currentResIdList, d, QRhiTextureRenderTargetDescription::depthResolveTexture(), QRhiTextureRenderTargetDescription::depthStencilBuffer(), QRhiTextureRenderTargetDescription::depthTexture(), destroy(), QRhiTextureRenderTarget::DoNotStoreDepthStencilContents, QGles2RenderTargetData::dpr, QGles2RenderTargetData::dsAttCount, GL_COLOR_ATTACHMENT0, GL_DEPTH24_STENCIL8, GL_DEPTH_ATTACHMENT, GL_DEPTH_STENCIL_ATTACHMENT, GL_FRAMEBUFFER, GL_FRAMEBUFFER_COMPLETE, GL_RENDERBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GLenum(), it, QRhiColorAttachment::layer(), QRhiColorAttachment::level(), QRhiTextureRenderTarget::m_desc, QRhiTextureRenderTarget::m_flags, QRhiResource::m_objectName, QRhiRenderTarget::m_renderPassDesc, QRhiColorAttachment::multiViewCount(), nonMsaaThrowawayDepthTexture, QRhiTexture::OneDimensional, QGles2RenderTargetData::pixelSize, Q_ASSERT, QRHI_RES, QRHI_RES_RHI, qWarning, QRhiColorAttachment::renderBuffer(), QRhiColorAttachment::resolveLayer(), QRhiColorAttachment::resolveLevel(), QRhiColorAttachment::resolveTexture(), QGles2RenderTargetData::rp, QGles2RenderTargetData::sampleCount, QRhiColorAttachment::texture(), QRhiTexture::TextureArray, and QRhiTexture::ThreeDimensional.
Referenced by pixelSize().
|
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 5887 of file qrhigles2.cpp.
References framebuffer, nonMsaaThrowawayDepthTexture, QRHI_RES_RHI, QRhiGles2::DeferredReleaseEntry::TextureRenderTarget, QRhiGles2::DeferredReleaseEntry::textureRenderTarget, and QRhiGles2::DeferredReleaseEntry::type.
Referenced by ~QGles2TextureRenderTarget(), and create().
|
overridevirtual |
Implements QRhiRenderTarget.
Definition at line 6174 of file qrhigles2.cpp.
References d, and QGles2RenderTargetData::dpr.
|
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 render target that has a \l{QRhiRenderPassDescriptor::isCompatible()}{compatible} QRhiRenderPassDescriptor set.
Two QRhiTextureRenderTarget instances can share the same render pass descriptor as long as they have the same number and type of attachments. The associated QRhiTexture or QRhiRenderBuffer instances are not part of the render pass descriptor so those can differ in the two QRhiTextureRenderTarget instances.
Implements QRhiTextureRenderTarget.
Definition at line 5908 of file qrhigles2.cpp.
References QRhiResource::m_rhi, and QRHI_RES_RHI.
|
overridevirtual |
Valid only after create() has been called successfully. Until then the result is a default-constructed QSize.
With 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.
Implements QRhiRenderTarget.
Definition at line 6166 of file qrhigles2.cpp.
References create(), QGles2RenderTargetData::currentResIdList, d, QRhiTextureRenderTarget::m_desc, and QGles2RenderTargetData::pixelSize.
|
overridevirtual |
Implements QRhiRenderTarget.
Definition at line 6179 of file qrhigles2.cpp.
References d, and QGles2RenderTargetData::sampleCount.
|
friend |
Definition at line 219 of file qrhigles2_p.h.
QGles2RenderTargetData QGles2TextureRenderTarget::d |
Definition at line 216 of file qrhigles2_p.h.
Referenced by create(), devicePixelRatio(), pixelSize(), and sampleCount().
GLuint QGles2TextureRenderTarget::framebuffer = 0 |
Definition at line 217 of file qrhigles2_p.h.
Referenced by destroy().
GLuint QGles2TextureRenderTarget::nonMsaaThrowawayDepthTexture = 0 |
Definition at line 218 of file qrhigles2_p.h.