1 #ifndef DALI_GRAPHICS_PIPELINE_CREATE_INFO_H
2 #define DALI_GRAPHICS_PIPELINE_CREATE_INFO_H
5 * Copyright (c) 2021 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.
25 #include "graphics-pipeline.h"
26 #include "graphics-types.h"
33 * @brief Interface class for generating Pipeline types in the graphics API.
35 * Pipeline after creation stays immutable unless the dynamic states flag is set.
36 * Dynamic states are set as a bitmask indicating which pipeline states will
37 * be changed dynamically by issuing a command in from the command buffer.
39 * The dynamic states are listed in Dali::Graphics::PipelineDynamicStateBits.
41 struct PipelineCreateInfo
44 * @brief Sets pointer to the extension
46 * The pointer to the extension must be set either to nullptr
47 * or to the valid structure. The structures may create
48 * a chain. The last structure in a chain must point at
51 * @param[in] value pointer to the valid extension structure
52 * @return reference to this structure
54 auto& SetNextExtension(ExtensionCreateInfo* value)
56 nextExtension = value;
61 * @brief Set the program
64 * @return a reference to this structure
66 auto& SetProgramState(ProgramState* value)
73 * @brief Sets the color blend state
74 * @param[in] value pointer to valid color blend state structure
75 * @return reference to this structure
77 auto& SetColorBlendState(ColorBlendState* value)
79 colorBlendState = value;
84 * @brief Sets the viewport state.
86 * @param[in] value pointer to valid viewport state structure
87 * @return reference to this structure
89 auto& SetViewportState(ViewportState* value)
91 viewportState = value;
96 * @brief Sets the framebuffer state.
98 * @param[in] value pointer to valid framebuffer state structure
99 * @return reference to this structure
101 auto& SetFramebufferState(FramebufferState* value)
103 framebufferState = value;
108 * @brief Sets the base pipeline.
110 * Setting base pipeline allows inheriting that pipeline state
111 * and build the new pipeline from it. The base pipeline
112 * must stay valid until derived pipeline needs it.
114 * @param[in] value pointer to valid pipeline object
115 * @return reference to this structure
117 auto& SetBasePipeline(Pipeline* value)
119 basePipeline = value;
124 * @brief Sets the depth/stencil state.
126 * @param[in] pointer to valid depth/stencil state structure
127 * @return reference to this structure
129 auto& SetDepthStencilState(DepthStencilState* value)
131 depthStencilState = value;
136 * @brief Sets the rasterization state.
138 * @param[in] pointer to valid rasterization state structure
139 * @return reference to this structure
141 auto& SetRasterizationState(RasterizationState* value)
143 rasterizationState = value;
148 * @brief Sets the vertex input state.
150 * Vertex input state describes format of vertices and must
151 * be compatible with attached shaders.
153 * @param[in] pointer to vertex input state structure
154 * @return reference to this structure
156 auto& SetVertexInputState(VertexInputState* value)
158 vertexInputState = value;
163 * @brief Sets the input assembly state.
165 * This state describes the topology of the pipeline.
167 * @param[in] pointer to valid input assembly state structure
168 * @return reference to this structure
170 auto& SetInputAssemblyState(InputAssemblyState* value)
172 inputAssemblyState = value;
177 * @brief Sets the dynamic state mask.
179 * Certain states can be modified on fly without a need of
180 * creating new pipeline. The commands which modify particular
181 * states may be issued later by executing command buffers.
183 * @param[in] pointer to valid color blend state structure
184 * @return reference to this structure
186 auto& SetDynamicStateMask(PipelineDynamicStateMask value)
188 dynamicStateMask = value;
193 * @brief Sets allocation callbacks which will be used when object is created
196 * @param[in] value Valid reference to AllocationCallbacksStructure
197 * @return reference to this structure
199 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
201 allocationCallbacks = &value;
205 GraphicsStructureType type{GraphicsStructureType::PIPELINE_CREATE_INFO_STRUCT};
206 ExtensionCreateInfo* nextExtension{nullptr};
208 ProgramState* programState{nullptr};
209 ColorBlendState* colorBlendState{nullptr};
210 ViewportState* viewportState{nullptr};
211 FramebufferState* framebufferState{nullptr};
212 Pipeline* basePipeline{nullptr};
213 DepthStencilState* depthStencilState{nullptr};
214 RasterizationState* rasterizationState{nullptr};
215 VertexInputState* vertexInputState{nullptr};
216 InputAssemblyState* inputAssemblyState{nullptr};
217 PipelineDynamicStateMask dynamicStateMask{0u};
219 const AllocationCallbacks* allocationCallbacks{nullptr};
222 } // namespace Graphics
225 #endif // DALI_GRAPHICS_PIPELINE_CREATE_INFO_H