From a84a8615c5bacdf264f6b968856f0a358380ed42 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 2 Sep 2022 13:45:48 +0600 Subject: [PATCH] qt_hardwarerenderer: Fix compilation with Qt 5.12 --- src/qt/qt_hardwarerenderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_hardwarerenderer.cpp b/src/qt/qt_hardwarerenderer.cpp index c7a6b0811..809777f37 100644 --- a/src/qt/qt_hardwarerenderer.cpp +++ b/src/qt/qt_hardwarerenderer.cpp @@ -199,7 +199,10 @@ void HardwareRenderer::onBlit(int buf_idx, int x, int y, int w, int h) { return; } m_context->makeCurrent(this); - m_texture->setData(x, y, 0, w, h, 0, QOpenGLTexture::PixelFormat::RGBA, QOpenGLTexture::PixelType::UInt8, (const void*)((uintptr_t)imagebufs[buf_idx].get() + (uintptr_t)(2048 * 4 * y + x * 4)), &m_transferOptions); + m_texture->bind(); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 2048); + glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, QOpenGLTexture::PixelFormat::RGBA, QOpenGLTexture::PixelType::UInt8, (const void*)((uintptr_t)imagebufs[buf_idx].get() + (uintptr_t)(2048 * 4 * y + x * 4))); + m_texture->release(); buf_usage[buf_idx].clear(); source.setRect(x, y, w, h); if (origSource != source) onResize(this->width(), this->height());