PySide6.QtGui.QRhiRenderBuffer

class QRhiRenderBuffer

Renderbuffer resource.

Details

Renderbuffers cannot be sampled or read but have some benefits over textures in some cases:

A DepthStencil renderbuffer may be lazily allocated and be backed by transient memory with some APIs. On some platforms this may mean the depth/stencil buffer uses no physical backing at all.

Color renderbuffers are useful since MultisampleRenderBuffer may be supported even when MultisampleTexture is not.

How the renderbuffer is implemented by a backend is not exposed to the applications. In some cases it may be backed by ordinary textures, while in others there may be a different kind of native resource used.

Renderbuffers that are used as (and are only used as) depth-stencil buffers in combination with a QRhiSwapChain ‘s color buffers should have the UsedWithSwapChainOnly flag set. This serves a double purpose: such buffers, depending on the backend and the underlying APIs, be more efficient, and QRhi provides automatic sizing behavior to match the color buffers, which means calling setPixelSize() and create() are not necessary for such renderbuffers.

Note

This is a RHI API with limited compatibility guarantees, see QRhi for details.

Inheritance diagram of PySide6.QtGui.QRhiRenderBuffer

Added in version 6.6.

Synopsis

Methods

Virtual methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class Type

Specifies the type of the renderbuffer

Constant

Description

QRhiRenderBuffer.DepthStencil

Combined depth/stencil

QRhiRenderBuffer.Color

Color

class Flag

(inherits enum.Flag) Flag values for flags() and setFlags()

Constant

Description

QRhiRenderBuffer.UsedWithSwapChainOnly

For DepthStencil renderbuffers this indicates that the renderbuffer is only used in combination with a QRhiSwapChain , and never in any other way. This provides automatic sizing and resource rebuilding, so calling setPixelSize() or create() is not needed whenever this flag is set. This flag value may also trigger backend-specific behavior, for example with OpenGL, where a separate windowing system interface API is in use (EGL, GLX, etc.), the flag is especially important as it avoids creating any actual renderbuffer resource as there is already a windowing system provided depth/stencil buffer as requested by QSurfaceFormat .

PySide6.QtGui.QRhiRenderBuffer.m_type
PySide6.QtGui.QRhiRenderBuffer.m_pixelSize
PySide6.QtGui.QRhiRenderBuffer.m_sampleCount
PySide6.QtGui.QRhiRenderBuffer.m_flags
PySide6.QtGui.QRhiRenderBuffer.m_backingFormatHint
abstract backingFormat()
Return type:

Format

abstract create()
Return type:

bool

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.

flags()
Return type:

Combination of Flag

Returns the flags.

See also

setFlags()

pixelSize()
Return type:

QSize

Returns the pixel size.

See also

setPixelSize()

sampleCount()
Return type:

int

Returns the sample count. 1 means no multisample antialiasing.

See also

setSampleCount()

setFlags(f)
Parameters:

f – Combination of Flag

Sets the flags to f.

See also

flags()

setPixelSize(sz)
Parameters:

szQSize

Sets the size (in pixels) to sz.

See also

pixelSize()

setSampleCount(s)
Parameters:

s – int

Sets the sample count to s.

See also

sampleCount()

setType(t)
Parameters:

tType

Sets the type to t.

See also

type()

type()
Return type:

Type

Returns the renderbuffer type.

See also

setType()