1 #ifndef DALI_FRAME_BUFFER_DEVEL_H
2 #define DALI_FRAME_BUFFER_DEVEL_H
5 * Copyright (c) 2020 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>
27 namespace DevelFrameBuffer
31 * @brief Maximum number of color attachments supported.
33 constexpr uint8_t MAX_COLOR_ATTACHMENTS = 8;
36 * @brief Attaches the base LOD of a depth texture to the frame buffer.
37 * @note This causes a depth attachment to be added.
39 * @param[in] frameBuffer A handle to the FrameBuffer
40 * @param[in] texture The texture that will be used as output when rendering
41 * @note The size of the texture has to be same as that of the frame buffer.
42 * Otherwise, it won't be attached.
44 void AttachDepthTexture( FrameBuffer frameBuffer, Texture& texture );
47 * @brief Attaches a depth texture to the frame buffer.
48 * @note This causes a depth attachment to be added.
50 * @param[in] frameBuffer A handle to the FrameBuffer
51 * @param[in] texture The texture that will be used as output when rendering
52 * @param[in] mipmapLevel The mipmap of the texture to be attached
53 * @note The size of the mipmapped texture has to be same as that of the frame buffer.
54 * Otherwise, it won't be attached.
56 void AttachDepthTexture( FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel );
59 * @brief Attaches the base LOD of a stencil texture to the frame buffer.
60 * @note This causes a stencil attachment to be added.
62 * @param[in] frameBuffer A handle to the FrameBuffer
63 * @param[in] texture The texture that will be used as output when rendering
64 * @note The size of the texture has to be same as that of the frame buffer.
65 * Otherwise, it won't be attached.
67 void AttachDepthStencilTexture( FrameBuffer frameBuffer, Texture& texture );
70 * @brief Attaches a depth/stencil texture to the frame buffer.
71 * @note This causes a depth/stencil attachment to be added.
73 * @param[in] frameBuffer A handle to the FrameBuffer
74 * @param[in] texture The texture that will be used as output when rendering
75 * @param[in] mipmapLevel The mipmap of the texture to be attached
76 * @note The size of the mipmapped texture has to be same as that of the frame buffer.
77 * Otherwise, it won't be attached.
79 void AttachDepthStencilTexture( FrameBuffer frameBuffer, Texture& texture, uint32_t mipmapLevel );
82 * @brief Gets the color texture at the given @a index used as output in the frame buffer.
84 * @param[in] frameBuffer A handle to the FrameBuffer
85 * @param[in] index The index required
87 * @return A handle to the texture used as color output, or an uninitialized handle
89 * @note A maximum of 8 color attachments are supported. Passing an invalid index will return
90 * an uninitialized handle.
92 Texture GetColorTexture( const FrameBuffer frameBuffer, uint8_t index );
95 * @brief Gets the depth texture used as output in the frame buffer.
97 * @param[in] frameBuffer The FrameBuffer handle
99 * @return A handle of the texture used as depth output, or an uninitialized handle
101 Texture GetDepthTexture( FrameBuffer frameBuffer );
104 * @brief Gets the depth/stencil texture used as output in the frame buffer.
106 * @param[in] frameBuffer The FrameBuffer handle
108 * @return A handle of the texture used as depth/stencil output, or an uninitialized handle
110 Texture GetDepthStencilTexture( FrameBuffer frameBuffer );
112 } // namespace DevelFrameBuffer
116 #endif // DALI_FRAME_BUFFER_DEVEL_H