1------------------------------------------------------------------------- 2drawElements Quality Program Test Specification 3----------------------------------------------- 4 5Copyright 2014 The Android Open Source Project 6 7Licensed under the Apache License, Version 2.0 (the "License"); 8you may not use this file except in compliance with the License. 9You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13Unless required by applicable law or agreed to in writing, software 14distributed under the License is distributed on an "AS IS" BASIS, 15WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16See the License for the specific language governing permissions and 17limitations under the License. 18------------------------------------------------------------------------- 19 Uniform Buffer Object tests 20 21Tests: 22 + dEQP-GLES3.functional.ubo.* 23 + dEQP-GLES3.functional.shaders.linkage.uniform_block* 24 + dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block* 25 26Includes: 27 + Basic uniform buffer object usage 28 - Binding and unbinding uniform buffers 29 - Writing uniform buffer data with glBufferData() 30 + Binding uniform buffers to uniform blocks 31 - glBindBufferRange() 32 - glBindBufferBase() 33 - glUniformBlockBinding() 34 + Querying uniform block memory layout 35 + std140 memory layout 36 + Uniform blocks GLSL 37 - Basic scalar, vector and matrix types in uniform blocks 38 - Samplers in uniform blocks - as negative case! 39 - Structures and arrays in uniform blocks 40 - Uniform block instance names 41 - Uniform block arrays 42 - Layout qualifiers: shared, packed, std140, row_major, column_major 43 - Negative tests for syntax and semantic errors in declarations 44 - Negative tests for uniform block linking 45 - Unused uniforms in uniform blocks 46 + Sharing uniform blocks between vertex and fragment shaders 47 48Excludes: 49 + Mapping uniform buffers 50 - Will be covered in buffer mapping tests 51 + Negative tests for uniform buffer API 52 - Will be covered in negative API tests 53 54Description: 55 56Uniform block tests define a set of uniforms and uniform blocks. In addition two 57subsets are computed: uniforms accessed from vertex shader and uniforms accessed 58from fragment shader respectively. The uniform sets are either specified manually 59or choosen randomly. Values for each uniform are choosen. 60 61Shaders are generated based on uniform declarations and use set. Each uniform that 62is in "used set" is read and compared against expected value in the shader. Final 63result is a boolean value: true if all uniforms contained expected values and false 64otherwise. Vertex shader result controls green channel: output is 1 if values were 65correct and 0 otherwise. Fragment shader result controls blue channel in the same 66manner. 67 68Shaders are compiled and linked together. Uniform block layout is queried and 69values are stored into one or more uniform buffers. If std140 memory layout is used, 70a reference memory layout is used instead and queries are made to validate the 71layout computed by implementation prior to issuing any draw calls. 72 73A single quad consisting of two triangles is rendered and resulting framebuffer 74pixels are checked. If all pixels are white and uniform layout queries didn't 75return any unexpected values or errors, test case passes. 76 77Negative tests for compiler and linker use a pair of hand-written shaders. Compile 78or link is verified to return failure. 79