From 6eca6eb123588fab5db7a74718f81575f6b2220b Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 3 Jun 2019 08:07:38 +0200 Subject: GraphicsHelpers: add bindImageTexture support Since GL 4.2 and ES 3.1 Change-Id: I3feaaa6e34b3031121771017763d51ac6ef07687 Reviewed-by: Michael Brasser --- .../graphicshelpergl4/tst_graphicshelpergl4.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3