diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-24 15:28:20 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-25 01:04:07 +0100 |
commit | 406bb6ae20471cf9bba6d910256b416792c99322 (patch) | |
tree | 39c7e88a17f715ec1d2dafb090f77ee2caae4d4f /src/gui/rhi/qrhi.cpp | |
parent | 4b6064aef434baf7e382b3994f046a2f96fa7111 (diff) |
rhi: Make sure pixelSize() to a texture rt is always up to date
This is an issue for QQuickWindow in practice, although it is not hit
by our current tests.
Pick-to: 6.3
Change-Id: Ia73704c1af6a82b2689ce7b844d3b0eb9a17ec18
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 452a39642f..8196d107fe 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -2929,6 +2929,18 @@ QRhiResource::Type QRhiRenderTarget::resourceType() const \fn QSize QRhiRenderTarget::pixelSize() const \return the size in pixels. + + 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. */ /*! |