summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2019-06-03 08:07:38 +0200
committerPaul Lemire <paul.lemire@kdab.com>2019-06-04 14:53:15 +0200
commit6eca6eb123588fab5db7a74718f81575f6b2220b (patch)
treebb8f9bc73b328232e8030bb4fd15cfabe84386d4 /tests
parentdd1d8f51e67ec93031fdd7f7930d63761d1238e6 (diff)
GraphicsHelpers: add bindImageTexture support
Since GL 4.2 and ES 3.1 Change-Id: I3feaaa6e34b3031121771017763d51ac6ef07687 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp b/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp
index a1d1b8ff3..8fb2dbc01 100644
--- a/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp
+++ b/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp
@@ -494,6 +494,37 @@ private Q_SLOTS:
m_func->glDeleteFramebuffers(1, &fboId);
}
+ void bindImageTexture()
+ {
+ if (!m_initializationSuccessful)
+ QSKIP("Initialization failed, OpenGL 4.3 Core functions not supported");
+
+ // GIVEN
+ QOpenGLTexture texture(QOpenGLTexture::Target2D);
+ texture.setSize(512, 512);
+ texture.setFormat(QOpenGLTexture::RGBA8U);
+ texture.setMinificationFilter(QOpenGLTexture::Linear);
+ texture.setMagnificationFilter(QOpenGLTexture::Linear);
+ texture.create();
+ texture.allocateStorage();
+
+ // THEN
+ QVERIFY(texture.textureId() != 0 && texture.isCreated() && texture.isStorageAllocated());
+
+ // WHEN
+ m_glHelper.bindImageTexture(0,
+ texture.textureId(),
+ 0,
+ GL_FALSE,
+ 0,
+ GL_READ_WRITE,
+ GL_RGBA8UI);
+
+ // THEN
+ GLint error = m_func->glGetError();
+ QVERIFY(error == 0);
+ }
+
void bindShaderStorageBlock()
{
if (!m_initializationSuccessful)