summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-08-07 20:22:51 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-08-14 12:55:08 +0200
commit959ff0d378c8d31216a70bf38726deac3c7051ff (patch)
tree5124b3248a4cb93ea7816b027e4a173e4f7f321a /src/gui
parent0a36001a13833dc8e1e1e6a51a20d0f8a7373a9c (diff)
rhi: gl: Fix broken bgra textures on GLES
Switching TexImage2D to the sized internal format was a bad idea. Go with what we do without the RHI in QtGui and elsewhere, and just pass the unsized GL_RGBA or GL_BGRA. Change-Id: I8216c0e49813355fa5e2594b24f06c64bc8e3873 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/rhi/qrhigles2.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index 0d7f8224af..eabc550447 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -3115,18 +3115,19 @@ bool QGles2Texture::build()
for (int layer = 0, layerCount = isCube ? 6 : 1; layer != layerCount; ++layer) {
for (int level = 0; level != mipLevelCount; ++level) {
const QSize mipSize = rhiD->q->sizeForMipLevel(level, size);
- rhiD->f->glTexImage2D(faceTargetBase + layer, level, glsizedintformat,
+ rhiD->f->glTexImage2D(faceTargetBase + layer, level, glintformat,
mipSize.width(), mipSize.height(), 0,
glformat, gltype, nullptr);
}
}
} else {
- rhiD->f->glTexImage2D(target, 0, glsizedintformat, size.width(), size.height(),
+ rhiD->f->glTexImage2D(target, 0, glintformat, size.width(), size.height(),
0, glformat, gltype, nullptr);
}
} else {
// Must be specified with immutable storage functions otherwise
- // bindImageTexture may fail.
+ // bindImageTexture may fail. Also, the internal format must be a
+ // sized format here.
rhiD->f->glTexStorage2D(target, mipLevelCount, glsizedintformat, size.width(), size.height());
}
specified = true;