Skip OOB SSBO fragment tests for ES3.1 GPUs
authorAlexander Galazin <alexander.galazin@arm.com>
Fri, 9 Jun 2017 14:26:32 +0000 (16:26 +0200)
committerPyry Haulos <phaulos@google.com>
Fri, 9 Jun 2017 21:43:41 +0000 (14:43 -0700)
GPUs supporting GLES 3.1 may expose 0 SSBOs in fragment shaders.
This change extends fix made in cf65c56f.

Google bug: 36891454

Components: AOSP

Affects:
dEQP-EGL.functional.robustness.reset_context.shaders.out_of_bounds*.shader_storage_block.fragment

Change-Id: I1d821198d3dba3d3ad1e6b25758d0d434bf08a30
(cherry picked from commit f5fc3c8409969bb0afc5487f82ed883cf6566896)

modules/egl/teglRobustnessTests.cpp

index a8d37b5..f43ff74 100644 (file)
@@ -1277,15 +1277,17 @@ glu::ProgramSources ShadersOOB::genSources (void)
 
 void ShadersOOB::setup (void)
 {
-       if (!m_isUBO && !m_isLocalArray && (m_shaderType == SHADERTYPE_VERT || m_shaderType == SHADERTYPE_VERT_AND_FRAG))
+       if (!m_isUBO && !m_isLocalArray && (m_shaderType != SHADERTYPE_COMPUTE))
        {
-               // Check implementation limits for vertex shader SSBO
-               int vertexShaderStorageBlockSupported = -1;
+               // Check implementation limits for shader SSBO
+               int shaderStorageBlockSupported = -1;
+               const bool isVertex = (m_shaderType == SHADERTYPE_VERT || m_shaderType == SHADERTYPE_VERT_AND_FRAG) ? true : false;
+               string shaderTypeStr = isVertex ? "GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS" : "GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS";
 
-               GLU_CHECK_GLW_CALL(m_gl, getIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &vertexShaderStorageBlockSupported));
+               GLU_CHECK_GLW_CALL(m_gl, getIntegerv(isVertex ? GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS : GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, &shaderStorageBlockSupported));
 
-               if (vertexShaderStorageBlockSupported < (int)m_buffers.size())
-                       TCU_THROW(NotSupportedError, ("Test requires GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS >= " + de::toString((int)m_buffers.size()) + ", got " + de::toString(vertexShaderStorageBlockSupported)).c_str());
+               if (shaderStorageBlockSupported < (int)m_buffers.size())
+                       TCU_THROW(NotSupportedError, ("Test requires " + shaderTypeStr + " >= " + de::toString((int)m_buffers.size()) + ", got " + de::toString(shaderStorageBlockSupported)).c_str());
        }
 
        glu::ShaderProgram program(m_gl, genSources());