From: Andy Candet Date: Sat, 16 Apr 2022 20:16:53 +0000 (+0100) Subject: Fix extension checks for EGL external image tests X-Git-Tag: upstream/1.3.5~74^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4da49ff09b5199798eb246b80aacdb9c09949587;p=platform%2Fupstream%2FVK-GL-CTS.git Fix extension checks for EGL external image tests Commit 2090c97 extended dEQP-EGL.functional.image.modify.* with new actions to test sampling from an external image. The actions implement getRequiredExtension, so they were likely intended to be skipped if GL_OES_EGL_image_external is not available. However, extension checks are only performed for actions invoked through ImageFormatCase. These actions are invoked one level down the call stack, through RenderTryAll. The result is that 22 tests in dEQP-EGL.functional.image.modify.* fail during shader compilation if the extension is not available. This commit adds an extension check to RenderTryAll::invokeGLES. Actions will be skipped if the check fails. This is probably what was intended in the first place, since RenderTryAll ignores NotSupported results. Affects: dEQP-EGL.functional.image.modify.* Components: EGL Change-Id: Id1106d69fbe71d39695fc32513d80d23f1e94b40 --- diff --git a/modules/egl/teglImageFormatTests.cpp b/modules/egl/teglImageFormatTests.cpp index 218eaf2..c900381 100644 --- a/modules/egl/teglImageFormatTests.cpp +++ b/modules/egl/teglImageFormatTests.cpp @@ -421,6 +421,36 @@ static void framebufferRenderbuffer (const glw::Functions& gl, GLenum attachment ("EGLImage as " + string(glu::getFramebufferAttachmentName(attachment)) + " not supported").c_str()); } +static set getSupportedExtensions (tcu::TestLog& log, const Library& egl, const EGLDisplay dpy, const glw::Functions gl) +{ + set exts; + const vector glExts = de::splitString((const char*) gl.getString(GL_EXTENSIONS)); + const vector eglExts = eglu::getDisplayExtensions(egl, dpy); + + exts.insert(glExts.begin(), glExts.end()); + exts.insert(eglExts.begin(), eglExts.end()); + + if (eglu::getVersion(egl, dpy) >= eglu::Version(1, 5)) + { + // EGL 1.5 has built-in support for EGLImage and GL sources + exts.insert("EGL_KHR_image_base"); + exts.insert("EGL_KHR_gl_texture_2D_image"); + exts.insert("EGL_KHR_gl_texture_cubemap_image"); + exts.insert("EGL_KHR_gl_renderbuffer_image"); + } + + if (!de::contains(exts, "EGL_KHR_image_base") && !de::contains(exts, "EGL_KHR_image")) + { + log << tcu::TestLog::Message + << "EGL version is under 1.5 and neither EGL_KHR_image nor EGL_KHR_image_base is supported." + << "One should be supported." + << tcu::TestLog::EndMessage; + TCU_THROW(NotSupportedError, "Extension not supported: EGL_KHR_image_base"); + } + + return exts; +} + static const float squareTriangleCoords[] = { -1.0, -1.0, @@ -1205,11 +1235,17 @@ bool GLESImageApi::RenderTryAll::invokeGLES (GLESImageApi& api, MovePtr exts = getSupportedExtensions(log, api.m_egl, api.m_display, api.m_gl); for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(actions); ++ndx) { try { + const string ext = actions[ndx]->getRequiredExtension(); + + if (!de::contains(exts, ext)) + TCU_THROW_EXPR(NotSupportedError, "Extension not supported", ext.c_str()); + if (!actions[ndx]->invoke(api, img, reference)) return false; @@ -1387,32 +1423,7 @@ ImageFormatCase::~ImageFormatCase (void) void ImageFormatCase::checkExtensions (void) { - const Library& egl = m_eglTestCtx.getLibrary(); - const EGLDisplay dpy = m_display; - set exts; - const vector glExts = de::splitString((const char*) m_gl.getString(GL_EXTENSIONS)); - const vector eglExts = eglu::getDisplayExtensions(egl, dpy); - - exts.insert(glExts.begin(), glExts.end()); - exts.insert(eglExts.begin(), eglExts.end()); - - if (eglu::getVersion(egl, dpy) >= eglu::Version(1, 5)) - { - // EGL 1.5 has built-in support for EGLImage and GL sources - exts.insert("EGL_KHR_image_base"); - exts.insert("EGL_KHR_gl_texture_2D_image"); - exts.insert("EGL_KHR_gl_texture_cubemap_image"); - exts.insert("EGL_KHR_gl_renderbuffer_image"); - } - - if (!de::contains(exts, "EGL_KHR_image_base") && !de::contains(exts, "EGL_KHR_image")) - { - getLog() << tcu::TestLog::Message - << "EGL version is under 1.5 and neither EGL_KHR_image nor EGL_KHR_image_base is supported." - << "One should be supported." - << tcu::TestLog::EndMessage; - TCU_THROW(NotSupportedError, "Extension not supported: EGL_KHR_image_base"); - } + set exts = getSupportedExtensions(getLog(), m_eglTestCtx.getLibrary(), m_display, m_gl); for (int operationNdx = 0; operationNdx < (int)m_spec.operations.size(); operationNdx++) {