X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-renderer.h;h=5583fe0667704d7a472581d31091b7a5bffa3975;hb=eb07b0dfcfa3c654cb7e200e259571c4f8b6e50e;hp=62b82f7503d6a0e554a87e1bde3db6b73a4cd0de;hpb=47e2058146f8567cbb9fd71528cb90c5ad96a191;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/renderers/render-renderer.h b/dali/internal/render/renderers/render-renderer.h index 62b82f7..5583fe0 100644 --- a/dali/internal/render/renderers/render-renderer.h +++ b/dali/internal/render/renderers/render-renderer.h @@ -54,7 +54,9 @@ class RenderInstruction; //for reflection effect namespace Render { struct ShaderCache; +class PipelineCache; class UniformBufferManager; +class PipelineCache; /** * Renderers are used to render meshes @@ -96,7 +98,7 @@ public: * @param[in] dataProviders The data providers for the renderer * @param[in] geometry The geometry for the renderer * @param[in] blendingBitmask A bitmask of blending options. - * @param[in] blendColor The blend color to pass to GL + * @param[in] blendColor The blend color * @param[in] faceCullingMode The face-culling mode. * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied. * @param[in] depthWriteMode Depth buffer write mode @@ -120,7 +122,7 @@ public: * @param[in] dataProviders The data providers for the renderer * @param[in] geometry The geometry for the renderer * @param[in] blendingBitmask A bitmask of blending options. - * @param[in] blendColor The blend color to pass to GL + * @param[in] blendColor The blend color * @param[in] faceCullingMode The face-culling mode. * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied. * @param[in] depthWriteMode Depth buffer write mode @@ -163,11 +165,13 @@ public: * @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 @@ -188,7 +192,7 @@ public: /** * Set the blend color for blending options - * @param[in] blendColor The blend color to pass to GL + * @param[in] blendColor The blend color */ void SetBlendColor(const Vector4& color); @@ -400,22 +404,24 @@ public: template bool WriteDefaultUniform(const Graphics::UniformInfo* uniformInfo, - Render::UniformBuffer& ubo, - const std::vector& bindings, + Render::UniformBufferView& ubo, const T& data); template - void WriteUniform(Render::UniformBuffer& ubo, - const std::vector& bindings, + void WriteUniform(Render::UniformBufferView& ubo, const Graphics::UniformInfo& uniformInfo, const T& data); - void WriteUniform(Render::UniformBuffer& ubo, - const std::vector& 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; @@ -490,7 +496,7 @@ private: */ void FillUniformBuffer(Program& program, const SceneGraph::RenderInstruction& instruction, - Render::UniformBuffer& ubo, + Render::UniformBufferView& ubo, std::vector*& outBindings, uint32_t& offset, BufferIndex updateBufferIndex); @@ -507,7 +513,12 @@ private: Render::UniformBufferManager* mUniformBufferManager{}; std::vector mUniformBufferBindings{}; + Render::PipelineCache* mPipelineCache{nullptr}; + using Hash = unsigned long; + + typedef const float&(PropertyInputImpl::*FuncGetter )(BufferIndex) const; + struct UniformIndexMap { ConstString uniformName; ///< The uniform name @@ -515,12 +526,16 @@ private: 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; UniformIndexMappings mUniformIndexMap; - Vector mAttributeLocations; uint64_t mUniformsHash; struct HashedPipeline @@ -532,7 +547,6 @@ private: return (reinterpret_cast(node) << 32) | ((reinterpret_cast(instruction) & 0xFFFFFFF) << 1) | blend; } }; - std::vector mGraphicsPipelines{}; StencilParameters mStencilParameters; ///< Struct containing all stencil related options BlendingOptions mBlendingOptions; ///< Blending options including blend color, blend func and blend equation @@ -544,14 +558,11 @@ private: 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; std::vector mDrawCommands; // Devel stuff - - Graphics::UniquePtr mUniformBuffer[2]{nullptr, nullptr}; ///< The double-buffered uniform buffer }; } // namespace Render