• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 RENDER_NODE_RENDER_NODE_COPY_UTIL_H
17 #define RENDER_NODE_RENDER_NODE_COPY_UTIL_H
18 
19 #include <render/namespace.h>
20 #include <render/nodecontext/intf_pipeline_descriptor_set_binder.h>
21 #include <render/nodecontext/intf_render_node.h>
22 #include <render/nodecontext/intf_render_node_copy_util.h>
23 #include <render/render_data_structures.h>
24 #include <render/resource_handle.h>
25 
26 RENDER_BEGIN_NAMESPACE()
27 class IRenderCommandList;
28 
29 class RenderNodeCopyUtil final : public IRenderNodeCopyUtil {
30 public:
31     RenderNodeCopyUtil() = default;
32     ~RenderNodeCopyUtil() override = default;
33 
34     void Init(IRenderNodeContextManager& renderNodeContextMgr) override;
35     void PreExecute() override;
36     void Execute(IRenderCommandList& cmdList, const CopyInfo& copyInfo) override;
37 
38     DescriptorCounts GetRenderDescriptorCounts() const override;
39 
40     const CORE_NS::IInterface* GetInterface(const BASE_NS::Uid& uid) const override;
41     CORE_NS::IInterface* GetInterface(const BASE_NS::Uid& uid) override;
42 
43     void Ref() override;
44     void Unref() override;
45 
46 private:
47     IRenderNodeContextManager* renderNodeContextMgr_;
48 
49     CopyInfo copyInfo_;
50     struct RenderDataHandles {
51         RenderHandle shader;
52         PipelineLayout pipelineLayout;
53         RenderHandle pso;
54         RenderHandle sampler;
55 
56         RenderHandle shaderLayer;
57         PipelineLayout pipelineLayoutLayer;
58         RenderHandle psoLayer;
59     };
60     RenderDataHandles renderData_;
61 
62     IDescriptorSetBinder::Ptr binder_;
63 
64     uint32_t refCount_ { 0U };
65 };
66 RENDER_END_NAMESPACE()
67 
68 #endif // RENDER_NODE_RENDER_NODE_COPY_UTIL_H
69