1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef VULKAN_GPU_QUERY_GLES_H
17 #define VULKAN_GPU_QUERY_GLES_H
18 
19 #include <base/containers/vector.h>
20 #include <render/namespace.h>
21 
22 #include "perf/gpu_query.h"
23 
24 RENDER_BEGIN_NAMESPACE()
25 class Device;
26 
27 struct GpuQueryPlatformDataGLES : public GpuQueryPlatformData {
28     uint32_t queryObject;
29 };
30 
31 /** GpuQueryGLES. */
32 class GpuQueryGLES final : public GpuQuery {
33 public:
34     GpuQueryGLES(Device& device, const GpuQueryDesc& desc);
35     ~GpuQueryGLES();
36 
37     void NextQueryIndex() override;
38 
39     const GpuQueryDesc& GetDesc() const override;
40     const GpuQueryPlatformData& GetPlatformData() const override;
41 
42 private:
43     uint32_t queryIndex_ { 0 };
44     BASE_NS::vector<GpuQueryPlatformDataGLES> plats_;
45     GpuQueryDesc desc_;
46 };
47 BASE_NS::unique_ptr<GpuQuery> CreateGpuQueryGLES(Device& device, const GpuQueryDesc& desc);
48 RENDER_END_NAMESPACE()
49 
50 #endif // VULKAN_GPU_QUERY_GLES_H
51