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:42:11 +0000 (14:42 -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

modules/egl/teglRobustnessTests.cpp

index a8d37b56487f66147415b0df88a87d6d21eb701c..f43ff7432183f7a3c71963be9712278a24338fa3 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());