1 #ifndef DALI_FRAME_BUFFER_DEVEL_H
2 #define DALI_FRAME_BUFFER_DEVEL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/rendering/frame-buffer.h>
26 namespace DevelFrameBuffer
29 * @brief Maximum number of color attachments supported.
31 constexpr uint8_t MAX_COLOR_ATTACHMENTS = 8;
34 * @brief Attaches the base LOD of a depth texture to the frame buffer.
35 * @note This causes a depth attachment to be added.
37 * @param[in] frameBuffer A handle to the FrameBuffer
38 * @param[in] texture The texture that will be used as output when rendering
39 * @note The size of the texture has to be same as that of the frame buffer.
40 * Otherwise, it won't be attached.
42 DALI_CORE_API void AttachDepthTexture(FrameBuffer frameBuffer, Texture& texture);
45 * @brief Attaches a depth texture to the frame buffer.
46 * @note This causes a depth attachment to be added.
48 * @param[in] frameBuffer A handle to the FrameBuffer
49 * @param[in] texture The texture that will be used as output when rendering
50 * @param[in] mipmapLevel The mipmap of the texture to be attached
51 * @note The size of the mipmapped texture has to be same as that of the frame buffer.
52 * Otherwise, it won't be attached.
54 DALI_CORE_API void AttachDepthTexture(FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel);
57 * @brief Attaches the base LOD of a stencil texture to the frame buffer.
58 * @note This causes a stencil attachment to be added.
60 * @param[in] frameBuffer A handle to the FrameBuffer
61 * @param[in] texture The texture that will be used as output when rendering
62 * @note The size of the texture has to be same as that of the frame buffer.
63 * Otherwise, it won't be attached.
65 DALI_CORE_API void AttachDepthStencilTexture(FrameBuffer frameBuffer, Texture& texture);
68 * @brief Attaches a depth/stencil texture to the frame buffer.
69 * @note This causes a depth/stencil attachment to be added.
71 * @param[in] frameBuffer A handle to the FrameBuffer
72 * @param[in] texture The texture that will be used as output when rendering
73 * @param[in] mipmapLevel The mipmap of the texture to be attached
74 * @note The size of the mipmapped texture has to be same as that of the frame buffer.
75 * Otherwise, it won't be attached.
77 DALI_CORE_API void AttachDepthStencilTexture(FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel);
80 * @brief Sets the level of multisampling in the frame buffer.
81 * @note This API must be called before the frame buffer is attached to render task. (Since multi sample level is immutable)
82 * Otherwise, no effects.
84 * @param[in] frameBuffer The FrameBuffer handle
85 * @param[in] multiSamplingLevel The level of samples
87 DALI_CORE_API void SetMultiSamplingLevel(FrameBuffer frameBuffer, uint8_t multiSamplingLevel);
90 * @brief Gets the color texture at the given @a index used as output in the frame buffer.
92 * @param[in] frameBuffer A handle to the FrameBuffer
93 * @param[in] index The index required
95 * @return A handle to the texture used as color output, or an uninitialized handle
97 * @note A maximum of 8 color attachments are supported. Passing an invalid index will return
98 * an uninitialized handle.
100 DALI_CORE_API Texture GetColorTexture(const FrameBuffer frameBuffer, uint8_t index);
103 * @brief Gets the depth texture used as output in the frame buffer.
105 * @param[in] frameBuffer The FrameBuffer handle
107 * @return A handle of the texture used as depth output, or an uninitialized handle
109 DALI_CORE_API Texture GetDepthTexture(FrameBuffer frameBuffer);
112 * @brief Gets the depth/stencil texture used as output in the frame buffer.
114 * @param[in] frameBuffer The FrameBuffer handle
116 * @return A handle of the texture used as depth/stencil output, or an uninitialized handle
118 DALI_CORE_API Texture GetDepthStencilTexture(FrameBuffer frameBuffer);
120 } // namespace DevelFrameBuffer
124 #endif // DALI_FRAME_BUFFER_DEVEL_H