Memory Pool Logging
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles-impl / gles-graphics-command-buffer.h
index 8e2aeac..c2ae566 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_GLES_COMMAND_BUFFER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,6 +66,7 @@ enum class CommandType
   SET_DEPTH_COMPARE_OP,
   SET_DEPTH_TEST_ENABLE,
   SET_DEPTH_WRITE_ENABLE,
+  DRAW_NATIVE,
 };
 
 /**
@@ -215,6 +216,11 @@ struct Command
     {
       bool enabled;
     } colorMask;
+
+    struct
+    {
+      DrawNativeInfo drawNativeInfo;
+    } drawNative;
   };
 };
 
@@ -230,9 +236,9 @@ public:
   /**
    * @copydoc Dali::Graphics::CommandBuffer::BindVertexBuffers
    */
-  void BindVertexBuffers(uint32_t                             firstBinding,
-                         std::vector<const Graphics::Buffer*> buffers,
-                         std::vector<uint32_t>                offsets) override;
+  void BindVertexBuffers(uint32_t                                    firstBinding,
+                         const std::vector<const Graphics::Buffer*>& buffers,
+                         const std::vector<uint32_t>&                offsets) override;
 
   /**
    * @copydoc Dali::Graphics::CommandBuffer::BindUniformBuffers
@@ -247,12 +253,12 @@ public:
   /**
    * @copydoc Dali::Graphics::CommandBuffer::BindTextures
    */
-  void BindTextures(std::vector<TextureBinding>& textureBindings) override;
+  void BindTextures(const std::vector<TextureBinding>& textureBindings) override;
 
   /**
    * @copydoc Dali::Graphics::CommandBuffer::BindSamplers
    */
-  void BindSamplers(std::vector<SamplerBinding>& samplerBindings) override;
+  void BindSamplers(const std::vector<SamplerBinding>& samplerBindings) override;
 
   /**
    * @copydoc Dali::Graphics::CommandBuffer::BindPushConstants
@@ -272,10 +278,10 @@ public:
    * @copydoc Dali::Graphics::CommandBuffer::BeginRenderPass
    */
   void BeginRenderPass(
-    Graphics::RenderPass*   renderPass,
-    Graphics::RenderTarget* renderTarget,
-    Rect2D                  renderArea,
-    std::vector<ClearValue> clearValues) override;
+    Graphics::RenderPass*          renderPass,
+    Graphics::RenderTarget*        renderTarget,
+    Rect2D                         renderArea,
+    const std::vector<ClearValue>& clearValues) override;
 
   /**
    * @copydoc Dali::Graphics::CommandBuffer::EndRenderPass
@@ -316,6 +322,11 @@ public:
     uint32_t          stride) override;
 
   /**
+   * @copydoc Dali::Graphics::CommandBuffer::DrawNative
+   */
+  void DrawNative(const DrawNativeInfo* drawNativeInfo) override;
+
+  /**
    * @copydoc Dali::Graphics::CommandBuffer::Reset
    */
   void Reset() override;
@@ -427,6 +438,9 @@ public:
    */
   void DiscardResource() override;
 
+  // Get the total memory usage of this command buffer
+  std::size_t GetCapacity();
+
 private:
   std::unique_ptr<CommandPool> mCommandPool; ///< Pool of commands and transient memory
 };