Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QGles2RenderBuffer Struct Reference

#include <qrhigles2_p.h>

Inheritance diagram for QGles2RenderBuffer:
Collaboration diagram for QGles2RenderBuffer:

Public Member Functions

 QGles2RenderBuffer (QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint)
 ~QGles2RenderBuffer ()
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create () override
 Creates the corresponding native graphics resources.
bool createFrom (NativeRenderBuffer src) override
 Similar to create() except that no new native renderbuffer objects are created.
QRhiTexture::Format backingFormat () const override
Public Member Functions inherited from QRhiRenderBuffer
QRhiResource::Type resourceType () const override
Type type () const
void setType (Type t)
 Sets the type to t.
QSize pixelSize () const
void setPixelSize (const QSize &sz)
 Sets the size (in pixels) to sz.
int sampleCount () const
void setSampleCount (int s)
 Sets the sample count to s.
Flags flags () const
void setFlags (Flags f)
 Sets the flags to f.
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
QRhirhi () const

Public Attributes

GLuint renderbuffer = 0
GLuint stencilRenderbuffer = 0
int samples
bool owns = true
uint generation = 0

Friends

class QRhiGles2

Additional Inherited Members

Public Types inherited from QRhiRenderBuffer
enum  Type { DepthStencil , Color }
 Specifies the type of the renderbuffer. More...
enum  Flag { UsedWithSwapChainOnly = 1 << 0 }
 \variable QRhiRenderBuffer::NativeRenderBuffer::object More...
Public Types inherited from QRhiResource
enum  Type {
  Buffer , Texture , Sampler , RenderBuffer ,
  RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings ,
  GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer ,
  ShadingRateMap
}
 Specifies type of the resource. More...
Protected Member Functions inherited from QRhiRenderBuffer
 QRhiRenderBuffer (QRhiImplementation *rhi, Type type_, const QSize &pixelSize_, int sampleCount_, Flags flags_, QRhiTexture::Format backingFormatHint_)
Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
Protected Attributes inherited from QRhiRenderBuffer
Type m_type
QSize m_pixelSize
int m_sampleCount
Flags m_flags
QRhiTexture::Format m_backingFormatHint
Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
quint64 m_id
QByteArray m_objectName

Detailed Description

Definition at line 64 of file qrhigles2_p.h.

Constructor & Destructor Documentation

◆ QGles2RenderBuffer()

QGles2RenderBuffer::QGles2RenderBuffer ( QRhiImplementation * rhi,
Type type,
const QSize & pixelSize,
int sampleCount,
QRhiRenderBuffer::Flags flags,
QRhiTexture::Format backingFormatHint )

Definition at line 5589 of file qrhigles2.cpp.

◆ ~QGles2RenderBuffer()

QGles2RenderBuffer::~QGles2RenderBuffer ( )

Definition at line 5596 of file qrhigles2.cpp.

Member Function Documentation

◆ backingFormat()

QRhiTexture::Format QGles2RenderBuffer::backingFormat ( ) const
overridevirtual

Implements QRhiRenderBuffer.

Definition at line 5741 of file qrhigles2.cpp.

◆ create()

bool QGles2RenderBuffer::create ( )
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.

Returns
true when successful, false when a graphics operation failed. Regardless of the return value, calling destroy() is always safe.

Implements QRhiRenderBuffer.

Definition at line 5623 of file qrhigles2.cpp.

◆ createFrom()

bool QGles2RenderBuffer::createFrom ( NativeRenderBuffer src)
overridevirtual

Similar to create() except that no new native renderbuffer objects are created.

Instead, the native renderbuffer object specified by src is used.

This allows importing an existing renderbuffer object (which must belong to the same device or sharing context, depending on the graphics API) from an external graphics engine.

Note
This is currently applicable to OpenGL only. This function exists solely to allow importing a renderbuffer object that is bound to some special, external object, such as an EGLImageKHR. Once the application performed the glEGLImageTargetRenderbufferStorageOES call, the renderbuffer object can be passed to this function to create a wrapping QRhiRenderBuffer, which in turn can be passed in as a color attachment to a QRhiTextureRenderTarget to enable rendering to the EGLImage.
pixelSize(), sampleCount(), and flags() must still be set correctly. Passing incorrect sizes and other values to QRhi::newRenderBuffer() and then following it with a createFrom() expecting that the native renderbuffer object alone is sufficient to deduce such values is wrong and will lead to problems.
QRhiRenderBuffer does not take ownership of the native object, and destroy() will not release that object.
This function is only implemented when the QRhi::RenderBufferImport feature is reported as \l{QRhi::isFeatureSupported()}{supported}. Otherwise, the function does nothing and the return value is false.
Returns
true when successful, false when not supported.

Reimplemented from QRhiRenderBuffer.

Definition at line 5716 of file qrhigles2.cpp.

◆ destroy()

void QGles2RenderBuffer::destroy ( )
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.

Note
Resources referenced by commands for the current frame should not be released until the frame is submitted by QRhi::endFrame().

The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.

See also
deleteLater()

Implements QRhiResource.

Definition at line 5601 of file qrhigles2.cpp.

◆ QRhiGles2

friend class QRhiGles2
friend

Definition at line 80 of file qrhigles2_p.h.

Member Data Documentation

◆ generation

uint QGles2RenderBuffer::generation = 0

Definition at line 79 of file qrhigles2_p.h.

◆ owns

bool QGles2RenderBuffer::owns = true

Definition at line 78 of file qrhigles2_p.h.

◆ renderbuffer

GLuint QGles2RenderBuffer::renderbuffer = 0

Definition at line 75 of file qrhigles2_p.h.

◆ samples

int QGles2RenderBuffer::samples

Definition at line 77 of file qrhigles2_p.h.

◆ stencilRenderbuffer

GLuint QGles2RenderBuffer::stencilRenderbuffer = 0

Definition at line 76 of file qrhigles2_p.h.


The documentation for this struct was generated from the following files: