1 ------------------------------------------------------------------------- 2 drawElements Quality Program Test Specification 3 ----------------------------------------------- 4 5 Copyright 2014 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 ------------------------------------------------------------------------- 19 Indirect Compute Dispatch 20 21 Tests: 22 + dEQP-GLES31.functional.compute.indirect_dispatch.* 23 24 Includes: 25 + glDispatchComputeIndirect() 26 + Single and multiple dispatch calls from a single buffer 27 + One or several work groups 28 + One or several items per work group 29 + Offsets within buffer 30 + Empty dispatch commands (0 work groups) 31 + Buffers uploaded from application side 32 + Buffers generated using compute shaders 33 - Synchronization with GL_COMMAND_BARRIER_BIT 34 35 Excludes: 36 + Negative tests 37 + Robustness tests 38 39 Description: 40 41 Indirect dispatch tests allocate a buffer and fill it with one or more 42 dispatch commands. In upload_buffer cases commands are written using 43 glBufferData(). In gen_in_compute cases a compute shader is first dispatches, 44 that writes out the commands into the buffer by accessing the command buffer 45 as a SSBO. Memory barrier is issued after the first compute shader in 46 gen_in_compute cases. 47 48 Actual indirect compute tasks use a simple compute shader, that has access to 49 a SSBO with two fields. One is reference work group count (uvec3) and another 50 is output uint field, that is incremented atomically for each invocation, 51 where comparison between gl_NumWorkGroups and the reference count passed. 52 53 Once the command buffer has been generated, one or more indirect dispatch 54 calls are made. SSBO binding offset is adjusted between each call to allocate 55 a different portion of the input/output buffer for each call. After calls have 56 been issued, result buffer is mapped for reading and pass counts are verified. 57 No explicit synchronization call is made prior to mapping the buffer so GL is 58 responsible of synchronizing the tasks. 59