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    Framebuffer completeness tests.
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ciTests:
22e5c31af7Sopenharmony_ci + dEQP-GLES2.functional.fbo.completeness.renderable.*
23e5c31af7Sopenharmony_ci + dEQP-GLES2.functional.fbo.completeness.attachment_combinations.*
24e5c31af7Sopenharmony_ci + dEQP-GLES2.functional.fbo.completeness.attachment_combinations.exists_supported
25e5c31af7Sopenharmony_ci + dEQP-GLES2.functional.fbo.completeness.size.zero
26e5c31af7Sopenharmony_ci + dEQP-GLES2.functional.fbo.completeness.size.distinct
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_ciIncludes:
29e5c31af7Sopenharmony_ci + glCheckFramebufferStatus return value check
30e5c31af7Sopenharmony_ci + Single attachments with all standard (and many extension) formats
31e5c31af7Sopenharmony_ci + All combinations of color0, depth and stencil attachments
32e5c31af7Sopenharmony_ci   - And other color attachments if GL_NV_fbo_color_attachments is exposed
33e5c31af7Sopenharmony_ci + Existence of a supported combination of formats
34e5c31af7Sopenharmony_ci + Zero-sized attachment
35e5c31af7Sopenharmony_ci + Differently sized attachments
36e5c31af7Sopenharmony_ci
37e5c31af7Sopenharmony_ciExcludes:
38e5c31af7Sopenharmony_ci + Trying FBO operations on in/complete FBOs.
39e5c31af7Sopenharmony_ci + Completeness status changes after the FBO is modified.
40e5c31af7Sopenharmony_ci
41e5c31af7Sopenharmony_ciDescription:
42e5c31af7Sopenharmony_ci
43e5c31af7Sopenharmony_ciThese tests check that the implementation reports framebuffer completeness
44e5c31af7Sopenharmony_cistatus correctly. Most test cases create a single framebuffer object, create
45e5c31af7Sopenharmony_cisome renderbuffers and/or textures and attach them to the FBO, and then call
46e5c31af7Sopenharmony_ciglCheckFramebufferStatus on it. The returned value is compared against a set
47e5c31af7Sopenharmony_ciof legal return values that is calculated from the arguments given to image
48e5c31af7Sopenharmony_cicreation and attachment functions. The test passes if the return value is
49e5c31af7Sopenharmony_cifound in this set. Some test cases may also expect image creation to fail
50e5c31af7Sopenharmony_cibefore it can be attached.
51e5c31af7Sopenharmony_ci
52e5c31af7Sopenharmony_ciFor each test case, the test log shows the configurations of the created
53e5c31af7Sopenharmony_ciimages and attachments, the set of expected status values and the actual
54e5c31af7Sopenharmony_cireturned status value.
55e5c31af7Sopenharmony_ci
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ciThe "renderable.*" test cases iterate through all the texture formats and
58e5c31af7Sopenharmony_ciattachment points and attach a single texture or renderbuffer with that format
59e5c31af7Sopenharmony_ciat that attachment point.
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ciThe purpose of these tests is to check that the implementation's notion of
62e5c31af7Sopenharmony_cicolor/depth/stencil-renderability adheres to the GLES specification and
63e5c31af7Sopenharmony_ciextensions. Both renderability and non-renderability of unexpected formats are
64e5c31af7Sopenharmony_cireported as test failures.
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ciNote that the GLES2 spec allows implementations to return
67e5c31af7Sopenharmony_ciGL_FRAMEBUFFER_UNSUPPORTED for practically any framebuffer configurations. See
68e5c31af7Sopenharmony_ci"attachment_combinations.exists_supported" for a test that ensures that at
69e5c31af7Sopenharmony_cileast one combination of attachment formats is supported.
70e5c31af7Sopenharmony_ci
71e5c31af7Sopenharmony_ciAlso note that the GLES2 spec is notoriously ambiguous regarding the
72e5c31af7Sopenharmony_cirenderability of unsized formats that correspond to renderable sized formats.
73e5c31af7Sopenharmony_ciSee Khronos bug 7333 <https://cvs.khronos.org/bugzilla/show_bug.cgi?id=7333>
74e5c31af7Sopenharmony_cifor details. This test expects the following behavior:
75e5c31af7Sopenharmony_ci
76e5c31af7Sopenharmony_ci* The type/unsized-format combinations corresponding to the color-renderable
77e5c31af7Sopenharmony_ci  sized formats in table 4.5 are expected to be color-renderable. (Consensus
78e5c31af7Sopenharmony_ci  in bug 7333.)
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ci* If OES_rgb8_rgba8 is exposed, the combinations ubyte/RGB and ubyte/RGBA are
81e5c31af7Sopenharmony_ci  expected to be color-renderable. (Consensus in bug 7333.)
82e5c31af7Sopenharmony_ci
83e5c31af7Sopenharmony_ci* If extensions state explicitly the renderability of a format, the
84e5c31af7Sopenharmony_ci  implementation is expected to adhere to that.
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci* If an extension makes another sized format renderable, and there is no text
87e5c31af7Sopenharmony_ci  about the renderability of the corresponding type/unsized-format
88e5c31af7Sopenharmony_ci  combination, then it is allowed but not required to be renderable.
89e5c31af7Sopenharmony_ci
90e5c31af7Sopenharmony_ci* If a type/unsized-format combination is not specified to be renderable and
91e5c31af7Sopenharmony_ci  does not correspond to a renderable sized format, then it is expected to be
92e5c31af7Sopenharmony_ci  unrenderable.
93e5c31af7Sopenharmony_ci
94e5c31af7Sopenharmony_ci
95e5c31af7Sopenharmony_ciThe "attachment_combination.*" test cases attach some textures and/or
96e5c31af7Sopenharmony_cirenderbuffers with suitable formats to none, some or all of the framebuffer's
97e5c31af7Sopenharmony_ciattachment points. The expected status values are as follows:
98e5c31af7Sopenharmony_ci
99e5c31af7Sopenharmony_ci* If there are no attachments, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
100e5c31af7Sopenharmony_ci  must be returned.
101e5c31af7Sopenharmony_ci
102e5c31af7Sopenharmony_ci* Otherwise, GL_FRAMEBUFFER_COMPLETE or GL_FRAMEBUFFER_UNSUPPORTED must be
103e5c31af7Sopenharmony_ci  returned.
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ciIf the implementation declares support for GL_NV_fbo_color_attachments, all
106e5c31af7Sopenharmony_cicolor attachments are used in the tests.
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ciSome tests may return the status "NotSupported" because the implementation
109e5c31af7Sopenharmony_cidoes support a depth- or stencil-renderable texture format.
110e5c31af7Sopenharmony_ci
111e5c31af7Sopenharmony_ciNote that GLES2, unlike GLES3, allows the depth and stencil attachments to be
112e5c31af7Sopenharmony_cidistinct images, and in fact requires them to be, since without extensions
113e5c31af7Sopenharmony_cithere is no format that is both depth- and stencil-renderable. When a test
114e5c31af7Sopenharmony_cicase has both a depth and a stencil attachment, they are always distinct
115e5c31af7Sopenharmony_ciimages.
116e5c31af7Sopenharmony_ci
117e5c31af7Sopenharmony_ciThe test case "attachment_combinations.exists_supported" iterates through all
118e5c31af7Sopenharmony_cistandard GLES2 renderable formats and attempts to find at least one
119e5c31af7Sopenharmony_cicombination of attachments and formats such that the framebuffer checks as
120e5c31af7Sopenharmony_cicomplete. The test fails if no such combination is found.
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ci
123e5c31af7Sopenharmony_ciThe "size.*" test cases check that attachment sizes are treated correctly.
124e5c31af7Sopenharmony_ci
125e5c31af7Sopenharmony_ciThe "size.zero" test case creates a framebuffer object with a single
126e5c31af7Sopenharmony_cizero-sized renderbuffer attachment. The glCheckFramebufferStatus call is
127e5c31af7Sopenharmony_ciexpected to return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. Note that creating
128e5c31af7Sopenharmony_ciand attaching the zero-sized renderbuffer is still expected to succeed.
129e5c31af7Sopenharmony_ci
130e5c31af7Sopenharmony_ciThe "size.distinct" test case creates a framebuffer object with two
131e5c31af7Sopenharmony_ciattachments with different sizes. The glCheckFramebufferStatus call is
132e5c31af7Sopenharmony_ciexpected to return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.
133