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-16 14:39:17 +1000
commit20ee1a9c13eb24e30f620db9369296d78c318137 (patch)
tree1636b230cf186d0eda29612be38b930f99ad65ce
parent779f1f019fae638fe1ce51c318d677f0b447c68c (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. (cherry picked from commit 21dad3632dec5e5ea7c9d45bba927aba2b8e23ea) Change-Id: I7bf8da631debcd44b8e42bd23bc5043372e3536f Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
-rw-r--r--src/multimedia/platform/qnx/common/windowgrabber.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/multimedia/platform/qnx/common/windowgrabber.cpp b/src/multimedia/platform/qnx/common/windowgrabber.cpp
index e4c8c926d..77588a7a8 100644
--- a/src/multimedia/platform/qnx/common/windowgrabber.cpp
+++ b/src/multimedia/platform/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);