Multiple fixes
authorFrancisco Santos <f1.santos@samsung.com>
Wed, 4 Apr 2018 13:28:17 +0000 (14:28 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Wed, 4 Apr 2018 13:28:17 +0000 (14:28 +0100)
Change-Id: Ia0b7dc6906f182ac0730d74c1505d1935c348a4e

20 files changed:
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.cpp
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h
dali/graphics/vulkan/vulkan-buffer.h
dali/graphics/vulkan/vulkan-command-buffer.cpp
dali/graphics/vulkan/vulkan-command-buffer.h
dali/graphics/vulkan/vulkan-command-pool.cpp
dali/graphics/vulkan/vulkan-command-pool.h
dali/graphics/vulkan/vulkan-descriptor-set.h
dali/graphics/vulkan/vulkan-fence.h
dali/graphics/vulkan/vulkan-graphics-controller.cpp
dali/graphics/vulkan/vulkan-graphics-texture.cpp
dali/graphics/vulkan/vulkan-graphics.cpp
dali/graphics/vulkan/vulkan-image.h
dali/graphics/vulkan/vulkan-pipeline.h
dali/graphics/vulkan/vulkan-queue.cpp
dali/graphics/vulkan/vulkan-queue.h
dali/graphics/vulkan/vulkan-shader.h
dali/graphics/vulkan/vulkan-types.h
dali/internal/common/math.h
dali/internal/render/renderers/render-texture.h

index 0d78be4..81bd236 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -70,4 +70,4 @@ void GpuMemoryBlock::Flush()
 
 }
 
-}
\ No newline at end of file
+}
index 34ad5a3..4e38a05 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_VULKAN_161117_GPU_MEMORY_MANAGER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -78,7 +78,7 @@ private:
 
 private:
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index 9e508c0..74d2b14 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_VULKAN_BUFFER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -120,7 +120,7 @@ private:
 
 private:
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Buffer::Impl> mImpl;
 };
 
index 6b96904..d03aa2c 100644 (file)
@@ -140,7 +140,6 @@ struct CommandBuffer::Impl
     mGraphics.GetDevice().freeCommandBuffers( mOwnerCommandPool.GetPool(), mCommandBuffer );
   }
 
-#pragma GCC diagnostic pop
 
   /** Push wait semaphores */
   void PushWaitSemaphores( const std::vector<vk::Semaphore>&          semaphores,
@@ -293,7 +292,7 @@ struct CommandBuffer::Impl
       for( auto&& imageBarrier : imageBarriers )
       {
         ImageRef imageResource{};
-        if( imageResource = mGraphics.FindImage( imageBarrier.image ) )
+        if( (imageResource = mGraphics.FindImage( imageBarrier.image )) )
         {
           PushResource( imageResource );
         }
index c312294..1503f12 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_VULKAN_COMMAND_BUFFER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -35,7 +35,7 @@ class DescriptorSet;
 class CommandBuffer : public VkManaged
 {
   friend class CommandPool;
-  friend class CommandBufferPool;
+  friend struct CommandBufferPool;
 
 public:
 
@@ -259,7 +259,7 @@ private:
 
   // Constructor called by the CommandPool only
   CommandBuffer( CommandPool& commandPool, uint32_t poolIndex, const vk::CommandBufferAllocateInfo& allocateInfo, vk::CommandBuffer vkCommandBuffer );
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 
 };
index a4e0cbe..371eaee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -217,7 +217,6 @@ struct CommandPool::Impl
 
   CommandBufferRef NewCommandBuffer( const vk::CommandBufferAllocateInfo& allocateInfo )
   {
-    vk::CommandBufferAllocateInfo info( allocateInfo );
     auto& usedPool = allocateInfo.level == vk::CommandBufferLevel::ePrimary ? *mInternalPoolPrimary.get() : *mInternalPoolSecondary.get();
     auto retval = usedPool.AllocateCommandBuffer( false );
     return retval;
index dab0419..de0b1dd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_VULKAN_COMMANDPOOL
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -122,7 +122,7 @@ private:
 
   CommandPool( Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo );
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 
 };
index 7d4decc..4bdf880 100644 (file)
@@ -83,7 +83,7 @@ private:
 
   DescriptorSet( Graphics& graphics, DescriptorPool& pool, vk::DescriptorSet descriptorSet, vk::DescriptorSetAllocateInfo allocateInfo );
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
@@ -110,7 +110,7 @@ private:
 
   DescriptorPool( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo );
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index db4e6bb..93f4fc8 100644 (file)
@@ -64,7 +64,7 @@ public:
 
 private:
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index e7d856e..f0a3ca7 100644 (file)
@@ -307,7 +307,7 @@ struct Controller::Impl
 
     // return index for quick lookup
     auto index = mTextures.size();
-    return *reinterpret_cast<void**>(&index);
+    return reinterpret_cast<void*>(index);
   }
 
   // resources
index 7018ce2..f024901 100644 (file)
@@ -42,10 +42,6 @@ struct Pixel
 {
   Pixel() = default;
 
-  explicit Pixel( uint32_t _color ) : color( _color )
-  {
-  }
-
   explicit Pixel( uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a )
   {
     components.r = _r;
@@ -54,14 +50,10 @@ struct Pixel
     components.a = _a;
   }
 
-  union
-  {
-    uint32_t color;
     struct
     {
       uint8_t r, g, b, a;
     } components;
-  };
 
   /*
   uint8_t& r = components.r;
@@ -314,4 +306,4 @@ SamplerRef Texture::GetSampler() const
 
 } // namespace Vulkan
 } // namespace Graphics
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
index 655272f..e35db0d 100644 (file)
@@ -209,7 +209,7 @@ void Graphics::CreateInstance( const std::vector<const char*>& extensions, const
   info.setEnabledExtensionCount(U32(extensions.size()))
       .setPpEnabledExtensionNames(extensions.data())
       .setEnabledLayerCount(U32(validationLayers.size()))
-      //.setEnabledLayerCount(0)
+      .setEnabledLayerCount(0)
       .setPpEnabledLayerNames(validationLayers.data());
 
   mInstance = VkAssert(vk::createInstance(info, *mAllocator));
@@ -276,7 +276,7 @@ void Graphics::GetPhysicalDeviceProperties()
 
 void Graphics::GetQueueFamilyProperties()
 {
-  mQueueFamilyProperties = std::move(mPhysicalDevice.getQueueFamilyProperties());
+  mQueueFamilyProperties = mPhysicalDevice.getQueueFamilyProperties();
 }
 
 FBID Graphics::CreateSurface(std::unique_ptr< SurfaceFactory > surfaceFactory)
index 7d53eac..b5b43f6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_VULKAN_IMAGE
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -134,7 +134,7 @@ public:
   }
 
 private:
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
@@ -271,7 +271,7 @@ private:
 
   ImageView( Graphics& graphics, ImageRef image, const VkImageViewCreateInfo& createInfo );
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index 3f1dd8f..a444af3 100644 (file)
@@ -118,7 +118,7 @@ public:
   bool OnDestroy() override;
 
 private:
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index 6af405a..15dfed5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -72,7 +72,7 @@ inline PrepareSemaphoresData PrepareSemaphores(const std::vector< CommandBufferR
                                       cmdbuf->GetWaitSemaphoreStages().end());
     }
   }
-  return std::move(retval);
+  return retval;
 }
 }
 
@@ -89,7 +89,7 @@ bool Submission::WaitForFence(uint32_t timeout)
 // queue
 Queue::Queue(Graphics& graphics, vk::Queue queue, uint32_t queueFamilyIndex, uint32_t queueIndex,
              vk::QueueFlags queueFlags)
-: mGraphics(graphics), mQueue(queue), mFlags(queueFlags), mQueueFamilyIndex(queueFamilyIndex), mQueueIndex(queueIndex)
+: /*mGraphics(graphics),*/ mQueue(queue), mFlags(queueFlags) /*, mQueueFamilyIndex(queueFamilyIndex), mQueueIndex(queueIndex) */
 {
 }
 
index 22c019d..d7819d0 100644 (file)
@@ -80,12 +80,12 @@ private:
 
 
 private:
-  Graphics&                mGraphics;
+  //Graphics&                mGraphics;
   vk::Queue                mQueue;
   vk::QueueFlags           mFlags;
   std::vector< vk::Fence > mFences;
-  uint32_t                 mQueueFamilyIndex;
-  uint32_t                 mQueueIndex;
+  //uint32_t                 mQueueFamilyIndex;
+  //uint32_t                 mQueueIndex;
 };
 
 } // namespace Vulkan
index c4ffe59..042af6c 100644 (file)
@@ -88,7 +88,7 @@ private:
 
 private:
 
-  class Impl;
+  struct Impl;
   std::unique_ptr<Impl> mImpl;
 };
 
index 6e75215..a6e97e2 100644 (file)
@@ -299,7 +299,7 @@ using FBID = int32_t;
 #define NotImplemented() \
 {\
 printf("Function %s isn't implemented!\n", __FUNCTION__);\
-assert( "Function no implemented" );\
+assert( false && "Function no implemented" );\
 }
 
 /*
index af398ec..e1da12c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_MATH_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -21,7 +21,7 @@
 namespace Dali
 {
 
-class Vector2;
+struct Vector2;
 class Matrix;
 
 namespace Internal
index 81299e0..8b1fbaa 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDER_TEXTURE_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -138,7 +138,7 @@ public:
 
   void SetId( void* textureId )
   {
-    mId = *reinterpret_cast<GLuint*>(&textureId);
+    mId = GLuint(size_t(textureId));
   }
 
 private: