PySide6.QtGui.QRhiRenderBuffer¶
- class QRhiRenderBuffer¶
Renderbuffer resource.
Details
Renderbuffers cannot be sampled or read but have some benefits over textures in some cases:
A
DepthStencilrenderbuffer 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.Colorrenderbuffers are useful sinceMultisampleRenderBuffermay be supported even whenMultisampleTextureis 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 theUsedWithSwapChainOnlyflag set. This serves a double purpose: such buffers, depending on the backend and the underlying APIs, be more efficient, andQRhiprovides automatic sizing behavior to match the color buffers, which means callingsetPixelSize()andcreate()are not necessary for such renderbuffers.Note
This is a RHI API with limited compatibility guarantees, see
QRhifor details.Added in version 6.6.
Synopsis¶
Methods¶
def
flags()def
pixelSize()def
sampleCount()def
setFlags()def
setPixelSize()def
setSampleCount()def
setType()def
type()
Virtual methods¶
def
backingFormat()def
create()
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 forflags()andsetFlags()Constant
Description
QRhiRenderBuffer.UsedWithSwapChainOnly
For
DepthStencilrenderbuffers this indicates that the renderbuffer is only used in combination with aQRhiSwapChain, and never in any other way. This provides automatic sizing and resource rebuilding, so callingsetPixelSize()orcreate()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 byQSurfaceFormat.
- 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 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(), thendestroy()is called implicitly first.Returns
truewhen successful,falsewhen a graphics operation failed. Regardless of the return value, callingdestroy()is always safe.Returns the flags.
See also
Returns the pixel size.
See also
- sampleCount()¶
- Return type:
int
Returns the sample count. 1 means no multisample antialiasing.
See also
Sets the flags to
f.See also
Sets the size (in pixels) to
sz.See also
- setSampleCount(s)¶
- Parameters:
s – int
Sets the sample count to
s.See also
Sets the type to
t.See also
Returns the renderbuffer type.
See also