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 base pipeline.
98 * Setting base pipeline allows inheriting that pipeline state
99 * and build the new pipeline from it. The base pipeline
100 * must stay valid until derived pipeline needs it.
102 * @param[in] value pointer to valid pipeline object
103 * @return reference to this structure
105 auto& SetBasePipeline(Pipeline* value)
107 basePipeline = value;
112 * @brief Sets the depth/stencil state.
114 * @param[in] pointer to valid depth/stencil state structure
115 * @return reference to this structure
117 auto& SetDepthStencilState(DepthStencilState* value)
119 depthStencilState = value;
124 * @brief Sets the rasterization state.
126 * @param[in] pointer to valid rasterization state structure
127 * @return reference to this structure
129 auto& SetRasterizationState(RasterizationState* value)
131 rasterizationState = value;
136 * @brief Sets the vertex input state.
138 * Vertex input state describes format of vertices and must
139 * be compatible with attached shaders.
141 * @param[in] pointer to vertex input state structure
142 * @return reference to this structure
144 auto& SetVertexInputState(VertexInputState* value)
146 vertexInputState = value;
151 * @brief Sets the input assembly state.
153 * This state describes the topology of the pipeline.
155 * @param[in] pointer to valid input assembly state structure
156 * @return reference to this structure
158 auto& SetInputAssemblyState(InputAssemblyState* value)
160 inputAssemblyState = value;
165 * @brief Sets the dynamic state mask.
167 * Certain states can be modified on fly without a need of
168 * creating new pipeline. The commands which modify particular
169 * states may be issued later by executing command buffers.
171 * @param[in] pointer to valid color blend state structure
172 * @return reference to this structure
174 auto& SetDynamicStateMask(PipelineDynamicStateMask value)
176 dynamicStateMask = value;
181 * @brief Sets allocation callbacks which will be used when object is created
184 * @param[in] value Valid reference to AllocationCallbacksStructure
185 * @return reference to this structure
187 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
189 allocationCallbacks = &value;
193 GraphicsStructureType type{GraphicsStructureType::PIPELINE_CREATE_INFO_STRUCT};
194 ExtensionCreateInfo* nextExtension{nullptr};
196 ProgramState* programState{nullptr};
197 ColorBlendState* colorBlendState{nullptr};
198 ViewportState* viewportState{nullptr};
199 Pipeline* basePipeline{nullptr};
200 DepthStencilState* depthStencilState{nullptr};
201 RasterizationState* rasterizationState{nullptr};
202 VertexInputState* vertexInputState{nullptr};
203 InputAssemblyState* inputAssemblyState{nullptr};
204 PipelineDynamicStateMask dynamicStateMask{0u};
206 const AllocationCallbacks* allocationCallbacks{nullptr};
209 } // namespace Graphics
212 #endif // DALI_GRAPHICS_PIPELINE_CREATE_INFO_H