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