Linear tiling support for parallel texture upload
authoradam.b <jsr184@gmail.com>
Thu, 21 Feb 2019 18:23:50 +0000 (18:23 +0000)
committeradam.b <jsr184@gmail.com>
Tue, 5 Mar 2019 17:29:23 +0000 (17:29 +0000)
Parallel upload of textures with linear tiling:
- Added API::TextureTiling enum ( optimal, linear )
- Added direct memory copy functionality for linear tiled textures
- Parallelized direct memory copying

Change-Id: I36385ae1f9939808720e1c380143d715b15faf22
Signed-off-by: adam.b <adam.b@samsung.com>
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.cpp
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.h
dali/graphics-api/graphics-api-texture-factory.h
dali/graphics-api/graphics-api-types.h
dali/internal/update/rendering/scene-graph-texture.cpp

index b1844ce2f12f6411234af0ae3b2e976515f55278..642d74241675602dadf976ecc3e880cc1313ffd4 100644 (file)
@@ -61,4 +61,9 @@ Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetNativeImage( Dali::Na
   return *this;
 }
 
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetTiling( Dali::Graphics::TextureTiling tiling )
+{
+  return *this;
+}
+
 } // Test
index 8edb4f9b8037192d5bf70d9670a6018b007a09b7..5e5b19e30d70d3d7399c34a24589c9ca063e3afd 100644 (file)
@@ -37,6 +37,7 @@ public:
   Dali::Graphics::TextureFactory& SetDataSize( uint32_t dataSizeInBytes ) override;
   Dali::Graphics::TextureFactory::PointerType Create() const override;
   Dali::Graphics::TextureFactory& SetNativeImage( Dali::NativeImageInterfacePtr nativeImageInterface ) override;
+  Dali::Graphics::TextureFactory& SetTiling( Dali::Graphics::TextureTiling tiling ) override;
 
 };
 
index 94327cba53965af606c322464ba3215e0ebd8de3..6f704e3d63519986ed2e4661bfd37090cc1e2963 100644 (file)
@@ -42,6 +42,7 @@ public:
   virtual TextureFactory& SetData( void* pData )                         = 0;
   virtual TextureFactory& SetDataSize( uint32_t dataSizeInBytes )        = 0;
   virtual TextureFactory& SetNativeImage( NativeImageInterfacePtr nativeImageInterface ) = 0;
+  virtual TextureFactory& SetTiling( TextureTiling tiling )              = 0;
 
   // not copyable
   TextureFactory(const TextureFactory&) = delete;
index c3953a89469134e1fc46195db7e6b7023528f165..d69792637fba13c387d4d10271dc6d164ed732f9 100644 (file)
@@ -900,6 +900,18 @@ struct TextureProperties
   bool      compressed;
   bool      packed;
   Extent2D  extent2D;
+  bool      directWriteAccessEnabled;
+};
+
+/**
+ * Texture tiling that directly refers to the tiling
+ * mode supported by the Vulkan. Other implementations
+ * of the backend may ignore the value.
+ */
+enum class TextureTiling
+{
+  OPTIMAL,
+  LINEAR
 };
 
 } // Graphics
index bc9e17b2fce292e8aaf59d214d8df51cc6fb871e..f659d956ab237877de8c5b498f91957cfe8144f2 100644 (file)
@@ -376,7 +376,8 @@ void Texture::CreateTextureInternal( Usage usage, unsigned char* buffer, unsigne
                                                            .SetMipMapFlag( Graphics::TextureDetails::MipMapFlag::DISABLED )
                                                            .SetData( buffer )
                                                            .SetDataSize( bufferSize )
-                                                           .SetNativeImage( mNativeImage ));
+                                                           .SetNativeImage( mNativeImage )
+                                                           .SetTiling( Graphics::TextureTiling::LINEAR ));
   }
 }