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 Shader Shared Variable Tests 20 21Tests: 22 + dEQP-GLES31.functional.compute.shared_var.* 23 24Includes: 25 + All basic types, all precisions 26 + Single shared variable 27 + Various work group sizes 28 - 2x1x3 in basic type cases 29 - 1x1x1, 64x1x1, 1x64x1, 1x1x64, 256x1x1, 1x256x1, 17x5x9 for selected types 30 + All built-in atomic operation functions 31 + int, uint types 32 + all precisions 33 + Multiple work groups for atomic function cases 34 35Excludes: 36 + Multiple shared variables 37 + Complex types (arrays, structures) 38 + Negative tests 39 40Description: 41 42Basic type test cases declare a single shared variable of the appropriate 43type. In addition following input/output variables are used: 44 + buffer block containing an array of booleans, one for each item in work group 45 + u_val[], u_ref[] uniform arrays, filled with identical values 46 + u_numIters iteration count uniform, initialized with work group size 47 48The compute shader contains a loop that is limited by the u_numIters uniform. 49In each iteration one of the work items writes a value from u_val to the 50shared variable. A shared memory barrier is issued, and after that all work 51items read and compare shared var value to u_ref. If comparison passed for all 52iterations, true is set to appropriate element of the output array. Test case 53then maps the output SSBO and checks that all elements are true, meaning that 54all shader invocations passed the test. 55 56 57Atomic operation test cases issue multiple work groups of size 3x2x1. In each 58work group first invocation initializes shared variable to a certain value. 59Barrier is issued and after that each invocation issues atomic operation with 60per-invocation value. Resulting values are written out into SSBO. Finally, one 61invocation per work group writes out the final shared variable value. 62 63Resulting values from SSBO are read using buffer mapping and verified. The 64input values and validation logic depends on the type of the atomic operation. 65