dEQP-GLES31.functional.ssbo.layout.random.*: Add check for
authorJames Glanville <james.glanville@imgtec.com>
Tue, 12 Feb 2019 14:47:41 +0000 (14:47 +0000)
committerChris Forbes <chrisforbes@google.com>
Thu, 11 Apr 2019 14:13:29 +0000 (07:13 -0700)
GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS

Commit 237916d03377a469e30dd36087738b069f83a19a
(gles31:es31fSSBOLayoutTests limit m_maxBlocks and m_maxBlockMembers
for low ram device) disturbs the random number generator for this set
of tests.

This causes:

dEQP-GLES31.functional.ssbo.layout.random.all_per_block_buffers.45

to require implementation support for 9 SSBO binding points, more
than the spec requires.

Fixed by adding check for GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS and
marking this test as unsupported

Bug: b/125134085
Change-Id: I17dc2063675ace06bc7e7763cff8bd46bd397b8c
(cherry picked from commit feb932cf5c3f5d9115c86073693d859667a81361)

modules/gles31/functional/es31fSSBOLayoutCase.cpp

index 226c9eb..a9e0e6e 100644 (file)
@@ -1282,12 +1282,15 @@ void generateWriteSrc (std::ostream& src, const ShaderInterface& interface, cons
        }
 }
 
-string generateComputeShader (glu::GLSLVersion glslVersion, const ShaderInterface& interface, const BufferLayout& layout, const vector<BlockDataPtr>& comparePtrs, const vector<BlockDataPtr>& writePtrs)
+string generateComputeShader (const glw::Functions& gl, glu::GLSLVersion glslVersion, const ShaderInterface& interface, const BufferLayout& layout, const vector<BlockDataPtr>& comparePtrs, const vector<BlockDataPtr>& writePtrs)
 {
        std::ostringstream src;
+       glw::GLint maxShaderStorageBufferBindings;
 
        DE_ASSERT(glslVersion == glu::GLSL_VERSION_310_ES || glslVersion == glu::GLSL_VERSION_430);
 
+       gl.getIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings);
+
        src << glu::getGLSLVersionDeclaration(glslVersion) << "\n";
        src << "layout(local_size_x = 1) in;\n";
        src << "\n";
@@ -1307,6 +1310,11 @@ string generateComputeShader (glu::GLSLVersion glslVersion, const ShaderInterfac
 
                        bindingPoint += block.isArray() ? block.getArraySize() : 1;
                }
+
+               if (bindingPoint > maxShaderStorageBufferBindings)
+               {
+                       throw tcu::NotSupportedError("Test requires support for more SSBO bindings than implementation exposes");
+               }
        }
 
        // Atomic counter for counting passed invocations.
@@ -2109,7 +2117,7 @@ SSBOLayoutCase::IterateResult SSBOLayoutCase::iterate (void)
        generateValues                  (refLayout, writeData.pointers, deStringHash(getName()) ^ 0x25ca4e7);
        copyNonWrittenData              (m_interface, refLayout, initialData.pointers, writeData.pointers);
 
-       const glu::ShaderProgram program(m_renderCtx, glu::ProgramSources() << glu::ComputeSource(generateComputeShader(m_glslVersion, m_interface, refLayout, initialData.pointers, writeData.pointers)));
+       const glu::ShaderProgram program(m_renderCtx, glu::ProgramSources() << glu::ComputeSource(generateComputeShader(gl, m_glslVersion, m_interface, refLayout, initialData.pointers, writeData.pointers)));
        log << program;
 
        if (!program.isOk())