1 #ifndef DALI_GRAPHICS_PROGRAM_CREATE_INFO_H
2 #define DALI_GRAPHICS_PROGRAM_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.
20 #include "graphics-program.h"
21 #include "graphics-types.h"
28 * This structure represents the information needed to generate a program.
30 struct ProgramCreateInfo
33 * @brief Sets pointer to the extension
35 * The pointer to the extension must be set either to nullptr
36 * or to the valid structure. The structures may create
37 * a chain. The last structure in a chain must point at
40 * @param[in] value pointer to the valid extension structure
41 * @return reference to this structure
43 auto& SetNextExtension(ExtensionCreateInfo* value)
45 nextExtension = value;
50 * @brief Set the allocation callbacks.
52 * @param[in] value set of allocation callbacks
53 * @return reference to this structure.
55 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
57 allocationCallbacks = &value;
62 * @brief Sets the shader state for the program
64 * The function takes an array of shader states in order to compile
65 * the program. Each ShaderState structure determines the pipeline stage
66 * the shader should be executed on. The Shader object may be already created
67 * with a specific stage.
70 * SetShaderState( { ShaderState().SetShader( vertexShader)
71 * .SetPipelineStage( PipelineStage::VERTEX_SHADER ),
72 * ShaderState().SetShader( fragmentShader )
73 * .SetPipelineStage( PipelineStage::FRAGMENT_SHADER )
76 * In modern graphics API it is possible to attach more than one Shader to a single
77 * stage. For example, one Shader may be just a library of functions:
78 * SetShaderState( { ShaderState().SetShader( vertexShader)
79 * .SetPipelineStage( PipelineStage::VERTEX_SHADER ),
80 * ShaderState().SetShader( shaderCommons )
81 * .SetPipelineStage( PipelineStage::VERTEX_SHADER ),
82 * ShaderState().SetShader( fragmentShader )
83 * .SetPipelineStage( PipelineStage::FRAGMENT_SHADER )
86 * The Program will compile and link all given shaders.
88 * param[in] value Valid array of shder states
89 * @return reference to this structure
91 auto& SetShaderState(const std::vector<ShaderState>& value)
97 GraphicsStructureType type{GraphicsStructureType::PROGRAM_CREATE_INFO_STRUCT};
98 ExtensionCreateInfo* nextExtension{nullptr};
100 const std::vector<ShaderState>* shaderState{nullptr};
101 const AllocationCallbacks* allocationCallbacks{nullptr};
104 } // namespace Graphics
108 #endif //DALI_GRAPHICS_PROGRAM_CREATE_INFO_H