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 GL 3 conditional render 20e5c31af7Sopenharmony_ci 21e5c31af7Sopenharmony_ciTests: 22e5c31af7Sopenharmony_ci + dEQP-GL3.functional.conditional_render.* 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ciIncludes: 25e5c31af7Sopenharmony_ci + All valid rendering commands included/excluded by query 26e5c31af7Sopenharmony_ci - DrawArrays 27e5c31af7Sopenharmony_ci - DrawArraysInstanced 28e5c31af7Sopenharmony_ci - MultiDrawArrays 29e5c31af7Sopenharmony_ci 30e5c31af7Sopenharmony_ci - DrawElements 31e5c31af7Sopenharmony_ci - DrawElementsInstanced 32e5c31af7Sopenharmony_ci - DrawElementsInstancedBaseVertex 33e5c31af7Sopenharmony_ci - DrawElementsBaseVertex 34e5c31af7Sopenharmony_ci - DrawRangeElements 35e5c31af7Sopenharmony_ci - DrawRangeElementsBaseVertex 36e5c31af7Sopenharmony_ci - MultiDrawElements 37e5c31af7Sopenharmony_ci - MultiDrawElementsBaseVertex 38e5c31af7Sopenharmony_ci - Clear 39e5c31af7Sopenharmony_ci - ClearBuffer* 40e5c31af7Sopenharmony_ci + All depth comparison modes 41e5c31af7Sopenharmony_ci + Framebuffer swap between query & render 42e5c31af7Sopenharmony_ci - Excluding BY_REGION query modes 43e5c31af7Sopenharmony_ci + All modes 44e5c31af7Sopenharmony_ci - QUERY_(BY_REGION_)(NO_)WAIT 45e5c31af7Sopenharmony_ci + Dependent queries 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ciExcludes: 48e5c31af7Sopenharmony_ci + Immediate mode rendering 49e5c31af7Sopenharmony_ci + Primitives other than triangles 50e5c31af7Sopenharmony_ci + Negative tests 51e5c31af7Sopenharmony_ci + Tests for NO_WAIT and BY_REGION modes are very limited 52e5c31af7Sopenharmony_ci 53e5c31af7Sopenharmony_ciDescription: 54e5c31af7Sopenharmony_ci 55e5c31af7Sopenharmony_ciConditional rendering is tested with various depth function/primitive 56e5c31af7Sopenharmony_cioverlap conditions. Each query test renders a scene with one conditional 57e5c31af7Sopenharmony_cirender call and verifies the result against the same scene with the 58e5c31af7Sopenharmony_cipreviously GL controlled conditional render call controlled by the test. 59e5c31af7Sopenharmony_ci 60e5c31af7Sopenharmony_ciDraw calls (excluding clears) are tested with the same method, with the 61e5c31af7Sopenharmony_ciconditional call indicated by the test name. The occlusion query used in 62e5c31af7Sopenharmony_cithese tests is trivially true/false. 63e5c31af7Sopenharmony_ci 64e5c31af7Sopenharmony_ciClears are tested by rendering some geometry for an occlusion query and then 65e5c31af7Sopenharmony_ciconditionally clearing the framebuffer. The verification used depends on the 66e5c31af7Sopenharmony_ciexpected result of the occlusion query. If the query is expected to pass, the 67e5c31af7Sopenharmony_ciframebuffer is verified to contain only the color it was cleared to. 68e5c31af7Sopenharmony_ciOtherwise the contents of the framebuffer are verified to match its contents 69e5c31af7Sopenharmony_cibefore the conditional clear. 70e5c31af7Sopenharmony_ci 71e5c31af7Sopenharmony_ciDepth/stencil clear tests unconditionally clear the color buffer after 72e5c31af7Sopenharmony_cirendering the occlusion geometry. After the conditional depth/stencil clear 73e5c31af7Sopenharmony_cia full framebuffer triangle is rendered with depth/stencil tests setup 74e5c31af7Sopenharmony_cito pass if the clear took place. The resulting framebuffer is read out and 75e5c31af7Sopenharmony_cicompared to the color of the intermediate clear or the filling triangle as 76e5c31af7Sopenharmony_ciappropriate for the expected occlusion query result. 77e5c31af7Sopenharmony_ci 78e5c31af7Sopenharmony_ciAll clear tests use non-default framebuffers, all others use the default. 79e5c31af7Sopenharmony_ci 80e5c31af7Sopenharmony_ciFramebuffer swap cases use a trivial occlusion query but change the bound 81e5c31af7Sopenharmony_ci(read & write) FBO between the occludion query and the conditional rendering. 82e5c31af7Sopenharmony_ciThe occlusion query is performed with the default framebuffer. 83e5c31af7Sopenharmony_ci 84e5c31af7Sopenharmony_ciWait mode test render geometry that is not dependent on the result of the 85e5c31af7Sopenharmony_ciocclusion queries. These tests thus only test for false positive occlusion 86e5c31af7Sopenharmony_ciquery results. 87e5c31af7Sopenharmony_ci 88e5c31af7Sopenharmony_ciDependent queries render a number of primitives where each conditionally 89e5c31af7Sopenharmony_cirendered primitive (excluding the first) is also used for an occlusion query 90e5c31af7Sopenharmony_cithat controls the rendering of the next primitive, which in turn is used for 91e5c31af7Sopenharmony_cithe next occlusion query and so on. In some of these test one primitive in 92e5c31af7Sopenharmony_cithis chain is placed in an occluded location, starting a cascade of failing 93e5c31af7Sopenharmony_ciocclusion queries. 94