xref: /aosp_15_r20/external/deqp/external/openglcts/modules/gl/gl4cSyncTests.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _GL4CSYNCTESTS_HPP
2 #define _GL4CSYNCTESTS_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2015-2016 The Khronos Group Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */ /*!
22  * \file
23  * \brief
24  */ /*-------------------------------------------------------------------*/
25 
26 /**
27  * \file  gl4cSyncTests.hpp
28  * \brief Declares test classes for synchronization functionality.
29  */ /*-------------------------------------------------------------------*/
30 
31 /* Includes. */
32 
33 #include "glcTestCase.hpp"
34 #include "glwDefs.hpp"
35 #include "tcuDefs.hpp"
36 
37 namespace gl4cts
38 {
39 namespace Sync
40 {
41 /** @class Tests
42  *
43  *  @brief Direct State Access test group.
44  */
45 class Tests : public deqp::TestCaseGroup
46 {
47 public:
48     /* Public member functions */
49     Tests(deqp::Context &context);
50 
51     void init();
52 
53 private:
54     /* Private member functions */
55     Tests(const Tests &other);
56     Tests &operator=(const Tests &other);
57 };
58 /* Tests class */
59 
60 /** @class SyncFlushCommandsTest
61  *
62  *  Description:
63  *
64  *      This test verifies that ClientWaitSync called with SYNC_FLUSH_COMMANDS_BIT flag
65  *      behaves like Flush was inserted immediately after the creation of sync. This shall
66  *      happen in finite time (OpenGL 4.5 Core Profile, Chapter 4.1.2).
67  *
68  *  Steps:
69  *
70  *      Prepare first buffer with reference data.
71  *
72  *      Create second buffer with null data and persistent coherent storage.
73  *
74  *      Map second buffer for read with persistent and coherent flags.
75  *
76  *      Copy first buffer to second buffer using Copy*BufferSubData function.
77  *
78  *      Create synchronization object using FenceSync.
79  *
80  *      Use ClientWaitSync, with SYNC_FLUSH_COMMANDS_BIT flag and 16 seconds timeout, to
81  *      wait for synchronization being done. Check for errors - expect NO_ERROR. Expect
82  *      no timeout, but if it happen return test timeout result with indication that
83  *      tests possibly fails due to not returning after finite time.
84  *
85  *      If ClientWaitSync succeeded, compare queried data with the reference. Expect
86  *      equality.
87  *
88  *      Unmap second buffer.
89  */
90 class FlushCommandsTest : public deqp::TestCase
91 {
92 public:
93     /* Public member functions */
94     FlushCommandsTest(deqp::Context &context);
95 
96     virtual tcu::TestNode::IterateResult iterate();
97 
98 private:
99     /* Private member functions */
100     FlushCommandsTest(const FlushCommandsTest &other);
101     FlushCommandsTest &operator=(const FlushCommandsTest &other);
102 };
103 
104 /* FlushCommandsTest class */
105 } // namespace Sync
106 } // namespace gl4cts
107 
108 #endif // _GL4CSYNCTESTS_HPP
109