• 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__NODE__RENDER_NODE_DEFAULT_ACCELERATION_STRUCTURE_STAGING_H
17 #define RENDER_RENDER__NODE__RENDER_NODE_DEFAULT_ACCELERATION_STRUCTURE_STAGING_H
18 
19 #include <base/containers/string.h>
20 #include <base/util/uid.h>
21 #include <render/namespace.h>
22 #include <render/nodecontext/intf_render_node.h>
23 #include <render/render_data_structures.h>
24 
25 RENDER_BEGIN_NAMESPACE()
26 class IRenderCommandList;
27 class IRenderNodeContextManager;
28 struct RenderNodeGraphInputs;
29 
30 class RenderDataStoreDefaultAccelerationStructureStaging;
31 
32 class RenderNodeDefaultAccelerationStructureStaging final : public IRenderNode {
33 public:
34     RenderNodeDefaultAccelerationStructureStaging() = default;
35     ~RenderNodeDefaultAccelerationStructureStaging() override = default;
36 
37     void InitNode(IRenderNodeContextManager& renderNodeContextMgr) override;
38     void PreExecuteFrame() override;
39     void ExecuteFrame(IRenderCommandList& cmdList) override;
40 
41     // for plugin / factory interface
42     static constexpr BASE_NS::Uid UID { "377f5d6c-3951-4a0b-9d5b-7ef8d5e6f235" };
43     static constexpr char const* TYPE_NAME = "CORE_RN_DEFAULT_ACCELERATION_STRUCTURE_STAGING";
44     static constexpr IRenderNode::BackendFlags BACKEND_FLAGS =
45         IRenderNode::BackendFlagBits::BACKEND_FLAG_BITS_EXPLICIT_VULKAN;
46     static constexpr IRenderNode::ClassType CLASS_TYPE = IRenderNode::ClassType::CLASS_TYPE_NODE;
47     static IRenderNode* Create();
48     static void Destroy(IRenderNode* instance);
49 
50 private:
51     void ExecuteFrameProcessInstanceData(RenderDataStoreDefaultAccelerationStructureStaging* dataStore);
52 
53     IRenderNodeContextManager* renderNodeContextMgr_ { nullptr };
54 
55     BASE_NS::string dsName_;
56 };
57 RENDER_END_NAMESPACE()
58 
59 #endif // RENDER_RENDER__NODE__RENDER_NODE_DEFAULT_ACCELERATION_STRUCTURE_STAGING_H
60