teglImageFormatTests: call glFinish after creating the buffer in the client API
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 20 Nov 2017 15:08:51 +0000 (16:08 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 14 Mar 2018 08:02:44 +0000 (04:02 -0400)
According to section 3.7.3.2 (Order of Rendering Operations Between
Contexts) of the EGL spec, the application is responsible for
synchronization between different rendering contexts even in the same
thread.

Some of the tests execute a sequence of operations like this (see
MultiContextRenderTests::init):

1. ctx0: create image
2. ctx0: read from image
3. ctx0: clear image
4. ctx1: recreate image
5. ctx0: read from image
6. ctx1: read from image

This change adds a call to glFinish between steps 4 and 5 that is needed
for correctness. Note that other parts of the same file already call
glFinish, e.g. the various Render actions.

Components: EGL
VK-GL-CTS issue: 857
Affects:
dEQP-EGL.functional.image.render_multiple_contexts.gles2_*_read_pixels

Change-Id: I4dc50f7516374405596653d7006165819b95b6fa

modules/egl/teglImageFormatTests.cpp

index 059262a..3e3c333 100644 (file)
@@ -316,6 +316,9 @@ bool GLES2ImageApi::GLES2Action::invoke (ImageApi& api, MovePtr<UniqueImage>& im
 bool GLES2ImageApi::Create::invokeGLES2 (GLES2ImageApi& api, MovePtr<UniqueImage>& image, tcu::Texture2D& ref) const
 {
        de::UniquePtr<ClientBuffer>     buffer  (m_imgSource->createBuffer(api.m_gl, &ref));
+
+       GLU_CHECK_GLW_CALL(api.m_gl, finish());
+
        image = api.createImage(*m_imgSource, *buffer);
        return true;
 }