Merge "Make property resetter age down correctly" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / render / renderers / render-renderer.h
1 #ifndef DALI_INTERNAL_RENDER_RENDERER_H
2 #define DALI_INTERNAL_RENDER_RENDERER_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/list-wrapper.h>
23 #include <dali/public-api/common/vector-wrapper.h>
24 #include <dali/public-api/math/matrix.h>
25 #include <dali/public-api/math/vector4.h>
26 #include <dali/public-api/rendering/texture-set.h>
27 #include <dali/public-api/signals/render-callback.h>
28
29 #include <dali/graphics-api/graphics-controller.h>
30 #include <dali/integration-api/debug.h>
31 #include <dali/internal/common/blending-options.h>
32 #include <dali/internal/common/const-string.h>
33 #include <dali/internal/common/message.h>
34 #include <dali/internal/common/type-abstraction-enums.h>
35 #include <dali/internal/event/common/property-input-impl.h>
36 #include <dali/internal/render/data-providers/render-data-provider.h>
37 #include <dali/internal/render/renderers/render-geometry.h>
38 #include <dali/internal/render/renderers/uniform-buffer-manager.h>
39 #include <dali/internal/render/shaders/program.h>
40 #include <dali/internal/update/manager/render-instruction-processor.h>
41
42 namespace Dali
43 {
44 namespace Internal
45 {
46 class Texture;
47 class ProgramCache;
48
49 namespace SceneGraph
50 {
51 class SceneController;
52 class Shader;
53 class NodeDataProvider;
54 class RenderInstruction; //for reflection effect
55 } // namespace SceneGraph
56
57 namespace Render
58 {
59 struct ShaderCache;
60 class PipelineCache;
61 class PipelineCacheL2;
62 class UniformBufferManager;
63 class UniformBufferV2;
64 class Renderer;
65
66 using PipelineCacheL2Container = std::list<PipelineCacheL2>;
67 using PipelineCachePtr         = PipelineCacheL2Container::iterator;
68
69 using RendererKey = MemoryPoolKey<Render::Renderer>;
70 } //namespace Render
71 } //namespace Internal
72
73 // Ensure RendererKey can be used in Dali::Vector
74 template<>
75 struct TypeTraits<Internal::Render::RendererKey> : public BasicTypes<Internal::Render::RendererKey>
76 {
77   enum
78   {
79     IS_TRIVIAL_TYPE = true
80   };
81 };
82
83 namespace Internal
84 {
85 namespace Render
86 {
87 /**
88  * Renderers are used to render meshes
89  * These objects are used during RenderManager::Render(), so properties modified during
90  * the Update must either be double-buffered, or set via a message added to the RenderQueue.
91  */
92 class Renderer
93 {
94 public:
95   /**
96    * @brief Struct to encapsulate stencil parameters required for control of the stencil buffer.
97    */
98   struct StencilParameters
99   {
100     StencilParameters(RenderMode::Type renderMode, StencilFunction::Type stencilFunction, int stencilFunctionMask, int stencilFunctionReference, int stencilMask, StencilOperation::Type stencilOperationOnFail, StencilOperation::Type stencilOperationOnZFail, StencilOperation::Type stencilOperationOnZPass)
101     : stencilFunctionMask(stencilFunctionMask),
102       stencilFunctionReference(stencilFunctionReference),
103       stencilMask(stencilMask),
104       renderMode(renderMode),
105       stencilFunction(stencilFunction),
106       stencilOperationOnFail(stencilOperationOnFail),
107       stencilOperationOnZFail(stencilOperationOnZFail),
108       stencilOperationOnZPass(stencilOperationOnZPass)
109     {
110     }
111
112     int                    stencilFunctionMask;         ///< The stencil function mask
113     int                    stencilFunctionReference;    ///< The stencil function reference
114     int                    stencilMask;                 ///< The stencil mask
115     RenderMode::Type       renderMode : 4;              ///< The render mode
116     StencilFunction::Type  stencilFunction : 4;         ///< The stencil function
117     StencilOperation::Type stencilOperationOnFail : 4;  ///< The stencil operation for stencil test fail
118     StencilOperation::Type stencilOperationOnZFail : 4; ///< The stencil operation for depth test fail
119     StencilOperation::Type stencilOperationOnZPass : 4; ///< The stencil operation for depth test pass
120   };
121
122   /**
123    * @brief Global static initialize for Render::Renderer before new CommandBuffer's Render fill start.
124    */
125   static void PrepareCommandBuffer();
126
127   /**
128    * Create a new renderer instance
129    * @param[in] dataProviders The data providers for the renderer
130    * @param[in] geometry The geometry for the renderer
131    * @param[in] blendingBitmask A bitmask of blending options.
132    * @param[in] blendColor The blend color
133    * @param[in] faceCullingMode The face-culling mode.
134    * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
135    * @param[in] depthWriteMode Depth buffer write mode
136    * @param[in] depthTestMode Depth buffer test mode
137    * @param[in] depthFunction Depth function
138    * @param[in] stencilParameters Struct containing all stencil related options
139    */
140   static RendererKey NewKey(SceneGraph::RenderDataProvider* dataProviders,
141                             Render::Geometry*               geometry,
142                             uint32_t                        blendingBitmask,
143                             const Vector4&                  blendColor,
144                             FaceCullingMode::Type           faceCullingMode,
145                             bool                            preMultipliedAlphaEnabled,
146                             DepthWriteMode::Type            depthWriteMode,
147                             DepthTestMode::Type             depthTestMode,
148                             DepthFunction::Type             depthFunction,
149                             StencilParameters&              stencilParameters);
150
151   /**
152    * Constructor.
153    * @param[in] dataProviders The data providers for the renderer
154    * @param[in] geometry The geometry for the renderer
155    * @param[in] blendingBitmask A bitmask of blending options.
156    * @param[in] blendColor The blend color
157    * @param[in] faceCullingMode The face-culling mode.
158    * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
159    * @param[in] depthWriteMode Depth buffer write mode
160    * @param[in] depthTestMode Depth buffer test mode
161    * @param[in] depthFunction Depth function
162    * @param[in] stencilParameters Struct containing all stencil related options
163    */
164   Renderer(SceneGraph::RenderDataProvider* dataProviders,
165            Render::Geometry*               geometry,
166            uint32_t                        blendingBitmask,
167            const Vector4&                  blendColor,
168            FaceCullingMode::Type           faceCullingMode,
169            bool                            preMultipliedAlphaEnabled,
170            DepthWriteMode::Type            depthWriteMode,
171            DepthTestMode::Type             depthTestMode,
172            DepthFunction::Type             depthFunction,
173            StencilParameters&              stencilParameters);
174
175   /**
176    * Second-phase construction.
177    * This is called when the renderer is inside render thread
178    * @param[in] graphicsController The graphics controller to use
179    * @param[in] programCache Cache of program objects
180    * @param[in] shaderCache Cache of shaders
181    * @param[in] uniformBufferManager Uniform buffer manager
182    * @param[in] pipelineCache Cache of pipelines
183    */
184   void Initialize(Graphics::Controller&         graphicsController,
185                   ProgramCache&                 programCache,
186                   Render::ShaderCache&          shaderCache,
187                   Render::UniformBufferManager& uniformBufferManager,
188                   Render::PipelineCache&        pipelineCache);
189
190   /**
191    * Destructor
192    */
193   ~Renderer();
194
195   /**
196    * Overriden delete operator
197    * Deletes the renderer from its global memory pool
198    */
199   void operator delete(void* ptr);
200
201   /**
202    * Get a pointer to the object from the given key.
203    * Used by MemoryPoolKey to provide pointer semantics.
204    */
205   static Renderer* Get(RendererKey::KeyType rendererKey);
206
207   /**
208    * Change the geometry used by the renderer
209    * @param[in] geometry The new geometry
210    */
211   void SetGeometry(Render::Geometry* geometry);
212
213   void SetDrawCommands(Dali::DevelRenderer::DrawCommand* pDrawCommands, uint32_t size);
214
215   /**
216    * @brief Returns a reference to an array of draw commands
217    * @return Valid array of draw commands (may be empty)
218    */
219   [[nodiscard]] const std::vector<Dali::DevelRenderer::DrawCommand>& GetDrawCommands() const
220   {
221     return mDrawCommands;
222   }
223
224   /**
225    * Set the face-culling mode.
226    * @param[in] mode The face-culling mode.
227    */
228   void SetFaceCullingMode(FaceCullingMode::Type mode);
229
230   /**
231    * Set the bitmask for blending options
232    * @param[in] bitmask A bitmask of blending options.
233    */
234   void SetBlendingBitMask(uint32_t bitmask);
235
236   /**
237    * Set the blend color for blending options
238    * @param[in] blendColor The blend color
239    */
240   void SetBlendColor(const Vector4& color);
241
242   /**
243    * Set the first element index to draw by the indexed draw
244    * @param[in] firstElement index of first element to draw
245    */
246   void SetIndexedDrawFirstElement(uint32_t firstElement);
247
248   /**
249    * Set the number of elements to draw by the indexed draw
250    * @param[in] elementsCount number of elements to draw
251    */
252   void SetIndexedDrawElementsCount(uint32_t elementsCount);
253
254   /**
255    * @brief Set whether the Pre-multiplied Alpha Blending is required
256    *
257    * @param[in] preMultipled whether alpha is pre-multiplied.
258    */
259   void EnablePreMultipliedAlpha(bool preMultipled);
260
261   /**
262    * Sets the depth write mode
263    * @param[in] depthWriteMode The depth write mode
264    */
265   void SetDepthWriteMode(DepthWriteMode::Type depthWriteMode);
266
267   /**
268    * Query the Renderer's depth write mode
269    * @return The renderer depth write mode
270    */
271   [[nodiscard]] DepthWriteMode::Type GetDepthWriteMode() const;
272
273   /**
274    * Sets the depth test mode
275    * @param[in] depthTestMode The depth test mode
276    */
277   void SetDepthTestMode(DepthTestMode::Type depthTestMode);
278
279   /**
280    * Query the Renderer's depth test mode
281    * @return The renderer depth test mode
282    */
283   [[nodiscard]] DepthTestMode::Type GetDepthTestMode() const;
284
285   /**
286    * Sets the depth function
287    * @param[in] depthFunction The depth function
288    */
289   void SetDepthFunction(DepthFunction::Type depthFunction);
290
291   /**
292    * Query the Renderer's depth function
293    * @return The renderer depth function
294    */
295   [[nodiscard]] DepthFunction::Type GetDepthFunction() const;
296
297   /**
298    * Sets the render mode
299    * @param[in] renderMode The render mode
300    */
301   void SetRenderMode(RenderMode::Type mode);
302
303   /**
304    * Gets the render mode
305    * @return The render mode
306    */
307   [[nodiscard]] RenderMode::Type GetRenderMode() const;
308
309   /**
310    * Sets the stencil function
311    * @param[in] stencilFunction The stencil function
312    */
313   void SetStencilFunction(StencilFunction::Type stencilFunction);
314
315   /**
316    * Gets the stencil function
317    * @return The stencil function
318    */
319   [[nodiscard]] StencilFunction::Type GetStencilFunction() const;
320
321   /**
322    * Sets the stencil function mask
323    * @param[in] stencilFunctionMask The stencil function mask
324    */
325   void SetStencilFunctionMask(int stencilFunctionMask);
326
327   /**
328    * Gets the stencil function mask
329    * @return The stencil function mask
330    */
331   [[nodiscard]] int GetStencilFunctionMask() const;
332
333   /**
334    * Sets the stencil function reference
335    * @param[in] stencilFunctionReference The stencil function reference
336    */
337   void SetStencilFunctionReference(int stencilFunctionReference);
338
339   /**
340    * Gets the stencil function reference
341    * @return The stencil function reference
342    */
343   [[nodiscard]] int GetStencilFunctionReference() const;
344
345   /**
346    * Sets the stencil mask
347    * @param[in] stencilMask The stencil mask
348    */
349   void SetStencilMask(int stencilMask);
350
351   /**
352    * Gets the stencil mask
353    * @return The stencil mask
354    */
355   [[nodiscard]] int GetStencilMask() const;
356
357   /**
358    * Sets the stencil operation for when the stencil test fails
359    * @param[in] stencilOperationOnFail The stencil operation
360    */
361   void SetStencilOperationOnFail(StencilOperation::Type stencilOperationOnFail);
362
363   /**
364    * Gets the stencil operation for when the stencil test fails
365    * @return The stencil operation
366    */
367   [[nodiscard]] StencilOperation::Type GetStencilOperationOnFail() const;
368
369   /**
370    * Sets the stencil operation for when the depth test fails
371    * @param[in] stencilOperationOnZFail The stencil operation
372    */
373   void SetStencilOperationOnZFail(StencilOperation::Type stencilOperationOnZFail);
374
375   /**
376    * Gets the stencil operation for when the depth test fails
377    * @return The stencil operation
378    */
379   [[nodiscard]] StencilOperation::Type GetStencilOperationOnZFail() const;
380
381   /**
382    * Sets the stencil operation for when the depth test passes
383    * @param[in] stencilOperationOnZPass The stencil operation
384    */
385   void SetStencilOperationOnZPass(StencilOperation::Type stencilOperationOnZPass);
386
387   /**
388    * Gets the stencil operation for when the depth test passes
389    * @return The stencil operation
390    */
391   [[nodiscard]] StencilOperation::Type GetStencilOperationOnZPass() const;
392
393   /**
394    * Called to upload during RenderManager::Render().
395    */
396   void Upload();
397
398   /**
399    * Called to render during RenderManager::Render().
400    * @param[in,out] commandBuffer The command buffer to write into
401    * @param[in] bufferIndex The index of the previous update buffer.
402    * @param[in] node The node using this renderer
403    * @param[in] modelViewMatrix The model-view matrix.
404    * @param[in] viewMatrix The view matrix.
405    * @param[in] projectionMatrix The projection matrix.
406    * @param[in] size Size of the render item
407    * @param[in] blend If true, blending is enabled
408    * @param[in] instruction. for use case like reflection where CullFace needs to be adjusted
409    *
410    * @return True if commands have been added to the command buffer
411    */
412   bool Render(Graphics::CommandBuffer&                             commandBuffer,
413               BufferIndex                                          bufferIndex,
414               const SceneGraph::NodeDataProvider&                  node,
415               const Matrix&                                        modelMatrix,
416               const Matrix&                                        modelViewMatrix,
417               const Matrix&                                        viewMatrix,
418               const Matrix&                                        projectionMatrix,
419               const Vector3&                                       size,
420               bool                                                 blend,
421               const Dali::Internal::SceneGraph::RenderInstruction& instruction,
422               uint32_t                                             queueIndex);
423
424   /**
425    * Returns true if this will create a draw command with it's own geometry
426    * and shader. Some renderers don't have a shader/geometry, e.g. drawable-actor
427    * creates an empty renderer.
428    */
429   bool NeedsProgram() const;
430
431   /**
432    * If we need a program, prepare it and return it.
433    * @param[in] instruction The render instruction
434    * @return the prepared program, or nullptr.
435    */
436   Program* PrepareProgram(const SceneGraph::RenderInstruction& instruction);
437
438   /**
439    * Sets RenderCallback object
440    *
441    * @param[in] callback Valid pointer to RenderCallback object
442    */
443   void SetRenderCallback(RenderCallback* callback);
444
445   /**
446    * Returns currently set RenderCallback object
447    *
448    * @return Valid pointer to RenderCallback object or nullptr
449    */
450   RenderCallback* GetRenderCallback()
451   {
452     return mRenderCallback;
453   }
454
455   /**
456    * Returns internal RenderCallbackInput structure
457    * @return Valid reference to the RenderCallbackInput
458    */
459   RenderCallbackInput& GetRenderCallbackInput()
460   {
461     if(!mRenderCallbackInput)
462     {
463       mRenderCallbackInput = std::unique_ptr<RenderCallbackInput>(new RenderCallbackInput);
464     }
465     return *mRenderCallbackInput;
466   }
467
468   /**
469    * Write the renderer's sort attributes to the passed in reference
470    *
471    * @param[out] sortAttributes
472    */
473   void SetSortAttributes(SceneGraph::RenderInstructionProcessor::SortAttributes& sortAttributes) const;
474
475   /**
476    * Sets the flag indicating whether shader changed.
477    *
478    * @param[in] value True if shader changed
479    */
480   void SetShaderChanged(bool value);
481
482   /**
483    * Check if the renderer attributes/uniforms are updated and returns the flag
484    */
485   bool Updated();
486
487   template<class T>
488   bool WriteDefaultUniform(const Graphics::UniformInfo* uniformInfo,
489                            Render::UniformBufferView&   ubo,
490                            const T&                     data);
491
492   template<class T>
493   bool WriteDefaultUniformV2(const Graphics::UniformInfo*                                   uniformInfo,
494                              const std::vector<std::unique_ptr<Render::UniformBufferView>>& uboViews,
495                              const T&                                                       data);
496
497   template<class T>
498   void WriteUniform(Render::UniformBufferView&   ubo,
499                     const Graphics::UniformInfo& uniformInfo,
500                     const T&                     data);
501
502   static void WriteUniform(Render::UniformBufferView&   ubo,
503                            const Graphics::UniformInfo& uniformInfo,
504                            const void*                  data,
505                            uint32_t                     size);
506
507   [[nodiscard]] FaceCullingMode::Type GetFaceCullMode() const
508   {
509     return mFaceCullingMode;
510   }
511
512   /**
513    * @brief Gets update area after visual properties applied.
514    *
515    * @param[in] bufferIndex The index of the previous update buffer.
516    * @param[in] originalUpdateArea The original update area before apply the visual properties.
517    *
518    * @return The recalculated update area after visual properties applied.
519    */
520   Vector4 GetVisualTransformedUpdateArea(BufferIndex bufferIndex, const Vector4& originalUpdateArea) const noexcept;
521
522   /**
523    * Detach a Renderer from the node provider.
524    * @param[in] node The node data provider to be detached renderer.
525    */
526   void DetachFromNodeDataProvider(const SceneGraph::NodeDataProvider& node);
527
528   /**
529    * @brief Gets the update area of textures.
530    *
531    * @return The updated area of textures
532    */
533   Vector4 GetTextureUpdateArea() const noexcept;
534
535 private:
536   struct UniformIndexMap;
537
538   // Undefined
539   Renderer(const Renderer&);
540
541   // Undefined
542   Renderer& operator=(const Renderer& rhs);
543
544   /**
545    * Builds a uniform map based on the index of the cached location in the Program.
546    * @param[in] bufferIndex The index of the previous update buffer.
547    * @param[in] node The node using the renderer
548    * @param[in] size The size of the renderer
549    * @param[in] program The shader program on which to set the uniforms.
550    *
551    * @return the index of the node in change counters store / uniform maps store.
552    */
553   std::size_t BuildUniformIndexMap(BufferIndex bufferIndex, const SceneGraph::NodeDataProvider& node, const Vector3& size, Program& program);
554
555   /**
556    * Bind the textures and setup the samplers
557    * @param[in] commandBuffer The command buffer to record binding into
558    *
559    * @return True if all textures are bounded successfully. False otherwise.
560    */
561   bool BindTextures(Graphics::CommandBuffer& commandBuffer);
562
563   /**
564    * Prepare a pipeline for this renderer.
565    *
566    * As a renderer can be re-used in a single frame (e.g. being used by multiple nodes, or
567    * by non-exclusive render tasks), we store a pipeline per node/instruction.
568    * In practice, the implementation will cached pipelines, so we normally only have
569    * multiple handles.
570    */
571   Graphics::Pipeline& PrepareGraphicsPipeline(
572     Program&                                             program,
573     const Dali::Internal::SceneGraph::RenderInstruction& instruction,
574     const SceneGraph::NodeDataProvider&                  node,
575     bool                                                 blend);
576
577   /**
578    * Setup and write data to the uniform buffer
579    *
580    * @param[in] bufferIndex The current buffer index
581    * @param[in] commandBuffer The command buffer to bind the uniform buffer to
582    * @param[in] node The node using this renderer
583    * @param[in] modelViewMatrix The model-view matrix.
584    * @param[in] viewMatrix The view matrix.
585    * @param[in] projectionMatrix The projection matrix.
586    * @param[in] size Size of the render item
587    * @param[in] blend If true, blending is enabled
588    * @param[in] instruction The render instruction
589    * @param[in] The node index
590    */
591   void WriteUniformBuffer(BufferIndex                          bufferIndex,
592                           Graphics::CommandBuffer&             commandBuffer,
593                           Program*                             program,
594                           const SceneGraph::RenderInstruction& instruction,
595                           const SceneGraph::NodeDataProvider&  node,
596                           const Matrix&                        modelMatrix,
597                           const Matrix&                        modelViewMatrix,
598                           const Matrix&                        viewMatrix,
599                           const Matrix&                        projectionMatrix,
600                           const Vector3&                       size,
601                           std::size_t                          nodeIndex);
602
603   /**
604    * @brief Fill uniform buffer at index. Writes uniforms into given memory address
605    *
606    * @param[in] instruction The render instruction
607    * @param[in] uboViews Target uniform buffer object
608    * @param[in] updateBufferIndex update buffer index
609    * @param[in] nodeIndex Index of node/renderer pair in mUniformIndexMaps
610    */
611   void FillUniformBuffer(Program&                                                       program,
612                          const SceneGraph::RenderInstruction&                           instruction,
613                          const std::vector<std::unique_ptr<Render::UniformBufferView>>& uboViews,
614                          BufferIndex                                                    updateBufferIndex,
615                          std::size_t                                                    nodeIndex);
616
617 private:
618   Graphics::Controller*           mGraphicsController;
619   SceneGraph::RenderDataProvider* mRenderDataProvider;
620
621   Render::Geometry* mGeometry;
622
623   ProgramCache*        mProgramCache{nullptr};
624   Render::ShaderCache* mShaderCache{nullptr};
625
626   Render::UniformBufferManager*               mUniformBufferManager{};
627   std::vector<Graphics::UniformBufferBinding> mUniformBufferBindings{};
628
629   Render::PipelineCache* mPipelineCache{nullptr};
630   PipelineCachePtr       mPipeline{};
631
632   using Hash = std::size_t;
633
634   typedef const float& (PropertyInputImpl::*FuncGetter)(BufferIndex) const;
635
636   struct UniformIndexMap
637   {
638     ConstString              uniformName;            ///< The uniform name
639     const PropertyInputImpl* propertyValue{nullptr}; ///< The property value
640     Hash                     uniformNameHash{0u};
641     Hash                     uniformNameHashNoArray{0u};
642     int32_t                  arrayIndex{-1}; ///< The array index
643
644     int16_t    uniformLocation{0u};
645     uint16_t   uniformOffset{0u};
646     uint16_t   uniformSize{0u};
647     uint16_t   uniformBlockIndex{0u};
648     FuncGetter uniformFunc{0};
649   };
650
651   StencilParameters mStencilParameters; ///< Struct containing all stencil related options
652   BlendingOptions   mBlendingOptions;   ///< Blending options including blend color, blend func and blend equation
653
654   uint32_t mIndexedDrawFirstElement;  ///< Offset of first element to draw
655   uint32_t mIndexedDrawElementsCount; ///< Number of elements to draw
656
657   /** Struct to map node to index into mNodeMapCounters and mUniformIndexMaps */
658   struct RenderItemLookup
659   {
660     const SceneGraph::NodeDataProvider* node{nullptr};    ///< Node key. It can be nullptr if this NodeIndex don't need node uniform
661     const Program*                      program{nullptr}; ///< Program key.
662
663     std::size_t index{0};                       ///<Index into mUniformIndexMap
664     std::size_t nodeChangeCounter{0};           ///<The last known change counter for this node's uniform map
665     std::size_t renderItemMapChangeCounter{0u}; ///< Change counter of the renderer & shader collected uniform map for this render item (node/renderer pair)
666   };
667   std::vector<RenderItemLookup> mNodeIndexMap; ///< usually only 1 element.
668   using UniformIndexMappings = std::vector<UniformIndexMap>;
669   std::vector<UniformIndexMappings> mUniformIndexMaps; ///< Cached map per node/renderer/shader.
670
671   DepthFunction::Type   mDepthFunction : 4;             ///< The depth function
672   FaceCullingMode::Type mFaceCullingMode : 3;           ///< The mode of face culling
673   DepthWriteMode::Type  mDepthWriteMode : 3;            ///< The depth write mode
674   DepthTestMode::Type   mDepthTestMode : 3;             ///< The depth test mode
675   bool                  mPremultipliedAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
676   bool                  mShaderChanged : 1;             ///< Flag indicating the shader changed and uniform maps have to be updated
677   bool                  mPipelineCached : 1;            ///< Flag indicating whether renderer cache valid pipeline or not.
678
679   std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands; // Devel stuff
680   RenderCallback*                               mRenderCallback{nullptr};
681   std::unique_ptr<RenderCallbackInput>          mRenderCallbackInput{nullptr};
682   std::vector<Graphics::Texture*>               mRenderCallbackTextureBindings{};
683
684   Program* mCurrentProgram{nullptr}; ///< Prefetched program
685 };
686
687 } // namespace Render
688
689 } // namespace Internal
690
691 } // namespace Dali
692
693 #endif // DALI_INTERNAL_RENDER_RENDERER_H