From c213f287b15d26a38335c96884c2497f9015973a Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Mar 2022 14:45:28 +0600 Subject: [PATCH 1/5] qt: Fix loading of shaders using GL_ARB_shading_language_420pack extension --- src/qt/qt_opengloptions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_opengloptions.cpp b/src/qt/qt_opengloptions.cpp index 26b8f05fe..95f13f2df 100644 --- a/src/qt/qt_opengloptions.cpp +++ b/src/qt/qt_opengloptions.cpp @@ -183,10 +183,10 @@ OpenGLOptions::addShader(const QString &path) .toStdString()); }; - if (!shader->addShaderFromSourceCode(QOpenGLShader::Vertex, version_line % "\n#define VERTEX\n" % shader_text)) + if (!shader->addShaderFromSourceCode(QOpenGLShader::Vertex, version_line % "\n#extension GL_ARB_shading_language_420pack : enable\n" % "\n#define VERTEX\n" % shader_text)) throw_shader_error(tr("Error compiling vertex shader in file \"%1\"")); - if (!shader->addShaderFromSourceCode(QOpenGLShader::Fragment, version_line % "\n#define FRAGMENT\n" % shader_text)) + if (!shader->addShaderFromSourceCode(QOpenGLShader::Fragment, version_line % "\n#extension GL_ARB_shading_language_420pack : enable\n" "\n#define FRAGMENT\n" % shader_text)) throw_shader_error(tr("Error compiling fragment shader in file \"%1\"")); if (!shader->link()) From c1c0f68f81e6733c328978c180854b91379d2299 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Mar 2022 14:48:33 +0600 Subject: [PATCH 2/5] qt: Make central widget expanding --- src/qt/qt_mainwindow.ui | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_mainwindow.ui b/src/qt/qt_mainwindow.ui index 69197d015..60b77d290 100644 --- a/src/qt/qt_mainwindow.ui +++ b/src/qt/qt_mainwindow.ui @@ -15,7 +15,7 @@ - + 0 0 @@ -37,7 +37,14 @@ 0 - + + + + 0 + 0 + + + From ed954e4b2f59720fea71a2737e003899e3232585 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Mar 2022 15:08:14 +0600 Subject: [PATCH 3/5] qt: Fix HiDPI scaling on OpenGL 3.0 renderer --- src/qt/qt_openglrenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 173e82448..2ba45f081 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -87,8 +87,8 @@ OpenGLRenderer::resizeEvent(QResizeEvent *event) glViewport( destination.x(), destination.y(), - destination.width(), - destination.height()); + destination.width() * devicePixelRatio(), + destination.height() * devicePixelRatio()); } bool From 445ebb905f063c0488985b7ac948ad303ab1d885 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Mar 2022 15:08:41 +0600 Subject: [PATCH 4/5] qt: More Settings UI inconsistency-with-Win32 fixes --- src/qt/qt_settingsmachine.ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/qt_settingsmachine.ui b/src/qt/qt_settingsmachine.ui index fabb52fe9..30f375f7e 100644 --- a/src/qt/qt_settingsmachine.ui +++ b/src/qt/qt_settingsmachine.ui @@ -202,6 +202,12 @@ + + + 0 + 0 + + Time synchronization From 9da55289ed0c2579c86afef3e66292df59909a20 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Wed, 2 Mar 2022 15:14:17 +0600 Subject: [PATCH 5/5] qt: Fix building on AArch32 --- src/qt/qt_openglrenderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 2ba45f081..eb5656d3b 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -372,7 +373,7 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h) /* Resize the texture */ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, source.width(), source.height(), 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, (GLenum)QOpenGLTexture::RGBA8_UNorm, source.width(), source.height(), 0, (GLenum)QOpenGLTexture::BGRA, (GLenum)QOpenGLTexture::UInt32_RGBA8_Rev, NULL); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, unpackBufferID); } @@ -381,7 +382,7 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h) glPixelStorei(GL_UNPACK_SKIP_PIXELS, BUFFERPIXELS * buf_idx + y * ROW_LENGTH + x); glPixelStorei(GL_UNPACK_ROW_LENGTH, ROW_LENGTH); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, (GLenum)QOpenGLTexture::BGRA, (GLenum)QOpenGLTexture::UInt32_RGBA8_Rev, NULL); /* TODO: check if fence sync is implementable here and still has any benefit. */ glFinish();