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    Long-running stress tests
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ciTests:
22e5c31af7Sopenharmony_ci + dEQP-GLES2.stress.long.*
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ciIncludes:
25e5c31af7Sopenharmony_ci + Long-running stress testing with various application behaviors
26e5c31af7Sopenharmony_ci + Memory object handling
27e5c31af7Sopenharmony_ci   - Buffers and textures
28e5c31af7Sopenharmony_ci   - Allocation, uploading
29e5c31af7Sopenharmony_ci + Shader program
30e5c31af7Sopenharmony_ci   - Switching between several programs
31e5c31af7Sopenharmony_ci   - Re-compile frequently
32e5c31af7Sopenharmony_ci + Draw calls
33e5c31af7Sopenharmony_ci   - Client-memory data for vertex indices and attributes
34e5c31af7Sopenharmony_ci   - Big draw calls
35e5c31af7Sopenharmony_ci
36e5c31af7Sopenharmony_ciExcludes:
37e5c31af7Sopenharmony_ci + Functional verification
38e5c31af7Sopenharmony_ci
39e5c31af7Sopenharmony_ciDescription:
40e5c31af7Sopenharmony_ci
41e5c31af7Sopenharmony_ciThe long-running stress tests are meant to be run for a long time to detect
42e5c31af7Sopenharmony_cideterioration (e.g. crash) in the program's behavior. The tests are supposed
43e5c31af7Sopenharmony_cito be run with the command-line tools instead of Candy. The test case uses
44e5c31af7Sopenharmony_cithe --deqp-test-iteration-count=<num> command line option to choose the number
45e5c31af7Sopenharmony_ciof iterations it runs; this should be set to either a very big number, or
46e5c31af7Sopenharmony_cialternatively a negative number, in which case it runs indefinitely. When
47e5c31af7Sopenharmony_cithis option is not given, the number of iterations is only 5; this is only
48e5c31af7Sopenharmony_ciuseful to check that the test case's basic requisites are fulfilled (e.g.
49e5c31af7Sopenharmony_cithat its shader programs compile successfully).
50e5c31af7Sopenharmony_ci
51e5c31af7Sopenharmony_ciThe basic structure of one iteration of the stress cases is as follows.
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ciFirst, if the case uses more than one program, it randomly picks one of them
54e5c31af7Sopenharmony_cias the program for the current iteration. It then chooses whether or not to
55e5c31af7Sopenharmony_cire-compile the program if it hasn't yet been compiled. When a program is re-
56e5c31af7Sopenharmony_cicompiled, attribute, uniform and varying names in the shader sources may
57e5c31af7Sopenharmony_cibe mangled with a unique suffix, thus attempting to avoid shader caching.
58e5c31af7Sopenharmony_ci
59e5c31af7Sopenharmony_ciNext, the textures used by the program are generated and uploaded or, if
60e5c31af7Sopenharmony_cithey already exist, they may be re-uploaded with either glTexImage*() or
61e5c31af7Sopenharmony_ciglTexSubImage*(). Texture parameters (wrapping etc.) are also set.
62e5c31af7Sopenharmony_ci
63e5c31af7Sopenharmony_ciThen, buffers are generated and (re-)uploaded in a manner similar to that of
64e5c31af7Sopenharmony_cithe textures described above. The buffers that may be used are vertex index
65e5c31af7Sopenharmony_ciand attribute buffers. If, however, the case decides to use client-side memory
66e5c31af7Sopenharmony_cifor index or attribute data, the respective buffer is not created.
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ciNext, the program's uniforms are set, and a case-dependent amount of primitives
69e5c31af7Sopenharmony_ciis drawn (note that this amount also affects the size of the buffers). This is
70e5c31af7Sopenharmony_cirepeated for a case-dependent number of times. The draw command used can be
71e5c31af7Sopenharmony_cieither glDrawElements() or glDrawArrays().
72e5c31af7Sopenharmony_ci
73e5c31af7Sopenharmony_ciAfter drawing, the case may delete some textures and/or buffers.
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ciThis concludes an iteration. Between iterations, the usual post-iteration
76e5c31af7Sopenharmony_cioperations are done by the framework; this generally contains draw buffer
77e5c31af7Sopenharmony_ciswapping.
78e5c31af7Sopenharmony_ci
79e5c31af7Sopenharmony_ciA stress case's behavior is determined by its parameters:
80e5c31af7Sopenharmony_ci + Program context(s)
81e5c31af7Sopenharmony_ci   - Vertex and fragment shader sources
82e5c31af7Sopenharmony_ci   - Value ranges for each attribute and uniform
83e5c31af7Sopenharmony_ci   - Texture information (size, format etc.)
84e5c31af7Sopenharmony_ci + Approximate GPU memory usage limits that the case shouldn't exceed
85e5c31af7Sopenharmony_ci   - Texture memory
86e5c31af7Sopenharmony_ci   - Buffer memory
87e5c31af7Sopenharmony_ci + Number of draw calls per iteration
88e5c31af7Sopenharmony_ci + Number of triangles per draw call
89e5c31af7Sopenharmony_ci + A set of probabilities that enable the following per-iteration actions:
90e5c31af7Sopenharmony_ci   - Re-build program
91e5c31af7Sopenharmony_ci   - Re-upload texture
92e5c31af7Sopenharmony_ci   - Re-upload buffer
93e5c31af7Sopenharmony_ci   - When re-uploading texture, use glTexImage*() instead of glTexSubImage*()
94e5c31af7Sopenharmony_ci   - When re-uploading buffer, use glBufferData() instead of glBufferSubData()
95e5c31af7Sopenharmony_ci   - Delete texture at end of iteration
96e5c31af7Sopenharmony_ci   - Delete buffer at end of iteration
97e5c31af7Sopenharmony_ci   - Don't re-use texture, but delay its deletion until memory limit is hit
98e5c31af7Sopenharmony_ci   - Don't re-use buffer, but delay its deletion until memory limit is hit
99e5c31af7Sopenharmony_ci   - Use random 'target' argument when uploading buffer
100e5c31af7Sopenharmony_ci   - Use random 'usage' argument when uploading buffer
101e5c31af7Sopenharmony_ci   - Use glDrawArrays() (and no index buffer) instead of glDrawElements()
102e5c31af7Sopenharmony_ci   - Use separate buffers for different attributes (instead of one big buffer)
103e5c31af7Sopenharmony_ci   (Note: the texture- or buffer-specific actions above are randomized both
104e5c31af7Sopenharmony_ci   per-iteration but also per-object.)
105