*/
[[nodiscard]] bool GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
+ /**
+ * @brief Gets the types of all the standalone uniforms within the default uniform block.
+ *
+ * @return A vector of uniform types sorted in the same order as the uniforms in the default uniform block.
+ */
+ [[nodiscard]] std::vector<GLenum> GetStandaloneUniformTypes() const;
+
// Sampler
/**
*
* @return A vector of the sampler uniforms
*/
- [[nodiscard]] std::vector<Dali::Graphics::UniformInfo> GetSamplers() const override;
+ const std::vector<Dali::Graphics::UniformInfo>& GetSamplers() const override;
// Language
public:
/**
+ * @brief Extra information of uniform
+ */
+ struct UniformExtraInfo
+ {
+ UniformExtraInfo(uint32_t location, uint32_t size, uint32_t offset, uint32_t arraySize, GLenum type)
+ : location(location),
+ size(size),
+ offset(offset),
+ arraySize(arraySize),
+ type(type){};
+
+ uint32_t location; ///< Location of uniform
+ uint32_t size; ///< size of uniform
+ uint32_t offset; ///< offset of uniform within UBO
+ uint32_t arraySize; ///< number of array elements (1 for non-arrays)
+ GLenum type; ///< type of uniform
+ };
+
+ /**
+ * @brief Returns array of additional info about standalone uniforms
+ *
+ * @return Array of internal uniform data
+ */
+ [[nodiscard]] const std::vector<UniformExtraInfo>& GetStandaloneUniformExtraInfo() const;
+
+ /**
* @brief Build the reflection of vertex attributes
*/
void BuildVertexAttributeReflection();
*/
void BuildUniformBlockReflection();
+ /**
+ * Sort the samplers by their lexical location in the frag shader source code.
+ */
+ void SortOpaques();
+
protected:
Reflection(Reflection&&) = default;
Reflection& operator=(Reflection&&) = default;
Dali::Graphics::VertexInputAttributeFormat format{};
};
- std::vector<AttributeInfo> mVertexInputAttributes; ///< List of vertex attributes
- Graphics::UniformBlockInfo mDefaultUniformBlock{}; ///< The emulated UBO containing all the standalone uniforms
- std::vector<Graphics::UniformInfo> mUniformOpaques{}; ///< List of opaque uniforms (i.e. samplers)
- std::vector<Graphics::UniformBlockInfo> mUniformBlocks{}; ///< List of uniform blocks
+ std::vector<AttributeInfo> mVertexInputAttributes; ///< List of vertex attributes
+ Graphics::UniformBlockInfo mDefaultUniformBlock{}; ///< The emulated UBO containing all the standalone uniforms
+ std::vector<Graphics::UniformInfo> mUniformOpaques{}; ///< List of opaque uniforms (i.e. samplers)
+ std::vector<Graphics::UniformBlockInfo> mUniformBlocks{}; ///< List of uniform blocks
+ std::vector<UniformExtraInfo> mStandaloneUniformExtraInfos; ///< List of extra information for standalone uniforms
};
} // namespace GLES