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-GLES3.functional.fbo.completeness.renderable.*
23e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.fbo.completeness.attachment_combinations.*
24e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.fbo.completeness.size.zero
25e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.fbo.completeness.size.distinct
26e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.fbo.completeness.size.layer.*
27e5c31af7Sopenharmony_ci + dEQP-GLES3.functional.fbo.completeness.size.samples.*
28e5c31af7Sopenharmony_ci
29e5c31af7Sopenharmony_ciIncludes:
30e5c31af7Sopenharmony_ci + glCheckFramebufferStatus return value check
31e5c31af7Sopenharmony_ci + Single attachments with all standard (and many extension) formats
32e5c31af7Sopenharmony_ci + All combinations of color, depth and stencil attachments
33e5c31af7Sopenharmony_ci + Zero-sized attachment
34e5c31af7Sopenharmony_ci + Differently sized attachments
35e5c31af7Sopenharmony_ci + Multilayer attachments
36e5c31af7Sopenharmony_ci + Compatibility of multisample attachments
37e5c31af7Sopenharmony_ci
38e5c31af7Sopenharmony_ciExcludes:
39e5c31af7Sopenharmony_ci + Trying FBO operations on in/complete FBOs.
40e5c31af7Sopenharmony_ci + Completeness status changes after the FBO is modified.
41e5c31af7Sopenharmony_ci
42e5c31af7Sopenharmony_ciDescription:
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_ciThese tests check that the implementation reports framebuffer completeness
45e5c31af7Sopenharmony_cistatus correctly. Most test cases create a single framebuffer object, create
46e5c31af7Sopenharmony_cisome renderbuffers and/or textures and attach them to the FBO, and then call
47e5c31af7Sopenharmony_ciglCheckFramebufferStatus on it. The returned value is compared against a set
48e5c31af7Sopenharmony_ciof legal return values that is calculated from the arguments given to image
49e5c31af7Sopenharmony_cicreation and attachment functions. The test passes if the return value is
50e5c31af7Sopenharmony_cifound in this set. Some test cases may also expect image creation to fail
51e5c31af7Sopenharmony_cibefore it can be attached.
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ciFor each test case, the test log shows the configurations of the created
54e5c31af7Sopenharmony_ciimages and attachments, the set of expected status values and the actual
55e5c31af7Sopenharmony_cireturned status value.
56e5c31af7Sopenharmony_ci
57e5c31af7Sopenharmony_ci
58e5c31af7Sopenharmony_ciThe "renderable.*" test cases iterate through all the texture formats and
59e5c31af7Sopenharmony_ciattachment points and attach a single texture or renderbuffer with that format
60e5c31af7Sopenharmony_ciat that attachment point.
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ciThe purpose of these tests is to check that the implementation's notion of
63e5c31af7Sopenharmony_cicolor/depth/stencil-renderability adheres to the GLES specification and
64e5c31af7Sopenharmony_ciextensions. Both renderability and non-renderability of unexpected formats are
65e5c31af7Sopenharmony_cireported as test failures.
66e5c31af7Sopenharmony_ci
67e5c31af7Sopenharmony_ci
68e5c31af7Sopenharmony_ciThe "attachment_combination.*" test cases attach some textures and/or
69e5c31af7Sopenharmony_cirenderbuffers with suitable formats to none, some or all of the framebuffer's
70e5c31af7Sopenharmony_ciattachment points. The expected status values are as follows:
71e5c31af7Sopenharmony_ci
72e5c31af7Sopenharmony_ci* If there are no attachments, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
73e5c31af7Sopenharmony_ci  must be returned.
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ci* If there is both a depth and a stencil attachment and one is a texture and
76e5c31af7Sopenharmony_ci  the other is a renderbuffer, GL_FRAMEBUFFER_UNSUPPORTED must be returned.
77e5c31af7Sopenharmony_ci
78e5c31af7Sopenharmony_ci* Otherwise, GL_FRAMEBUFFER_COMPLETE must be returned.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ciNote that GLES3 requires the depth and stencil attachments to be the same
81e5c31af7Sopenharmony_ciimage. When a test case has both a depth and a stencil attachment and either
82e5c31af7Sopenharmony_ciboth are textures or both are renderbuffers, the same image is used for both
83e5c31af7Sopenharmony_ciattachments.
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ciThe "size.*" test cases check that attachment sizes are treated correctly.
87e5c31af7Sopenharmony_ci
88e5c31af7Sopenharmony_ciThe "size.zero" test case creates a framebuffer object with a single
89e5c31af7Sopenharmony_cizero-sized renderbuffer attachment. The glCheckFramebufferStatus call is
90e5c31af7Sopenharmony_ciexpected to return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. Note that creating
91e5c31af7Sopenharmony_ciand attaching the zero-sized renderbuffer is still expected to succeed.
92e5c31af7Sopenharmony_ci
93e5c31af7Sopenharmony_ciThe "size.distinct" test case creates a framebuffer object with two
94e5c31af7Sopenharmony_ciattachments with different sizes. The glCheckFramebufferStatus call is
95e5c31af7Sopenharmony_ciexpected to return GL_FRAMEBUFFER_COMPLETE.
96e5c31af7Sopenharmony_ci
97e5c31af7Sopenharmony_ci
98e5c31af7Sopenharmony_ciThe "layer.*" test cases create various layered textures (two-dimensional
99e5c31af7Sopenharmony_ciarray textures or 3D textures) and attach them to framebuffer objects with
100e5c31af7Sopenharmony_ciglFramebufferTextureLayer. The framebuffer status is expected to be
101e5c31af7Sopenharmony_ciGL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT when the attached layer number is
102e5c31af7Sopenharmony_cigreater than or equal to the number of layers in the texture.
103e5c31af7Sopenharmony_ci
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ciThe "samples.*" test cases attach textures and/or renderbuffers with various
106e5c31af7Sopenharmony_cinumbers of samples. The framebuffer status is expected to be
107e5c31af7Sopenharmony_ciGL_FRAMEBUFFER_COMPLETE when the attachments have the same number of samples
108e5c31af7Sopenharmony_ci(taking textures to have zero samples), or
109e5c31af7Sopenharmony_ciGL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE otherwise.
110e5c31af7Sopenharmony_ci
111e5c31af7Sopenharmony_ciBecause implementations are allowed to allocate more samples than
112e5c31af7Sopenharmony_cirequested, a framebuffer object whose attachments have requested a
113e5c31af7Sopenharmony_cidifferent, but non-zero, number of samples, is allowed to check either
114e5c31af7Sopenharmony_cias complete or incomplete.
115e5c31af7Sopenharmony_ci
116e5c31af7Sopenharmony_ciIf a test case requests more samples than the implementation supports,
117e5c31af7Sopenharmony_cithe case is reported as "not supported".
118