glspirv: don't cause aborted test runs.
authorKarol Herbst <kherbst@redhat.com>
Mon, 27 Apr 2020 11:07:17 +0000 (13:07 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 6 Aug 2020 08:27:07 +0000 (04:27 -0400)
These test also need checks in their deinit, and one missing init function.

Components: OpenGL

VK-GL-CTS Issue: 2498

Affects: KHR-GL45.gl_spirv.spirv_glsl_to_spirv*

Change-Id: I374c0980f68daf418c15b03625e12d4e78271076

external/openglcts/modules/gl/gl4cGlSpirvTests.cpp

index 7b6679c72cd5338479ec03f66f92c2d495985acf..85806e9d0353ab9a5663d3087e590d178251daa7 100644 (file)
@@ -622,6 +622,8 @@ void SpirvModulesPositiveTest::init()
 /** Stub de-init method */
 void SpirvModulesPositiveTest::deinit()
 {
+       if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_gl_spirv"))
+               return;
        const Functions& gl = m_context.getRenderContext().getFunctions();
 
        if (m_fbo)
@@ -796,6 +798,9 @@ SpirvShaderBinaryMultipleShaderObjectsTest::SpirvShaderBinaryMultipleShaderObjec
 /** Stub init method */
 void SpirvShaderBinaryMultipleShaderObjectsTest::init()
 {
+       if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_gl_spirv"))
+               TCU_THROW(NotSupportedError, "GL_ARB_gl_spirv is not supported");
+
        m_spirv = "OpCapability Shader\n"
                          "%1 = OpExtInstImport \"GLSL.std.450\"\n"
                          "OpMemoryModel Logical GLSL450\n"
@@ -1226,6 +1231,9 @@ void SpirvModulesErrorVerificationTest::init()
 /** Stub de-init method */
 void SpirvModulesErrorVerificationTest::deinit()
 {
+       if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_gl_spirv"))
+               return;
+
        const Functions& gl = m_context.getRenderContext().getFunctions();
 
        gl.deleteTextures(1, &m_textureId);
@@ -2378,6 +2386,8 @@ void SpirvGlslToSpirVSpecializationConstantsTest::init()
 /** Stub de-init method */
 void SpirvGlslToSpirVSpecializationConstantsTest::deinit()
 {
+       if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_gl_spirv"))
+               return;
        const Functions& gl = m_context.getRenderContext().getFunctions();
 
        if (m_fbo)