Updating graphics-api for Vulkan 69/313169/5
authorDavid Steele <david.steele@samsung.com>
Fri, 14 Jun 2024 08:56:47 +0000 (09:56 +0100)
committerDavid Steele <david.steele@samsung.com>
Mon, 8 Jul 2024 10:08:21 +0000 (11:08 +0100)
Change-Id: Ib9eef3cf2901b4fae094891d9ac82939c5be9d49

automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
dali/graphics-api/graphics-command-buffer.h
dali/graphics-api/graphics-render-pass-create-info.h
dali/graphics-api/graphics-render-target-create-info.h
dali/graphics-api/graphics-types.h

index 71bc0517f8c3bc864212fc48b09b0c1dc3e9b83a..97394d5a5c9e954e59dd34b0977f1edbe469bb7e 100644 (file)
@@ -85,8 +85,7 @@ void TestApplication::CreateScene()
   // Create render target for the scene
   Graphics::RenderTargetCreateInfo rtInfo{};
   rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
-  rtInfo.SetSurface(&mSurfaceWidth); // Can point to anything, really.
-
+  rtInfo.SetSurface(reinterpret_cast<Integration::RenderSurface*>(this));
   mScene.SetSurfaceRenderTarget(rtInfo);
 
   mScenes.push_back(mScene);
index 5ff4146a1be47082305ba9122dc50ebfe4071336..58e9b6f197933fcedf4ffafc722078701ccd4d59 100644 (file)
@@ -58,6 +58,21 @@ struct TextureBinding
   const Texture* texture; // texture to be bound
   const Sampler* sampler; // sampler to be bound
   uint32_t       binding; // binding index
+  auto& SetTexture( const Texture* _texture )
+  {
+    texture = _texture;
+    return *this;
+  }
+  auto& SetBinding( uint32_t _binding )
+  {
+    binding = _binding;
+    return *this;
+  }
+  auto& SetSampler( const Sampler* _sampler )
+  {
+    sampler = _sampler;
+    return *this;
+  }
 };
 
 /**
index 9a8223ed5d401e970e20f534c29c1b49c972c372..d195439a0dfd2ef67237bfb2aa5bd98977e89920 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_RENDERPASS_CREATE_INFO_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -64,6 +64,18 @@ struct RenderPassCreateInfo
     return *this;
   }
 
+  /**
+   * @brief Set the render target for this render pass
+   *
+   * @param[in] value The render target to use.
+   * @return reference to this structure.
+   */
+  auto& SetRenderTarget(RenderTarget* value)
+  {
+    renderTarget = value;
+    return *this;
+  }
+
   /**
    * @brief Sets allocation callbacks which will be used when object is created
    * and destroyed.
@@ -80,6 +92,7 @@ struct RenderPassCreateInfo
   GraphicsStructureType                     type{GraphicsStructureType::RENDERPASS_CREATE_INFO_STRUCT};
   ExtensionCreateInfo*                      nextExtension{nullptr};
   const std::vector<AttachmentDescription>* attachments{nullptr};
+  RenderTarget*                             renderTarget{nullptr};
   const AllocationCallbacks*                allocationCallbacks{nullptr};
 };
 
index 9cb92c361aab805249ac95e909202ed29cfcb637..6b3a1319c199bf6a0fa72e434e88cb87da848f49 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_RENDER_TARGET_CREATE_INFO
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
 
 namespace Dali
 {
+namespace Integration
+{
+struct RenderSurface;
+}
 namespace Graphics
 {
 /**
@@ -61,7 +65,7 @@ struct RenderTargetCreateInfo
    * @param[in] value Pointer to the native surface
    * @return reference to this structure
    */
-  auto& SetSurface( Surface* value )
+  auto& SetSurface( Integration::RenderSurface* value )
   {
     surface = value;
     return *this;
@@ -119,7 +123,7 @@ struct RenderTargetCreateInfo
   }
 
   GraphicsStructureType         type{GraphicsStructureType::RENDER_TARGET_CREATE_INFO_STRUCT};
-  Surface*                      surface{nullptr};
+  Integration::RenderSurface*   surface{nullptr};
   Framebuffer*                  framebuffer{nullptr};
   Extent2D                      extent{};
   RenderTargetTransformFlags    preTransform{0u};
index eae22724fae83ebc01d29ef39fe44e29e810f7ba..952171b2a1469d51de17b59e63f51309fd40ac8a 100644 (file)
@@ -1535,11 +1535,6 @@ struct DefaultDeleter
   void (*deleteFunction)(T* object){nullptr}; ///< Custom delete function
 };
 
-/**
- * Surface type is just a void* to any native object.
- */
-using Surface = void;
-
 /**
  * @brief Enum describing preTransform of render target
  */