scene/cursordelegate_opengl: recreate texture if the format is wrong

This commit is contained in:
Xaver Hugl 2023-10-06 22:57:17 +02:00
parent ee05ea7912
commit 7ad1c163a3

View file

@ -41,7 +41,7 @@ void CursorDelegateOpenGL::paint(const RenderTarget &renderTarget, const QRegion
// Render the cursor scene in an offscreen render target.
const QSize bufferSize = (Cursors::self()->currentCursor()->rect().size() * scale).toSize();
if (!m_texture || m_texture->size() != bufferSize) {
if (!m_texture || m_texture->size() != bufferSize || m_texture->internalFormat() != renderTarget.framebuffer()->colorAttachment()->internalFormat()) {
m_texture = GLTexture::allocate(renderTarget.framebuffer()->colorAttachment()->internalFormat(), bufferSize);
if (!m_texture) {
return;