1 #ifndef DALI_GRAPHICS_SHADER_CREATE_INFO_H
2 #define DALI_GRAPHICS_SHADER_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-shader.h"
26 #include "graphics-types.h"
33 * @brief ShaderCreateInfo contains details of a single shader (not a GL program!)
34 * attached to a specified pipeline stage (ie. vertex shader, fragment shader etc.)
36 struct ShaderCreateInfo
39 * @brief Sets pointer to the extension
41 * The pointer to the extension must be set either to nullptr
42 * or to the valid structure. The structures may create
43 * a chain. The last structure in a chain must point at
46 * @param[in] value pointer to the valid extension structure
47 * @return reference to this structure
49 auto& SetNextExtension(ExtensionCreateInfo* value)
51 nextExtension = value;
56 * @brief Sets pipeline stage the shader will be executed in
58 * @param[in] value valid pipeline stage
59 * @return reference to this structure
61 auto& SetPipelineStage(PipelineStage value)
63 pipelineStage = value;
68 * @brief Sets shader source language
70 * @param[in] value valid source language
71 * @return reference to this structure
73 auto& SetShaderlanguage(ShaderLanguage value)
75 shaderlanguage = value;
80 * @brief Sets pointer to the source data
82 * @param[in] value pointer to the source data
83 * @return reference to this structure
85 auto& SetSourceData(const void* value)
92 * @brief Sets size of the source data (in bytes)
94 * If the shader mode is TEXT, the size must include
97 * @param[in] value size in bytes
98 * @return reference to this structure
100 auto& SetSourceSize(uint32_t value)
107 * @brief Sets shader source mode
109 * @param[in] value shader mode
110 * @return reference to this structure
112 auto& SetSourceMode(ShaderSourceMode value)
119 * @brief Sets allocation callbacks which will be used when object is created
122 * @param[in] value Valid reference to AllocationCallbacksStructure
123 * @return reference to this structure
125 auto& SetAllocationCallbacks(const AllocationCallbacks& value)
127 allocationCallbacks = &value;
131 GraphicsStructureType type{GraphicsStructureType::SHADER_CREATE_INFO_STRUCT};
132 ExtensionCreateInfo* nextExtension{nullptr};
134 PipelineStage pipelineStage{};
135 ShaderLanguage shaderlanguage{};
136 const void* sourceData{nullptr};
137 uint32_t sourceSize{0u};
138 ShaderSourceMode sourceMode{};
140 const AllocationCallbacks* allocationCallbacks{nullptr};
143 } // namespace Graphics
146 #endif // DALI_GRAPHICS_SHADER_CREATE_INFO_H