diff options
author | Kristoffer Skau <kristoffer.skau@qt.io> | 2022-10-27 15:38:53 +0200 |
---|---|---|
committer | Kristoffer Skau <kristoffer.skau@qt.io> | 2022-11-28 19:12:27 +0100 |
commit | ee2dbcada81f5220a05414d7bf9d5eeebdda8972 (patch) | |
tree | 2bca1fc0c3569a98f26a0717d9e555a9b88f2364 /src/gui/rhi | |
parent | 8155bd54261688f333b2d68e2d76f0fc076a0fb4 (diff) |
Add support for stereoscopic content in QOpenGLWidget
Need to add the plumbing necessary to support two textures in
QOpenGLWidget and use these in the backing store. The changes
required on the RHI level is already done in an earlier patch.
Then paintGL() needs to be called twice, once for each buffer.
Also add overloads for the other functions of QOopenGLWidget
where it makes sense to query for left or right buffer.
Then finally create an example.
[ChangeLog][Widgets][QOpenGLWidget] Added support for
stereoscopic rendering.
Fixes: QTBUG-64587
Change-Id: I5a5c53506dcf8a56442097290dceb7eb730d50ce
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 79c7c96158..ccb6db445b 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -4883,18 +4883,18 @@ QRhiResource::Type QRhiSwapChain::resourceType() const is backed by two color buffers, one for each eye, instead of just one. When stereoscopic rendering is not supported, the return value will be - null. For the time being the only backend and 3D API where traditional + the default target. For the time being the only backend and 3D API where traditional stereoscopic rendering is supported is OpenGL (excluding OpenGL ES), in combination with \l QSurfaceFormat::StereoBuffers, assuming it is supported by the graphics and display driver stack at run time. All other backends - are going to return null from this overload. + are going to return the default render target from this overload. \note the value must not be cached and reused between frames */ QRhiRenderTarget *QRhiSwapChain::currentFrameRenderTarget(StereoTargetBuffer targetBuffer) { Q_UNUSED(targetBuffer); - return nullptr; + return currentFrameRenderTarget(); } /*! |