class SceneController;
class Shader;
class NodeDataProvider;
+
+class RenderInstruction; //for relfection effect
}
namespace Render
*/
void SetGeometry( Render::Geometry* geometry );
+ void SetDrawCommands( Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size );
+
+ /**
+ * @brief Returns a reference to an array of draw commands
+ * @return Valid array of draw commands (may be empty)
+ */
+ const std::vector<Dali::DevelRenderer::DrawCommand>& GetDrawCommands() const
+ {
+ return mDrawCommands;
+ }
+
/**
* Second-phase construction.
* This is called when the renderer is inside render thread
* @param[in] projectionMatrix The projection matrix.
* @param[in] size Size of the render item
* @param[in] blend If true, blending is enabled
+ * @param[in] boundTextures The textures bound for rendering
+ * @param[in] instruction. for use case like reflection where CullFace needs to be adjusted
+
*/
void Render( Context& context,
BufferIndex bufferIndex,
const Matrix& viewMatrix,
const Matrix& projectionMatrix,
const Vector3& size,
- bool blend );
+ bool blend,
+ Vector<GLuint>& boundTextures,
+ const Dali::Internal::SceneGraph::RenderInstruction& instruction,
+ uint32_t queueIndex );
/**
* Write the renderer's sort attributes to the passed in reference
*/
void SetSortAttributes( BufferIndex bufferIndex, SceneGraph::RenderInstructionProcessor::SortAttributes& sortAttributes ) const;
+ /**
+ * Sets the flag indicating whether shader changed.
+ *
+ * @param[in] value True if shader changed
+ */
+ void SetShaderChanged( bool value );
+
+ /**
+ * Check if the renderer attributes/uniforms are updated and returns the flag
+ *
+ * @param[in] bufferIndex The current update buffer index.
+ * @param[in] node The node using this renderer
+ */
+ bool Updated(BufferIndex bufferIndex, const SceneGraph::NodeDataProvider* node);
+
private:
struct UniformIndexMap;
* Bind the textures and setup the samplers
* @param[in] context The GL context
* @param[in] program The shader program
+ * @param[in] boundTextures The textures bound for rendering
* @return False if create or bind failed, true if success.
*/
- bool BindTextures( Context& context, Program& program );
+ bool BindTextures( Context& context, Program& program, Vector<GLuint>& boundTextures );
private:
UniformIndexMappings mUniformIndexMap;
Vector<GLint> mAttributesLocation;
+ uint64_t mUniformsHash;
+
StencilParameters mStencilParameters; ///< Struct containing all stencil related options
BlendingOptions mBlendingOptions; ///< Blending options including blend color, blend func and blend equation
DepthTestMode::Type mDepthTestMode:3; ///< The depth test mode
bool mUpdateAttributesLocation:1; ///< Indicates attribute locations have changed
bool mPremultipledAlphaEnabled: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<Dali::DevelRenderer::DrawCommand> mDrawCommands; // Devel stuff
};
} // namespace SceneGraph