• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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_RENDER__RENDER_NODE_UTIL_H
17 #define RENDER_RENDER__RENDER_NODE_UTIL_H
18 
19 #include <cstdint>
20 
21 #include <base/containers/vector.h>
22 #include <render/datastore/render_data_store_render_pods.h>
23 #include <render/device/pipeline_state_desc.h>
24 #include <render/namespace.h>
25 #include <render/nodecontext/intf_pipeline_descriptor_set_binder.h>
26 #include <render/nodecontext/intf_render_node_util.h>
27 #include <render/render_data_structures.h>
28 
29 RENDER_BEGIN_NAMESPACE()
30 struct RenderableList;
31 struct PipelineLayout;
32 class IRenderNodeContextManager;
33 
34 class RenderNodeUtil final : public IRenderNodeUtil {
35 public:
36     explicit RenderNodeUtil(IRenderNodeContextManager& renderNodeContextMgr);
37     ~RenderNodeUtil() override = default;
38 
39     RenderNodeHandles::InputRenderPass CreateInputRenderPass(
40         const RenderNodeGraphInputs::InputRenderPass& renderPass) const override;
41     RenderNodeHandles::InputResources CreateInputResources(
42         const RenderNodeGraphInputs::InputResources& inputResources) const override;
43 
44     RenderPass CreateRenderPass(const RenderNodeHandles::InputRenderPass& renderPass) const override;
45     PipelineLayout CreatePipelineLayout(const RenderHandle& shaderHandle) const override;
46 
47     DescriptorCounts GetDescriptorCounts(const PipelineLayout& pipelineLayout) const override;
48 
49     IPipelineDescriptorSetBinder::Ptr CreatePipelineDescriptorSetBinder(
50         const PipelineLayout& pipelineLayout) const override;
51 
52     void BindResourcesToBinder(const RenderNodeHandles::InputResources& resources,
53         IPipelineDescriptorSetBinder& pipelineDescriptorSetBinder) const override;
54 
55     ViewportDesc CreateDefaultViewport(const RenderPass& renderPass) const override;
56     ScissorDesc CreateDefaultScissor(const RenderPass& renderPass) const override;
57 
58     RenderPostProcessConfiguration GetRenderPostProcessConfiguration(
59         const PostProcessConfiguration& input) const override;
60 
61     bool HasChangeableResources(const RenderNodeGraphInputs::InputRenderPass& renderPass) const override;
62     bool HasChangeableResources(const RenderNodeGraphInputs::InputResources& resources) const override;
63 
64 private:
65     IRenderNodeContextManager& renderNodeContextMgr_;
66 };
67 RENDER_END_NAMESPACE()
68 
69 #endif // CORE__RENDER__RENDER_NODE_SCENE_UTIL_H
70