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 CORE_UTIL_RENDER_UTIL_H 17 #define CORE_UTIL_RENDER_UTIL_H 18 19 #include <3d/intf_graphics_context.h> 20 #include <3d/util/intf_render_util.h> 21 #include <core/namespace.h> 22 23 RENDER_BEGIN_NAMESPACE() 24 class IRenderContext; 25 RENDER_END_NAMESPACE() 26 27 CORE3D_BEGIN_NAMESPACE() 28 class IGraphicsContext; 29 class IEngine; 30 struct RenderCamera; 31 struct RenderScene; 32 33 class RenderUtil : public IRenderUtil { 34 public: 35 explicit RenderUtil(IGraphicsContext& graphicsContext); 36 ~RenderUtil() override = default; 37 38 RENDER_NS::RenderNodeGraphDesc GetRenderNodeGraphDesc( 39 const RenderScene& renderScene, const RenderCamera& renderCamera, const uint32_t flags) const override; 40 RENDER_NS::RenderNodeGraphDesc GetRenderNodeGraphDesc( 41 const RenderScene& renderScene, const uint32_t flags) const override; 42 43 private: 44 void InitRenderNodeGraphs(); 45 RENDER_NS::RenderNodeGraphDesc SelectBaseDesc(const RenderCamera& renderCamera) const; 46 47 RENDER_NS::IRenderContext& context_; 48 const RENDER_NS::DeviceBackendType backendType_ { RENDER_NS::DeviceBackendType::VULKAN }; 49 50 RENDER_NS::RenderNodeGraphDesc rngdScene_; 51 RENDER_NS::RenderNodeGraphDesc rngdCamLwrp_; 52 RENDER_NS::RenderNodeGraphDesc rngdCamLwrpMsaa_; 53 RENDER_NS::RenderNodeGraphDesc rngdCamLwrpMsaaGles_; 54 RENDER_NS::RenderNodeGraphDesc rngdCamHdr_; 55 RENDER_NS::RenderNodeGraphDesc rngdCamHdrMsaa_; 56 RENDER_NS::RenderNodeGraphDesc rngdReflCam_; 57 RENDER_NS::RenderNodeGraphDesc rngdCamPrePass_; 58 59 RENDER_NS::RenderNodeGraphDesc rngdDeferred_; 60 }; 61 CORE3D_END_NAMESPACE() 62 63 #endif // CORE_UTIL_RENDER_UTIL_H 64