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 DEVICE_GPU_RESOURCE_UTIL_H
17 #define DEVICE_GPU_RESOURCE_UTIL_H
18 
19 #include <base/containers/string_view.h>
20 #include <render/namespace.h>
21 #include <render/resource_handle.h>
22 
23 BASE_BEGIN_NAMESPACE()
24 class ByteArray;
25 BASE_END_NAMESPACE()
26 RENDER_BEGIN_NAMESPACE()
27 class IDevice;
28 class GpuBuffer;
29 class GpuImage;
30 class GpuSampler;
31 class GpuResourceManager;
32 
33 namespace GpuResourceUtil {
34 void CopyGpuResource(const IDevice& device, const GpuResourceManager& gpuResourceMgr, const RenderHandle handle,
35     BASE_NS::ByteArray& byteArray);
36 void DebugBufferName(const IDevice& device, const GpuBuffer& buffer, const BASE_NS::string_view name);
37 void DebugImageName(const IDevice& device, const GpuImage& image, const BASE_NS::string_view name);
38 void DebugSamplerName(const IDevice& device, const GpuSampler& sampler, const BASE_NS::string_view name);
39 } // namespace GpuResourceUtil
40 RENDER_END_NAMESPACE()
41 
42 #endif // DEVICE_GPU_RESOURCE_UTIL_H
43