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