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 RENDER_RENDER__RENDER_NODE_PARSER_UTIL_H
17 #define RENDER_RENDER__RENDER_NODE_PARSER_UTIL_H
18
19 #include <cstdint>
20
21 #include <base/containers/string.h>
22 #include <base/containers/string_view.h>
23 #include <render/device/pipeline_state_desc.h>
24 #include <render/namespace.h>
25 #include <render/nodecontext/intf_render_node_parser_util.h>
26
RENDER_BEGIN_NAMESPACE()27 RENDER_BEGIN_NAMESPACE()
28 /**
29 * class RenderNodeParserUtil.
30 */
31 class RenderNodeParserUtil final : public IRenderNodeParserUtil {
32 public:
33 struct CreateInfo {};
34
35 explicit RenderNodeParserUtil(const CreateInfo& createInfo);
36 ~RenderNodeParserUtil() override;
37
38 uint64_t GetUintValue(const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
39 int64_t GetIntValue(const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
40 float GetFloatValue(const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
41 BASE_NS::string GetStringValue(
42 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
43
44 RenderNodeGraphInputs::InputRenderPass GetInputRenderPass(
45 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
46 RenderNodeGraphInputs::InputResources GetInputResources(
47 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
48 RenderNodeGraphInputs::RenderDataStore GetRenderDataStore(
49 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
50
51 BASE_NS::vector<RenderNodeGraphInputs::RenderNodeGraphGpuImageDesc> GetGpuImageDescs(
52 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
53 BASE_NS::vector<RenderNodeGraphInputs::RenderNodeGraphGpuBufferDesc> GetGpuBufferDescs(
54 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
55
56 RenderSlotSortType GetRenderSlotSortType(
57 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
58 RenderSlotCullType GetRenderSlotCullType(
59 const CORE_NS::json::value& jsonValue, const BASE_NS::string_view name) const override;
60
61 // IInterface
62 const CORE_NS::IInterface* GetInterface(const BASE_NS::Uid& uid) const override;
63 CORE_NS::IInterface* GetInterface(const BASE_NS::Uid& uid) override;
64 void Ref() override;
65 void Unref() override;
66
67 private:
68 };
69 RENDER_END_NAMESPACE()
70
71 #endif // RENDER_RENDER__RENDER_NODE_PARSER_UTIL_H
72