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_BACKEND_H 17 #define RENDER_BACKEND_H 18 19 #include <core/namespace.h> 20 #include <render/datastore/render_data_store_render_pods.h> 21 #include <render/device/pipeline_state_desc.h> 22 #include <render/namespace.h> 23 24 RENDER_BEGIN_NAMESPACE() 25 class Device; 26 class GpuResourceManager; 27 struct RenderCommandContext; 28 struct RenderCommandFrameData; 29 30 struct RenderBackendBackBufferConfiguration { 31 // state after render node graph processing 32 GpuResourceState backBufferState; 33 // layout after render node graph processing 34 ImageLayout layout { ImageLayout::CORE_IMAGE_LAYOUT_UNDEFINED }; 35 // configuration for the back buffer 36 NodeGraphBackBufferConfiguration config; 37 }; 38 39 class RenderBackend { 40 public: 41 RenderBackend() = default; 42 virtual ~RenderBackend() = default; 43 44 virtual void Render(RenderCommandFrameData& renderCommandFrameData, 45 const RenderBackendBackBufferConfiguration& backBufferConfig) = 0; 46 virtual void Present(const RenderBackendBackBufferConfiguration& backBufferConfig) = 0; 47 48 private: 49 }; 50 RENDER_END_NAMESPACE() 51 52 #endif // RENDER_BACKEND_H 53