diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2019-01-21 10:06:49 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2019-08-13 11:56:10 +0200 |
commit | 43d8a3091894ceb4ab934167b2f3eda27564eb6d (patch) | |
tree | 67739f82b8ed86ad92fa7f3ee0005ce86edf8aaf /src/compositor/hardware_integration | |
parent | 3d5cec736ce17c6b40c52bb8966f8fc40b742664 (diff) |
Backport texture sharing for NVIDIA
This commit backports the Vulkan server buffer and texture sharing code
from Qt 5.14 to Qt 5.12 as an opt-in feature. To enable, configure with
"-feature-wayland-client-texture-sharing-experimental
-feature-wayland-compositor-texture-sharing-experimental"
Contains code from the following commits:
Add server buffer integration based on Vulkan
(commit df3a1761af2f20d59ae09a7adaa2f5b959047687)
Compressed texture support for vulkan server buffers
(commit f710489a341713c675cfd91d22ccd7bf8f29f4dd)
Implement server-side toOpenGlTexture for Vulkan
(commit 19361e7259f04b08925b1e8e99faf9460770ee7b)
New texture sharing protocol and infrastructure
(commit 80001cbf0451f4ba2a971fb20b80dc8e25ac604d)
Change-Id: I6c36ef7fddcd4db39e80d03a822d89f15eae3434
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/compositor/hardware_integration')
-rw-r--r-- | src/compositor/hardware_integration/qwlserverbufferintegration_p.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h index 7d8901d58..b8d9fa99d 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h @@ -55,8 +55,7 @@ #include <QtCore/QSize> #include <QtGui/qopengl.h> -#include <QtWaylandCompositor/qtwaylandcompositorglobal.h> - +#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h> struct wl_client; struct wl_resource; @@ -75,7 +74,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ServerBuffer public: enum Format { RGBA32, - A8 + A8, + Custom }; ServerBuffer(const QSize &size, ServerBuffer::Format format); @@ -85,7 +85,9 @@ public: virtual bool bufferInUse() { return true; } virtual QOpenGLTexture *toOpenGlTexture() = 0; - +#if QT_CONFIG(wayland_compositor_texture_sharing_experimental) + virtual void releaseOpenGlTexture() {} +#endif virtual bool isYInverted() const; QSize size() const; @@ -105,6 +107,15 @@ public: virtual bool supportsFormat(ServerBuffer::Format format) const = 0; virtual ServerBuffer *createServerBufferFromImage(const QImage &qimage, ServerBuffer::Format format) = 0; +#if QT_CONFIG(wayland_compositor_texture_sharing_experimental) + virtual ServerBuffer *createServerBufferFromData(const QByteArray &data, const QSize &size, uint glInternalFormat) + { + Q_UNUSED(data); + Q_UNUSED(size); + Q_UNUSED(glInternalFormat); + return nullptr; + } +#endif }; } |