summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@qt.io>2022-06-14 17:37:24 +1000
committerRafael Roquetto <rafael.roquetto@qt.io>2022-06-21 13:56:40 +1000
commitb07ef248f60d620c7710a69507c0627dfaa3f851 (patch)
tree7391c92c87ed0181035d1587174d9ec2a334b8b6
parentf6410082293a78c803ff1ad13117f915f8f9935b (diff)
QNX: fix KHR image handling
Textures previously bound to KHR image sources cannot be reused/bound to a newly created KHR image - at least not on QNX. Ensure that a new texture is created before binding a new KHR image. Change-Id: I1b02034336e5685bb9836a79433ef63f5d8c855f Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> (cherry picked from commit 21dad3632dec5e5ea7c9d45bba927aba2b8e23ea) Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
-rw-r--r--src/plugins/qnx/common/windowgrabber.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/qnx/common/windowgrabber.cpp b/src/plugins/qnx/common/windowgrabber.cpp
index eeef20795..305652073 100644
--- a/src/plugins/qnx/common/windowgrabber.cpp
+++ b/src/plugins/qnx/common/windowgrabber.cpp
@@ -393,8 +393,12 @@ GLuint
WindowGrabberImage::getTexture(screen_window_t window, const QSize &size)
{
if (size != m_size) {
- if (!m_glTexture)
- glGenTextures(1, &m_glTexture);
+ // create a brand new texture to be the KHR image sibling, as
+ // previously used textures cannot be reused with new KHR image
+ // sources - note that glDeleteTextures handles nullptr gracefully
+ glDeleteTextures(1, &m_glTexture);
+ glGenTextures(1, &m_glTexture);
+
glBindTexture(GL_TEXTURE_2D, m_glTexture);
if (m_eglImage) {
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, 0);