namespace Render
{
struct ShaderCache;
+class PipelineCache;
class UniformBufferManager;
+class PipelineCache;
/**
* Renderers are used to render meshes
* @param[in] programCache Cache of program objects
* @param[in] shaderCache Cache of shaders
* @param[in] uniformBufferManager Uniform buffer manager
+ * @param[in] pipelineCache Cache of pipelines
*/
void Initialize(Graphics::Controller& graphicsController,
ProgramCache& programCache,
Render::ShaderCache& shaderCache,
- Render::UniformBufferManager& uniformBufferManager);
+ Render::UniformBufferManager& uniformBufferManager,
+ Render::PipelineCache& pipelineCache);
/**
* Destructor
template<class T>
bool WriteDefaultUniform(const Graphics::UniformInfo* uniformInfo,
Render::UniformBufferView& ubo,
- const std::vector<Graphics::UniformBufferBinding>& bindings,
const T& data);
template<class T>
- void WriteUniform(Render::UniformBufferView& ubo,
- const std::vector<Graphics::UniformBufferBinding>& bindings,
+ void WriteUniform(Render::UniformBufferView& ubo,
const Graphics::UniformInfo& uniformInfo,
const T& data);
- void WriteUniform(Render::UniformBufferView& ubo,
- const std::vector<Graphics::UniformBufferBinding>& bindings,
+ void WriteUniform(Render::UniformBufferView& ubo,
const Graphics::UniformInfo& uniformInfo,
const void* data,
uint32_t size);
+ [[nodiscard]] FaceCullingMode::Type GetFaceCullMode() const
+ {
+ return mFaceCullingMode;
+ }
+
private:
struct UniformIndexMap;
Render::UniformBufferManager* mUniformBufferManager{};
std::vector<Graphics::UniformBufferBinding> mUniformBufferBindings{};
+ Render::PipelineCache* mPipelineCache{nullptr};
+
using Hash = unsigned long;
+
+ typedef const float&(PropertyInputImpl::*FuncGetter )(BufferIndex) const;
+
struct UniformIndexMap
{
ConstString uniformName; ///< The uniform name
Hash uniformNameHash{0u};
Hash uniformNameHashNoArray{0u};
int32_t arrayIndex{-1}; ///< The array index
+
+ int16_t uniformLocation{0u};
+ uint16_t uniformOffset{0u};
+ uint16_t uniformSize{0u};
+ FuncGetter uniformFunc{0};
};
using UniformIndexMappings = Dali::Vector<UniformIndexMap>;
UniformIndexMappings mUniformIndexMap;
- Vector<int32_t> mAttributeLocations;
uint64_t mUniformsHash;
struct HashedPipeline
return (reinterpret_cast<uint64_t>(node) << 32) | ((reinterpret_cast<uint64_t>(instruction) & 0xFFFFFFF) << 1) | blend;
}
};
- std::vector<HashedPipeline> mGraphicsPipelines{};
StencilParameters mStencilParameters; ///< Struct containing all stencil related options
BlendingOptions mBlendingOptions; ///< Blending options including blend color, blend func and blend equation
FaceCullingMode::Type mFaceCullingMode : 3; ///< The mode of face culling
DepthWriteMode::Type mDepthWriteMode : 3; ///< The depth write mode
DepthTestMode::Type mDepthTestMode : 3; ///< The depth test mode
- bool mUpdateAttributeLocations : 1; ///< Indicates attribute locations have changed
bool mPremultipliedAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
bool mShaderChanged : 1; ///< Flag indicating the shader changed and uniform maps have to be updated
bool mUpdated : 1;