Browse Source

Refactoring

Panagiotis Christopoulos Charitos 10 years ago
parent
commit
93bb78f116
80 changed files with 247 additions and 230 deletions
  1. BIN
      engine_data/DefaultLut.ankitex
  2. 28 28
      include/anki/core/NativeWindow.h
  3. 1 1
      include/anki/core/NativeWindowAndroid.h
  4. 1 1
      include/anki/core/NativeWindowEglFbdev.h
  5. 8 6
      include/anki/gr/CommandBuffer.h
  6. 5 5
      include/anki/gr/Common.h
  7. 6 6
      include/anki/gr/Framebuffer.h
  8. 2 4
      include/anki/gr/GrManager.h
  9. 3 3
      include/anki/gr/Pipeline.h
  10. 2 2
      include/anki/gr/ResourceGroup.h
  11. 1 1
      include/anki/gr/Sampler.h
  12. 4 4
      include/anki/gr/Texture.h
  13. 1 1
      include/anki/gr/gl/CommandBufferImpl.h
  14. 2 2
      include/anki/gr/gl/FramebufferImpl.h
  15. 1 1
      include/anki/gr/gl/GrManagerImpl.h
  16. 2 2
      include/anki/gr/gl/PipelineImpl.h
  17. 2 2
      include/anki/gr/gl/ResourceGroupImpl.h
  18. 2 2
      include/anki/gr/gl/SamplerImpl.h
  19. 1 1
      include/anki/gr/gl/TextureImpl.h
  20. 3 5
      include/anki/physics/PhysicsBody.h
  21. 12 10
      include/anki/physics/PhysicsCollisionShape.h
  22. 3 5
      include/anki/physics/PhysicsPlayerController.h
  23. 1 1
      include/anki/resource/Material.h
  24. 2 2
      include/anki/resource/Model.h
  25. 13 13
      include/anki/resource/ResourceManager.h
  26. 3 0
      include/anki/util/Memory.h
  27. 8 4
      shaders/DownscaleBlur.frag.glsl
  28. 3 3
      src/core/App.cpp
  29. 2 2
      src/core/NativeWindowAndroid.cpp
  30. 1 1
      src/core/NativeWindowDummy.cpp
  31. 2 2
      src/core/NativeWindowEglFbdev.cpp
  32. 1 1
      src/core/NativeWindowSdl.cpp
  33. 3 2
      src/gr/gl/CommandBufferImpl.cpp
  34. 3 3
      src/gr/gl/Framebuffer.cpp
  35. 1 1
      src/gr/gl/FramebufferImpl.cpp
  36. 1 1
      src/gr/gl/GrManager.cpp
  37. 1 1
      src/gr/gl/GrManagerImpl.cpp
  38. 3 3
      src/gr/gl/Pipeline.cpp
  39. 2 3
      src/gr/gl/PipelineImpl.cpp
  40. 3 3
      src/gr/gl/ResourceGroup.cpp
  41. 2 2
      src/gr/gl/ResourceGroupImpl.cpp
  42. 3 3
      src/gr/gl/Sampler.cpp
  43. 1 1
      src/gr/gl/SamplerImpl.cpp
  44. 3 3
      src/gr/gl/Texture.cpp
  45. 2 2
      src/gr/gl/TextureImpl.cpp
  46. 1 1
      src/physics/PhysicsBody.cpp
  47. 4 3
      src/physics/PhysicsCollisionShape.cpp
  48. 2 1
      src/physics/PhysicsPlayerController.cpp
  49. 4 4
      src/renderer/Bloom.cpp
  50. 1 1
      src/renderer/Dbg.cpp
  51. 2 2
      src/renderer/DebugDrawer.cpp
  52. 5 7
      src/renderer/DownscaleBlur.cpp
  53. 2 2
      src/renderer/Fs.cpp
  54. 5 5
      src/renderer/Ir.cpp
  55. 3 3
      src/renderer/Is.cpp
  56. 3 3
      src/renderer/Lf.cpp
  57. 2 2
      src/renderer/MainRenderer.cpp
  58. 1 1
      src/renderer/Ms.cpp
  59. 2 2
      src/renderer/Pps.cpp
  60. 2 2
      src/renderer/Renderer.cpp
  61. 2 2
      src/renderer/Sm.cpp
  62. 7 7
      src/renderer/Ssao.cpp
  63. 2 2
      src/renderer/Sslf.cpp
  64. 2 2
      src/renderer/Tiler.cpp
  65. 2 2
      src/renderer/Tm.cpp
  66. 4 4
      src/renderer/Upsample.cpp
  67. 1 1
      src/resource/CollisionResource.cpp
  68. 2 2
      src/resource/Material.cpp
  69. 6 6
      src/resource/Model.cpp
  70. 1 1
      src/resource/ParticleEmitterResource.cpp
  71. 1 1
      src/resource/ResourceManager.cpp
  72. 1 1
      src/resource/TextureResource.cpp
  73. 1 1
      src/scene/BodyNode.cpp
  74. 1 1
      src/scene/LensFlareComponent.cpp
  75. 2 3
      src/scene/ParticleEmitter.cpp
  76. 1 1
      src/scene/PlayerNode.cpp
  77. 1 1
      src/scene/StaticCollisionNode.cpp
  78. 3 3
      src/ui/UiInterfaceImpl.cpp
  79. 13 0
      src/util/Memory.cpp
  80. 1 1
      tests/resource/ResourceManager.cpp

BIN
engine_data/DefaultLut.ankitex


+ 28 - 28
include/anki/core/NativeWindow.h

@@ -16,37 +16,37 @@ namespace anki
 class NativeWindowImpl;
 class NativeWindowImpl;
 using Context = void*;
 using Context = void*;
 
 
+/// Window initializer
+struct NativeWindowInitInfo
+{
+	U32 m_width = 640;
+	U32 m_height = 768;
+	Array<U32, 4> m_rgbaBits = {{8, 8, 8, 0}};
+	U32 m_depthBits = 0;
+	U32 m_stencilBits = 0;
+	U32 m_samplesCount = 0;
+	static const Bool m_doubleBuffer = true;
+	/// Create a fullscreen window with the desktop's resolution
+	Bool8 m_fullscreenDesktopRez = false;
+
+	/// @name GL context properties
+	/// @{
+
+	/// Minor OpenGL version. Used to create core profile context
+	U32 m_minorVersion = 0;
+	/// Major OpenGL version. Used to create core profile context
+	U32 m_majorVersion = 0;
+	Bool8 m_useGles = false; ///< Use OpenGL ES
+	Bool8 m_debugContext = false; ///< Enables KHR_debug
+	/// @}
+
+	const char* m_title = "Untitled window";
+};
+
 /// Native window with GL context
 /// Native window with GL context
 class NativeWindow
 class NativeWindow
 {
 {
 public:
 public:
-	/// Window initializer
-	struct Initializer
-	{
-		U32 m_width = 640;
-		U32 m_height = 768;
-		Array<U32, 4> m_rgbaBits = {{8, 8, 8, 0}};
-		U32 m_depthBits = 0;
-		U32 m_stencilBits = 0;
-		U32 m_samplesCount = 0;
-		static const Bool m_doubleBuffer = true;
-		/// Create a fullscreen window with the desktop's resolution
-		Bool8 m_fullscreenDesktopRez = false;
-
-		/// @name GL context properties
-		/// @{
-
-		/// Minor OpenGL version. Used to create core profile context
-		U32 m_minorVersion = 0;
-		/// Major OpenGL version. Used to create core profile context
-		U32 m_majorVersion = 0;
-		Bool8 m_useGles = false; ///< Use OpenGL ES
-		Bool8 m_debugContext = false; ///< Enables KHR_debug
-		/// @}
-
-		const char* m_title = "Untitled window";
-	};
-
 	NativeWindow()
 	NativeWindow()
 	{
 	{
 	}
 	}
@@ -57,7 +57,7 @@ public:
 	}
 	}
 
 
 	ANKI_USE_RESULT Error create(
 	ANKI_USE_RESULT Error create(
-		Initializer& initializer, HeapAllocator<U8>& alloc);
+		NativeWindowInitInfo& initializer, HeapAllocator<U8>& alloc);
 
 
 	NativeWindowImpl& getNative()
 	NativeWindowImpl& getNative()
 	{
 	{

+ 1 - 1
include/anki/core/NativeWindowAndroid.h

@@ -25,7 +25,7 @@ struct NativeWindowImpl
 		destroy();
 		destroy();
 	}
 	}
 
 
-	void create(NativeWindowInitializer& init);
+	void create(NativeWindowInitInfo& init);
 	void destroy();
 	void destroy();
 };
 };
 
 

+ 1 - 1
include/anki/core/NativeWindowEglFbdev.h

@@ -26,7 +26,7 @@ struct NativeWindowImpl
 		destroy();
 		destroy();
 	}
 	}
 
 
-	void create(NativeWindowInitializer& init);
+	void create(NativeWindowInitInfo& init);
 	void destroy();
 	void destroy();
 };
 };
 
 

+ 8 - 6
include/anki/gr/CommandBuffer.h

@@ -67,6 +67,13 @@ public:
 	U32 m_baseInstance = 0;
 	U32 m_baseInstance = 0;
 };
 };
 
 
+/// Command buffer init info.
+class CommandBufferInitInfo
+{
+public:
+	Bool m_secondLevel = false;
+};
+
 /// Command buffer initialization hints. They are used to optimize the
 /// Command buffer initialization hints. They are used to optimize the
 /// allocators of a command buffer.
 /// allocators of a command buffer.
 class CommandBufferInitHints
 class CommandBufferInitHints
@@ -74,12 +81,7 @@ class CommandBufferInitHints
 	friend class CommandBufferImpl;
 	friend class CommandBufferImpl;
 
 
 private:
 private:
-	enum
-	{
-		MAX_CHUNK_SIZE = 4 * 1024 * 1024 // 4MB
-	};
-
-	PtrSize m_chunkSize = 1024;
+	PtrSize m_chunkSize = 1024 * 64;
 };
 };
 
 
 /// Command buffer.
 /// Command buffer.

+ 5 - 5
include/anki/gr/Common.h

@@ -15,11 +15,11 @@ namespace anki
 // Forward
 // Forward
 class GrManager;
 class GrManager;
 class GrManagerImpl;
 class GrManagerImpl;
-class TextureInitializer;
-class SamplerInitializer;
-class GrManagerInitializer;
-class PipelineInitializer;
-class FramebufferInitializer;
+class TextureInitInfo;
+class SamplerInitInfo;
+class GrManagerInitInfo;
+class PipelineInitInfo;
+class FramebufferInitInfo;
 
 
 class DynamicBufferToken;
 class DynamicBufferToken;
 class DynamicBufferInfo;
 class DynamicBufferInfo;

+ 6 - 6
include/anki/gr/Framebuffer.h

@@ -64,23 +64,23 @@ public:
 };
 };
 
 
 /// Framebuffer initializer.
 /// Framebuffer initializer.
-class FramebufferInitializer
+class FramebufferInitInfo
 {
 {
 public:
 public:
 	Array<Attachment, MAX_COLOR_ATTACHMENTS> m_colorAttachments;
 	Array<Attachment, MAX_COLOR_ATTACHMENTS> m_colorAttachments;
 	U32 m_colorAttachmentsCount = 0;
 	U32 m_colorAttachmentsCount = 0;
 	Attachment m_depthStencilAttachment;
 	Attachment m_depthStencilAttachment;
 
 
-	FramebufferInitializer() = default;
+	FramebufferInitInfo() = default;
 
 
-	FramebufferInitializer(const FramebufferInitializer& b)
+	FramebufferInitInfo(const FramebufferInitInfo& b)
 	{
 	{
 		operator=(b);
 		operator=(b);
 	}
 	}
 
 
-	~FramebufferInitializer() = default;
+	~FramebufferInitInfo() = default;
 
 
-	FramebufferInitializer& operator=(const FramebufferInitializer& b)
+	FramebufferInitInfo& operator=(const FramebufferInitInfo& b)
 	{
 	{
 		for(U i = 0; i < b.m_colorAttachmentsCount; i++)
 		for(U i = 0; i < b.m_colorAttachmentsCount; i++)
 		{
 		{
@@ -110,7 +110,7 @@ public:
 	}
 	}
 
 
 	/// Create.
 	/// Create.
-	void create(const FramebufferInitializer& init);
+	void create(const FramebufferInitInfo& init);
 
 
 private:
 private:
 	UniquePtr<FramebufferImpl> m_impl;
 	UniquePtr<FramebufferImpl> m_impl;

+ 2 - 4
include/anki/gr/GrManager.h

@@ -35,7 +35,7 @@ public:
 };
 };
 
 
 /// Manager initializer.
 /// Manager initializer.
-class GrManagerInitializer
+class GrManagerInitInfo
 {
 {
 public:
 public:
 	AllocAlignedCallback m_allocCallback = nullptr;
 	AllocAlignedCallback m_allocCallback = nullptr;
@@ -55,15 +55,13 @@ class GrManager
 	friend class GrManagerImpl;
 	friend class GrManagerImpl;
 
 
 public:
 public:
-	using Initializer = GrManagerInitializer;
-
 	/// Default constructor
 	/// Default constructor
 	GrManager();
 	GrManager();
 
 
 	~GrManager();
 	~GrManager();
 
 
 	/// Create.
 	/// Create.
-	ANKI_USE_RESULT Error create(Initializer& init);
+	ANKI_USE_RESULT Error create(GrManagerInitInfo& init);
 
 
 	/// Swap buffers
 	/// Swap buffers
 	void swapBuffers();
 	void swapBuffers();

+ 3 - 3
include/anki/gr/Pipeline.h

@@ -109,10 +109,10 @@ enum class PipelineSubStateBit : U16
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PipelineSubStateBit, inline)
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PipelineSubStateBit, inline)
 
 
 /// Pipeline initializer.
 /// Pipeline initializer.
-class PipelineInitializer
+class PipelineInitInfo
 {
 {
 public:
 public:
-	PipelineInitializer()
+	PipelineInitInfo()
 	{
 	{
 // Do a special construction. The state will be hashed and the padding
 // Do a special construction. The state will be hashed and the padding
 // may contain garbage. With this trick zero the padding
 // may contain garbage. With this trick zero the padding
@@ -159,7 +159,7 @@ public:
 	}
 	}
 
 
 	/// Create.
 	/// Create.
-	void create(const PipelineInitializer& init);
+	void create(const PipelineInitInfo& init);
 
 
 private:
 private:
 	UniquePtr<PipelineImpl> m_impl;
 	UniquePtr<PipelineImpl> m_impl;

+ 2 - 2
include/anki/gr/ResourceGroup.h

@@ -35,7 +35,7 @@ public:
 };
 };
 
 
 /// Resource group initializer.
 /// Resource group initializer.
-class ResourceGroupInitializer
+class ResourceGroupInitInfo
 {
 {
 public:
 public:
 	Array<TextureBinding, MAX_TEXTURE_BINDINGS> m_textures;
 	Array<TextureBinding, MAX_TEXTURE_BINDINGS> m_textures;
@@ -73,7 +73,7 @@ public:
 	}
 	}
 
 
 	/// Create.
 	/// Create.
-	void create(const ResourceGroupInitializer& init);
+	void create(const ResourceGroupInitInfo& init);
 
 
 private:
 private:
 	UniquePtr<ResourceGroupImpl> m_impl;
 	UniquePtr<ResourceGroupImpl> m_impl;

+ 1 - 1
include/anki/gr/Sampler.h

@@ -31,7 +31,7 @@ public:
 	}
 	}
 
 
 	/// Create it.
 	/// Create it.
-	void create(const SamplerInitializer& init);
+	void create(const SamplerInitInfo& init);
 
 
 private:
 private:
 	UniquePtr<SamplerImpl> m_impl;
 	UniquePtr<SamplerImpl> m_impl;

+ 4 - 4
include/anki/gr/Texture.h

@@ -14,7 +14,7 @@ namespace anki
 /// @{
 /// @{
 
 
 /// Sampler initializer.
 /// Sampler initializer.
-class SamplerInitializer
+class SamplerInitInfo
 {
 {
 public:
 public:
 	SamplingFilter m_minMagFilter = SamplingFilter::NEAREST;
 	SamplingFilter m_minMagFilter = SamplingFilter::NEAREST;
@@ -27,7 +27,7 @@ public:
 };
 };
 
 
 /// Texture initializer.
 /// Texture initializer.
-class TextureInitializer
+class TextureInitInfo
 {
 {
 public:
 public:
 	TextureType m_type = TextureType::_2D;
 	TextureType m_type = TextureType::_2D;
@@ -38,7 +38,7 @@ public:
 	U8 m_mipmapsCount = 0;
 	U8 m_mipmapsCount = 0;
 	U8 m_samples = 1;
 	U8 m_samples = 1;
 
 
-	SamplerInitializer m_sampling;
+	SamplerInitInfo m_sampling;
 };
 };
 
 
 /// GPU texture
 /// GPU texture
@@ -58,7 +58,7 @@ public:
 	}
 	}
 
 
 	/// Create it.
 	/// Create it.
-	void create(const TextureInitializer& init);
+	void create(const TextureInitInfo& init);
 
 
 private:
 private:
 	UniquePtr<TextureImpl> m_impl;
 	UniquePtr<TextureImpl> m_impl;

+ 1 - 1
include/anki/gr/gl/CommandBufferImpl.h

@@ -20,7 +20,7 @@ class GlState;
 /// @{
 /// @{
 
 
 template<typename T>
 template<typename T>
-using CommandBufferAllocator = ChainAllocator<T>;
+using CommandBufferAllocator = StackAllocator<T>;
 
 
 /// The base of all GL commands.
 /// The base of all GL commands.
 class GlCommand
 class GlCommand

+ 2 - 2
include/anki/gr/gl/FramebufferImpl.h

@@ -30,13 +30,13 @@ public:
 
 
 	/// Set all the attachments. It will overwrite the previous state. If the
 	/// Set all the attachments. It will overwrite the previous state. If the
 	/// initalizer list is empty the it will bind the default framebuffer
 	/// initalizer list is empty the it will bind the default framebuffer
-	ANKI_USE_RESULT Error create(const FramebufferInitializer& init);
+	ANKI_USE_RESULT Error create(const FramebufferInitInfo& init);
 
 
 	/// Bind it to the state. Call it in rendering thread
 	/// Bind it to the state. Call it in rendering thread
 	void bind(const GlState& state);
 	void bind(const GlState& state);
 
 
 private:
 private:
-	FramebufferInitializer m_in;
+	FramebufferInitInfo m_in;
 
 
 	Array<GLenum, MAX_COLOR_ATTACHMENTS> m_drawBuffers;
 	Array<GLenum, MAX_COLOR_ATTACHMENTS> m_drawBuffers;
 	Array<GLenum, MAX_COLOR_ATTACHMENTS + 1> m_invalidateBuffers;
 	Array<GLenum, MAX_COLOR_ATTACHMENTS + 1> m_invalidateBuffers;

+ 1 - 1
include/anki/gr/gl/GrManagerImpl.h

@@ -28,7 +28,7 @@ public:
 
 
 	~GrManagerImpl();
 	~GrManagerImpl();
 
 
-	void create(GrManagerInitializer& init);
+	void create(GrManagerInitInfo& init);
 
 
 	const RenderingThread& getRenderingThread() const
 	const RenderingThread& getRenderingThread() const
 	{
 	{

+ 2 - 2
include/anki/gr/gl/PipelineImpl.h

@@ -25,7 +25,7 @@ public:
 
 
 	~PipelineImpl();
 	~PipelineImpl();
 
 
-	ANKI_USE_RESULT Error create(const PipelineInitializer& init);
+	ANKI_USE_RESULT Error create(const PipelineInitInfo& init);
 
 
 	/// Bind the pipeline to the state
 	/// Bind the pipeline to the state
 	void bind(GlState& state);
 	void bind(GlState& state);
@@ -53,7 +53,7 @@ private:
 	Bool8 m_blendEnabled = false;
 	Bool8 m_blendEnabled = false;
 
 
 	/// Input values.
 	/// Input values.
-	PipelineInitializer m_in;
+	PipelineInitInfo m_in;
 
 
 	/// Cached values.
 	/// Cached values.
 	class
 	class

+ 2 - 2
include/anki/gr/gl/ResourceGroupImpl.h

@@ -29,7 +29,7 @@ public:
 		m_refs.destroy(getAllocator());
 		m_refs.destroy(getAllocator());
 	}
 	}
 
 
-	void create(const ResourceGroupInitializer& init);
+	void create(const ResourceGroupInitInfo& init);
 
 
 	/// Set state.
 	/// Set state.
 	void bind(U slot, const DynamicBufferInfo& dynInfo, GlState& state);
 	void bind(U slot, const DynamicBufferInfo& dynInfo, GlState& state);
@@ -76,7 +76,7 @@ private:
 		U& resourcesCount,
 		U& resourcesCount,
 		U& dynCount);
 		U& dynCount);
 
 
-	void initResourceReferences(const ResourceGroupInitializer& init, U count);
+	void initResourceReferences(const ResourceGroupInitInfo& init, U count);
 };
 };
 /// @}
 /// @}
 
 

+ 2 - 2
include/anki/gr/gl/SamplerImpl.h

@@ -27,10 +27,10 @@ public:
 		destroyDeferred(glDeleteSamplers);
 		destroyDeferred(glDeleteSamplers);
 	}
 	}
 
 
-	void create(const SamplerInitializer& sinit);
+	void create(const SamplerInitInfo& sinit);
 
 
 private:
 private:
-	void createInternal(const SamplerInitializer& sinit);
+	void createInternal(const SamplerInitInfo& sinit);
 };
 };
 /// @}
 /// @}
 
 

+ 1 - 1
include/anki/gr/gl/TextureImpl.h

@@ -38,7 +38,7 @@ public:
 	~TextureImpl();
 	~TextureImpl();
 
 
 	/// Create the texture storage.
 	/// Create the texture storage.
-	void create(const TextureInitializer& init);
+	void create(const TextureInitInfo& init);
 
 
 	/// Write texture data.
 	/// Write texture data.
 	void write(U32 mipmap, U32 slice, void* data, PtrSize dataSize);
 	void write(U32 mipmap, U32 slice, void* data, PtrSize dataSize);

+ 3 - 5
include/anki/physics/PhysicsBody.h

@@ -13,8 +13,8 @@ namespace anki
 /// @addtogroup physics
 /// @addtogroup physics
 /// @{
 /// @{
 
 
-/// Initializer for PhysicsBody.
-struct PhysicsBodyInitializer
+/// Init info for PhysicsBody.
+struct PhysicsBodyInitInfo
 {
 {
 	PhysicsCollisionShapePtr m_shape;
 	PhysicsCollisionShapePtr m_shape;
 	F32 m_mass = 0.0;
 	F32 m_mass = 0.0;
@@ -28,13 +28,11 @@ struct PhysicsBodyInitializer
 class PhysicsBody : public PhysicsObject
 class PhysicsBody : public PhysicsObject
 {
 {
 public:
 public:
-	using Initializer = PhysicsBodyInitializer;
-
 	PhysicsBody(PhysicsWorld* world);
 	PhysicsBody(PhysicsWorld* world);
 
 
 	~PhysicsBody();
 	~PhysicsBody();
 
 
-	ANKI_USE_RESULT Error create(const Initializer& init);
+	ANKI_USE_RESULT Error create(const PhysicsBodyInitInfo& init);
 
 
 	const Transform& getTransform(Bool& updated)
 	const Transform& getTransform(Bool& updated)
 	{
 	{

+ 12 - 10
include/anki/physics/PhysicsCollisionShape.h

@@ -13,6 +13,12 @@ namespace anki
 /// @addtogroup physics
 /// @addtogroup physics
 /// @{
 /// @{
 
 
+/// Standard initializer for all collision shapes.
+struct PhysicsCollisionShapeInitInfo
+{
+	// Empty for now
+};
+
 /// The base of all collision shapes.
 /// The base of all collision shapes.
 class PhysicsCollisionShape : public PhysicsObject
 class PhysicsCollisionShape : public PhysicsObject
 {
 {
@@ -26,12 +32,6 @@ public:
 		STATIC_TRIANGLE_SOUP
 		STATIC_TRIANGLE_SOUP
 	};
 	};
 
 
-	/// Standard initializer for all collision shapes.
-	struct Initializer
-	{
-		// Empty for now
-	};
-
 	PhysicsCollisionShape(PhysicsWorld* world)
 	PhysicsCollisionShape(PhysicsWorld* world)
 		: PhysicsObject(Type::COLLISION_SHAPE, world)
 		: PhysicsObject(Type::COLLISION_SHAPE, world)
 	{
 	{
@@ -72,7 +72,8 @@ public:
 	{
 	{
 	}
 	}
 
 
-	ANKI_USE_RESULT Error create(Initializer& init, F32 radius);
+	ANKI_USE_RESULT Error create(
+		PhysicsCollisionShapeInitInfo& init, F32 radius);
 };
 };
 
 
 /// Box collision shape.
 /// Box collision shape.
@@ -88,7 +89,8 @@ public:
 	{
 	{
 	}
 	}
 
 
-	ANKI_USE_RESULT Error create(Initializer& init, const Vec3& extend);
+	ANKI_USE_RESULT Error create(
+		PhysicsCollisionShapeInitInfo& init, const Vec3& extend);
 };
 };
 
 
 /// Convex hull collision shape.
 /// Convex hull collision shape.
@@ -104,7 +106,7 @@ public:
 	{
 	{
 	}
 	}
 
 
-	ANKI_USE_RESULT Error create(Initializer& init,
+	ANKI_USE_RESULT Error create(PhysicsCollisionShapeInitInfo& init,
 		const Vec3* positions,
 		const Vec3* positions,
 		U32 positionsCount,
 		U32 positionsCount,
 		U32 positionsStride);
 		U32 positionsStride);
@@ -123,7 +125,7 @@ public:
 	{
 	{
 	}
 	}
 
 
-	ANKI_USE_RESULT Error create(Initializer& init,
+	ANKI_USE_RESULT Error create(PhysicsCollisionShapeInitInfo& init,
 		const Vec3* positions,
 		const Vec3* positions,
 		U32 positionsStride,
 		U32 positionsStride,
 		const U16* indices,
 		const U16* indices,

+ 3 - 5
include/anki/physics/PhysicsPlayerController.h

@@ -13,8 +13,8 @@ namespace anki
 /// @addtogroup physics
 /// @addtogroup physics
 /// @{
 /// @{
 
 
-/// Initializer for PhysicsPlayerController.
-class PhysicsPlayerControllerInitializer
+/// Init info for PhysicsPlayerController.
+class PhysicsPlayerControllerInitInfo
 {
 {
 public:
 public:
 	F32 m_mass = 83.0;
 	F32 m_mass = 83.0;
@@ -29,8 +29,6 @@ public:
 class PhysicsPlayerController final : public PhysicsObject
 class PhysicsPlayerController final : public PhysicsObject
 {
 {
 public:
 public:
-	using Initializer = PhysicsPlayerControllerInitializer;
-
 	PhysicsPlayerController(PhysicsWorld* world)
 	PhysicsPlayerController(PhysicsWorld* world)
 		: PhysicsObject(Type::PLAYER_CONTROLLER, world)
 		: PhysicsObject(Type::PLAYER_CONTROLLER, world)
 	{
 	{
@@ -38,7 +36,7 @@ public:
 
 
 	~PhysicsPlayerController();
 	~PhysicsPlayerController();
 
 
-	ANKI_USE_RESULT Error create(const Initializer& init);
+	ANKI_USE_RESULT Error create(const PhysicsPlayerControllerInitInfo& init);
 
 
 	// Update the state machine
 	// Update the state machine
 	void setVelocity(F32 forwardSpeed,
 	void setVelocity(F32 forwardSpeed,

+ 1 - 1
include/anki/resource/Material.h

@@ -319,7 +319,7 @@ public:
 		return m_vars;
 		return m_vars;
 	}
 	}
 
 
-	void fillResourceGroupInitializer(ResourceGroupInitializer& rcinit);
+	void fillResourceGroupInitInfo(ResourceGroupInitInfo& rcinit);
 
 
 	static U getInstanceGroupIdx(U instanceCount);
 	static U getInstanceGroupIdx(U instanceCount);
 
 

+ 2 - 2
include/anki/resource/Model.h

@@ -100,8 +100,8 @@ private:
 
 
 	PipelinePtr getPipeline(const RenderingKey& key) const;
 	PipelinePtr getPipeline(const RenderingKey& key) const;
 
 
-	void computePipelineInitializer(
-		const RenderingKey& key, PipelineInitializer& pinit) const;
+	void computePipelineInitInfo(
+		const RenderingKey& key, PipelineInitInfo& pinit) const;
 };
 };
 
 
 /// Model is an entity that acts as a container for other resources. Models are
 /// Model is an entity that acts as a container for other resources. Models are

+ 13 - 13
include/anki/resource/ResourceManager.h

@@ -88,6 +88,18 @@ private:
 	}
 	}
 };
 };
 
 
+class ResourceManagerInitInfo
+{
+public:
+	GrManager* m_gr = nullptr;
+	PhysicsWorld* m_physics = nullptr;
+	ResourceFilesystem* m_resourceFs = nullptr;
+	const ConfigSet* m_config = nullptr;
+	CString m_cacheDir;
+	AllocAlignedCallback m_allocCallback = 0;
+	void* m_allocCallbackData = nullptr;
+};
+
 /// Resource manager. It holds a few global variables
 /// Resource manager. It holds a few global variables
 class ResourceManager : public TypeResourceManager<Animation>,
 class ResourceManager : public TypeResourceManager<Animation>,
 						public TypeResourceManager<TextureResource>,
 						public TypeResourceManager<TextureResource>,
@@ -106,23 +118,11 @@ class ResourceManager : public TypeResourceManager<Animation>,
 	friend class ResourcePtrDeleter;
 	friend class ResourcePtrDeleter;
 
 
 public:
 public:
-	class Initializer
-	{
-	public:
-		GrManager* m_gr = nullptr;
-		PhysicsWorld* m_physics = nullptr;
-		ResourceFilesystem* m_resourceFs = nullptr;
-		const ConfigSet* m_config = nullptr;
-		CString m_cacheDir;
-		AllocAlignedCallback m_allocCallback = 0;
-		void* m_allocCallbackData = nullptr;
-	};
-
 	ResourceManager();
 	ResourceManager();
 
 
 	~ResourceManager();
 	~ResourceManager();
 
 
-	ANKI_USE_RESULT Error create(Initializer& init);
+	ANKI_USE_RESULT Error create(ResourceManagerInitInfo& init);
 
 
 	/// Load a resource.
 	/// Load a resource.
 	template<typename T>
 	template<typename T>

+ 3 - 0
include/anki/util/Memory.h

@@ -210,6 +210,9 @@ public:
 	/// Reinit the pool. All existing allocated memory will be lost
 	/// Reinit the pool. All existing allocated memory will be lost
 	void reset();
 	void reset();
 
 
+	/// Get the current capacity of the pool. It's not thread safe.
+	PtrSize getMemoryCapacity() const;
+
 private:
 private:
 	/// The memory chunk.
 	/// The memory chunk.
 	class Chunk
 	class Chunk

+ 8 - 4
shaders/DownscaleBlur.frag.glsl

@@ -17,10 +17,14 @@ void main()
 	out_color = textureLod(u_tex, in_uv, TEXTURE_MIPMAP).rgb;
 	out_color = textureLod(u_tex, in_uv, TEXTURE_MIPMAP).rgb;
 	out_color += textureLod(u_tex, in_uv + TEXEL_SIZE, TEXTURE_MIPMAP).rgb;
 	out_color += textureLod(u_tex, in_uv + TEXEL_SIZE, TEXTURE_MIPMAP).rgb;
 	out_color += textureLod(u_tex, in_uv - TEXEL_SIZE, TEXTURE_MIPMAP).rgb;
 	out_color += textureLod(u_tex, in_uv - TEXEL_SIZE, TEXTURE_MIPMAP).rgb;
-	out_color += textureLod(
-		u_tex, in_uv + vec2(TEXEL_SIZE.x, -TEXEL_SIZE.y), TEXTURE_MIPMAP).rgb;
-	out_color += textureLod(
-		u_tex, in_uv + vec2(-TEXEL_SIZE.x, TEXEL_SIZE.y), TEXTURE_MIPMAP).rgb;
+	out_color +=
+		textureLod(
+			u_tex, in_uv + vec2(TEXEL_SIZE.x, -TEXEL_SIZE.y), TEXTURE_MIPMAP)
+			.rgb;
+	out_color +=
+		textureLod(
+			u_tex, in_uv + vec2(-TEXEL_SIZE.x, TEXEL_SIZE.y), TEXTURE_MIPMAP)
+			.rgb;
 
 
 	out_color /= 5.0;
 	out_color /= 5.0;
 }
 }

+ 3 - 3
src/core/App.cpp

@@ -195,7 +195,7 @@ Error App::createInternal(const ConfigSet& config_,
 	//
 	//
 	// Window
 	// Window
 	//
 	//
-	NativeWindow::Initializer nwinit;
+	NativeWindowInitInfo nwinit;
 	nwinit.m_width = config.getNumber("width");
 	nwinit.m_width = config.getNumber("width");
 	nwinit.m_height = config.getNumber("height");
 	nwinit.m_height = config.getNumber("height");
 	nwinit.m_majorVersion = config.getNumber("glmajor");
 	nwinit.m_majorVersion = config.getNumber("glmajor");
@@ -231,7 +231,7 @@ Error App::createInternal(const ConfigSet& config_,
 
 
 	m_gr = m_heapAlloc.newInstance<GrManager>();
 	m_gr = m_heapAlloc.newInstance<GrManager>();
 
 
-	GrManagerInitializer grInit;
+	GrManagerInitInfo grInit;
 	grInit.m_allocCallback = m_allocCb;
 	grInit.m_allocCallback = m_allocCb;
 	grInit.m_allocCallbackUserData = m_allocCbData;
 	grInit.m_allocCallbackUserData = m_allocCbData;
 	grInit.m_interface = m_grInterface;
 	grInit.m_interface = m_grInterface;
@@ -257,7 +257,7 @@ Error App::createInternal(const ConfigSet& config_,
 	//
 	//
 	// Resources
 	// Resources
 	//
 	//
-	ResourceManager::Initializer rinit;
+	ResourceManagerInitInfo rinit;
 	rinit.m_gr = m_gr;
 	rinit.m_gr = m_gr;
 	rinit.m_physics = m_physics;
 	rinit.m_physics = m_physics;
 	rinit.m_resourceFs = m_resourceFs;
 	rinit.m_resourceFs = m_resourceFs;

+ 2 - 2
src/core/NativeWindowAndroid.cpp

@@ -40,7 +40,7 @@ static void loopUntilWindowIsReady(android_app& app)
 //==============================================================================
 //==============================================================================
 
 
 //==============================================================================
 //==============================================================================
-void NativeWindowImpl::create(NativeWindowInitializer& init)
+void NativeWindowImpl::create(NativeWindowInitInfo& init)
 {
 {
 	Array<EGLint, 256> attribs;
 	Array<EGLint, 256> attribs;
 	U attr = 0;
 	U attr = 0;
@@ -179,7 +179,7 @@ NativeWindow::~NativeWindow()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void NativeWindow::create(NativeWindowInitializer& initializer)
+void NativeWindow::create(NativeWindowInitInfo& initializer)
 {
 {
 	impl.reset(new NativeWindowImpl);
 	impl.reset(new NativeWindowImpl);
 	impl->create(initializer);
 	impl->create(initializer);

+ 1 - 1
src/core/NativeWindowDummy.cpp

@@ -14,7 +14,7 @@ NativeWindow::~NativeWindow
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void NativeWindow::create(NativeWindowInitializer&)
+void NativeWindow::create(NativeWindowInitInfo&)
 {
 {
 }
 }
 
 

+ 2 - 2
src/core/NativeWindowEglFbdev.cpp

@@ -16,7 +16,7 @@ namespace anki
 //==============================================================================
 //==============================================================================
 
 
 //==============================================================================
 //==============================================================================
-void NativeWindowImpl::create(NativeWindowInitializer& init)
+void NativeWindowImpl::create(NativeWindowInitInfo& init)
 {
 {
 	// Create window
 	// Create window
 	//
 	//
@@ -199,7 +199,7 @@ NativeWindow::~NativeWindow()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void NativeWindow::create(NativeWindowInitializer& initializer)
+void NativeWindow::create(NativeWindowInitInfo& initializer)
 {
 {
 	impl.reset(new NativeWindowImpl);
 	impl.reset(new NativeWindowImpl);
 	impl->create(initializer);
 	impl->create(initializer);

+ 1 - 1
src/core/NativeWindowSdl.cpp

@@ -14,7 +14,7 @@ const U32 INIT_SUBSYSTEMS = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS
 	| SDL_INIT_GAMECONTROLLER;
 	| SDL_INIT_GAMECONTROLLER;
 
 
 //==============================================================================
 //==============================================================================
-Error NativeWindow::create(Initializer& init, HeapAllocator<U8>& alloc)
+Error NativeWindow::create(NativeWindowInitInfo& init, HeapAllocator<U8>& alloc)
 {
 {
 	m_alloc = alloc;
 	m_alloc = alloc;
 	m_impl = m_alloc.newInstance<NativeWindowImpl>();
 	m_impl = m_alloc.newInstance<NativeWindowImpl>();

+ 3 - 2
src/gr/gl/CommandBufferImpl.cpp

@@ -23,7 +23,8 @@ void CommandBufferImpl::create(const InitHints& hints)
 		pool.getAllocationCallbackUserData(),
 		pool.getAllocationCallbackUserData(),
 		hints.m_chunkSize,
 		hints.m_chunkSize,
 		1.0,
 		1.0,
-		hints.m_chunkSize);
+		0,
+		false);
 }
 }
 
 
 //==============================================================================
 //==============================================================================
@@ -81,7 +82,7 @@ Error CommandBufferImpl::executeAllCommands()
 CommandBufferImpl::InitHints CommandBufferImpl::computeInitHints() const
 CommandBufferImpl::InitHints CommandBufferImpl::computeInitHints() const
 {
 {
 	InitHints out;
 	InitHints out;
-	out.m_chunkSize = m_alloc.getMemoryPool().getAllocatedSize() + 16;
+	out.m_chunkSize = m_alloc.getMemoryPool().getMemoryCapacity();
 
 
 	return out;
 	return out;
 }
 }

+ 3 - 3
src/gr/gl/Framebuffer.cpp

@@ -26,10 +26,10 @@ class CreateFramebufferCommand final : public GlCommand
 {
 {
 public:
 public:
 	FramebufferPtr m_fb;
 	FramebufferPtr m_fb;
-	FramebufferInitializer m_init;
+	FramebufferInitInfo m_init;
 
 
 	CreateFramebufferCommand(
 	CreateFramebufferCommand(
-		Framebuffer* handle, const FramebufferInitializer& init)
+		Framebuffer* handle, const FramebufferInitInfo& init)
 		: m_fb(handle)
 		: m_fb(handle)
 		, m_init(init)
 		, m_init(init)
 	{
 	{
@@ -49,7 +49,7 @@ public:
 	}
 	}
 };
 };
 
 
-void Framebuffer::create(const FramebufferInitializer& init)
+void Framebuffer::create(const FramebufferInitInfo& init)
 {
 {
 	m_impl.reset(getAllocator().newInstance<FramebufferImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<FramebufferImpl>(&getManager()));
 
 

+ 1 - 1
src/gr/gl/FramebufferImpl.cpp

@@ -16,7 +16,7 @@ namespace anki
 {
 {
 
 
 //==============================================================================
 //==============================================================================
-Error FramebufferImpl::create(const FramebufferInitializer& init)
+Error FramebufferImpl::create(const FramebufferInitInfo& init)
 {
 {
 	ANKI_ASSERT(!isCreated());
 	ANKI_ASSERT(!isCreated());
 	m_in = init;
 	m_in = init;

+ 1 - 1
src/gr/gl/GrManager.cpp

@@ -24,7 +24,7 @@ GrManager::~GrManager()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-Error GrManager::create(Initializer& init)
+Error GrManager::create(GrManagerInitInfo& init)
 {
 {
 	m_alloc =
 	m_alloc =
 		HeapAllocator<U8>(init.m_allocCallback, init.m_allocCallbackUserData);
 		HeapAllocator<U8>(init.m_allocCallback, init.m_allocCallbackUserData);

+ 1 - 1
src/gr/gl/GrManagerImpl.cpp

@@ -30,7 +30,7 @@ GrAllocator<U8> GrManagerImpl::getAllocator() const
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void GrManagerImpl::create(GrManagerInitializer& init)
+void GrManagerImpl::create(GrManagerInitInfo& init)
 {
 {
 	// Create thread
 	// Create thread
 	m_thread =
 	m_thread =

+ 3 - 3
src/gr/gl/Pipeline.cpp

@@ -26,9 +26,9 @@ class CreatePipelineCommand final : public GlCommand
 {
 {
 public:
 public:
 	PipelinePtr m_ppline;
 	PipelinePtr m_ppline;
-	PipelineInitializer m_init;
+	PipelineInitInfo m_init;
 
 
-	CreatePipelineCommand(Pipeline* ppline, const PipelineInitializer& init)
+	CreatePipelineCommand(Pipeline* ppline, const PipelineInitInfo& init)
 		: m_ppline(ppline)
 		: m_ppline(ppline)
 		, m_init(init)
 		, m_init(init)
 	{
 	{
@@ -49,7 +49,7 @@ public:
 	}
 	}
 };
 };
 
 
-void Pipeline::create(const PipelineInitializer& init)
+void Pipeline::create(const PipelineInitInfo& init)
 {
 {
 	m_impl.reset(getAllocator().newInstance<PipelineImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<PipelineImpl>(&getManager()));
 
 

+ 2 - 3
src/gr/gl/PipelineImpl.cpp

@@ -109,7 +109,7 @@ PipelineImpl::~PipelineImpl()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-Error PipelineImpl::create(const PipelineInitializer& init)
+Error PipelineImpl::create(const PipelineInitInfo& init)
 {
 {
 	m_in = init;
 	m_in = init;
 
 
@@ -206,8 +206,7 @@ Error PipelineImpl::createGlPipeline()
 
 
 		infoLogTxt.create(infoLen + 1);
 		infoLogTxt.create(infoLen + 1);
 
 
-		glGetProgramInfoLog(
-			m_glName, infoLen, &charsWritten, &infoLogTxt[0]);
+		glGetProgramInfoLog(m_glName, infoLen, &charsWritten, &infoLogTxt[0]);
 
 
 		ANKI_LOGE("Ppline error log follows:\n%s", &infoLogTxt[0]);
 		ANKI_LOGE("Ppline error log follows:\n%s", &infoLogTxt[0]);
 		err = ErrorCode::USER_DATA;
 		err = ErrorCode::USER_DATA;

+ 3 - 3
src/gr/gl/ResourceGroup.cpp

@@ -29,9 +29,9 @@ class RcgCreateCommand final : public GlCommand
 {
 {
 public:
 public:
 	ResourceGroupPtr m_ptr;
 	ResourceGroupPtr m_ptr;
-	ResourceGroupInitializer m_init;
+	ResourceGroupInitInfo m_init;
 
 
-	RcgCreateCommand(ResourceGroup* ptr, const ResourceGroupInitializer& init)
+	RcgCreateCommand(ResourceGroup* ptr, const ResourceGroupInitInfo& init)
 		: m_ptr(ptr)
 		: m_ptr(ptr)
 		, m_init(init)
 		, m_init(init)
 	{
 	{
@@ -53,7 +53,7 @@ public:
 	}
 	}
 };
 };
 
 
-void ResourceGroup::create(const ResourceGroupInitializer& init)
+void ResourceGroup::create(const ResourceGroupInitInfo& init)
 {
 {
 	// NOTE: Create asynchronously because the initialization touches GL names
 	// NOTE: Create asynchronously because the initialization touches GL names
 	m_impl.reset(getAllocator().newInstance<ResourceGroupImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<ResourceGroupImpl>(&getManager()));

+ 2 - 2
src/gr/gl/ResourceGroupImpl.cpp

@@ -63,7 +63,7 @@ void ResourceGroupImpl::initBuffers(const InBindings& in,
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void ResourceGroupImpl::create(const ResourceGroupInitializer& init)
+void ResourceGroupImpl::create(const ResourceGroupInitInfo& init)
 {
 {
 	U resourcesCount = 0;
 	U resourcesCount = 0;
 	U dynCount = 0;
 	U dynCount = 0;
@@ -168,7 +168,7 @@ void ResourceGroupImpl::create(const ResourceGroupInitializer& init)
 
 
 //==============================================================================
 //==============================================================================
 void ResourceGroupImpl::initResourceReferences(
 void ResourceGroupImpl::initResourceReferences(
-	const ResourceGroupInitializer& init, U refCount)
+	const ResourceGroupInitInfo& init, U refCount)
 {
 {
 	m_refs.create(getAllocator(), refCount);
 	m_refs.create(getAllocator(), refCount);
 
 

+ 3 - 3
src/gr/gl/Sampler.cpp

@@ -26,9 +26,9 @@ class CreateSamplerCommand : public GlCommand
 {
 {
 public:
 public:
 	SamplerPtr m_sampler;
 	SamplerPtr m_sampler;
-	SamplerInitializer m_init;
+	SamplerInitInfo m_init;
 
 
-	CreateSamplerCommand(Sampler* sampler, const SamplerInitializer& init)
+	CreateSamplerCommand(Sampler* sampler, const SamplerInitInfo& init)
 		: m_sampler(sampler)
 		: m_sampler(sampler)
 		, m_init(init)
 		, m_init(init)
 	{
 	{
@@ -50,7 +50,7 @@ public:
 	}
 	}
 };
 };
 
 
-void Sampler::create(const SamplerInitializer& init)
+void Sampler::create(const SamplerInitInfo& init)
 {
 {
 	m_impl.reset(getAllocator().newInstance<SamplerImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<SamplerImpl>(&getManager()));
 
 

+ 1 - 1
src/gr/gl/SamplerImpl.cpp

@@ -10,7 +10,7 @@ namespace anki
 {
 {
 
 
 //==============================================================================
 //==============================================================================
-void SamplerImpl::create(const SamplerInitializer& sinit)
+void SamplerImpl::create(const SamplerInitInfo& sinit)
 {
 {
 	glGenSamplers(1, &m_glName);
 	glGenSamplers(1, &m_glName);
 	ANKI_ASSERT(m_glName);
 	ANKI_ASSERT(m_glName);

+ 3 - 3
src/gr/gl/Texture.cpp

@@ -26,9 +26,9 @@ class CreateTextureCommand final : public GlCommand
 {
 {
 public:
 public:
 	IntrusivePtr<Texture> m_tex;
 	IntrusivePtr<Texture> m_tex;
-	TextureInitializer m_init;
+	TextureInitInfo m_init;
 
 
-	CreateTextureCommand(Texture* tex, const TextureInitializer& init)
+	CreateTextureCommand(Texture* tex, const TextureInitInfo& init)
 		: m_tex(tex)
 		: m_tex(tex)
 		, m_init(init)
 		, m_init(init)
 	{
 	{
@@ -49,7 +49,7 @@ public:
 	}
 	}
 };
 };
 
 
-void Texture::create(const TextureInitializer& init)
+void Texture::create(const TextureInitInfo& init)
 {
 {
 	m_impl.reset(getAllocator().newInstance<TextureImpl>(&getManager()));
 	m_impl.reset(getAllocator().newInstance<TextureImpl>(&getManager()));
 
 

+ 2 - 2
src/gr/gl/TextureImpl.cpp

@@ -269,10 +269,10 @@ void TextureImpl::bind()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void TextureImpl::create(const TextureInitializer& init)
+void TextureImpl::create(const TextureInitInfo& init)
 {
 {
 	GrAllocator<U8> alloc = getAllocator();
 	GrAllocator<U8> alloc = getAllocator();
-	const SamplerInitializer& sinit = init.m_sampling;
+	const SamplerInitInfo& sinit = init.m_sampling;
 
 
 	// Sanity checks
 	// Sanity checks
 	//
 	//

+ 1 - 1
src/physics/PhysicsBody.cpp

@@ -34,7 +34,7 @@ PhysicsBody::~PhysicsBody()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-Error PhysicsBody::create(const Initializer& init)
+Error PhysicsBody::create(const PhysicsBodyInitInfo& init)
 {
 {
 	// I collisionType =
 	// I collisionType =
 	// NewtonCollisionGetType(init.m_shape->_getNewtonShape());
 	// NewtonCollisionGetType(init.m_shape->_getNewtonShape());

+ 4 - 3
src/physics/PhysicsCollisionShape.cpp

@@ -30,7 +30,7 @@ PhysicsCollisionShape::~PhysicsCollisionShape()
 //==============================================================================
 //==============================================================================
 
 
 //==============================================================================
 //==============================================================================
-Error PhysicsSphere::create(Initializer& init, F32 radius)
+Error PhysicsSphere::create(PhysicsCollisionShapeInitInfo& init, F32 radius)
 {
 {
 	Error err = ErrorCode::NONE;
 	Error err = ErrorCode::NONE;
 
 
@@ -50,7 +50,8 @@ Error PhysicsSphere::create(Initializer& init, F32 radius)
 //==============================================================================
 //==============================================================================
 
 
 //==============================================================================
 //==============================================================================
-Error PhysicsBox::create(Initializer& init, const Vec3& extend)
+Error PhysicsBox::create(
+	PhysicsCollisionShapeInitInfo& init, const Vec3& extend)
 {
 {
 	Error err = ErrorCode::NONE;
 	Error err = ErrorCode::NONE;
 
 
@@ -74,7 +75,7 @@ Error PhysicsBox::create(Initializer& init, const Vec3& extend)
 //==============================================================================
 //==============================================================================
 
 
 //==============================================================================
 //==============================================================================
-Error PhysicsTriangleSoup::create(Initializer& init,
+Error PhysicsTriangleSoup::create(PhysicsCollisionShapeInitInfo& init,
 	const Vec3* positions,
 	const Vec3* positions,
 	U32 positionsStride,
 	U32 positionsStride,
 	const U16* indices,
 	const U16* indices,

+ 2 - 1
src/physics/PhysicsPlayerController.cpp

@@ -144,7 +144,8 @@ PhysicsPlayerController::~PhysicsPlayerController()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-Error PhysicsPlayerController::create(const Initializer& init)
+Error PhysicsPlayerController::create(
+	const PhysicsPlayerControllerInitInfo& init)
 {
 {
 	NewtonWorld* world = m_world->_getNewtonWorld();
 	NewtonWorld* world = m_world->_getNewtonWorld();
 
 

+ 4 - 4
src/renderer/Bloom.cpp

@@ -30,7 +30,7 @@ Error Bloom::initFb(FramebufferPtr& fb, TexturePtr& rt)
 		m_width, m_height, RT_PIXEL_FORMAT, 1, SamplingFilter::LINEAR, 1, rt);
 		m_width, m_height, RT_PIXEL_FORMAT, 1, SamplingFilter::LINEAR, 1, rt);
 
 
 	// Create FB
 	// Create FB
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = rt;
 	fbInit.m_colorAttachments[0].m_texture = rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -111,7 +111,7 @@ Error Bloom::initInternal(const ConfigSet& config)
 
 
 	// Set descriptors
 	// Set descriptors
 	{
 	{
-		ResourceGroupInitializer descInit;
+		ResourceGroupInitInfo descInit;
 		descInit.m_textures[0].m_texture = m_r->getIs().getRt();
 		descInit.m_textures[0].m_texture = m_r->getIs().getRt();
 		descInit.m_uniformBuffers[0].m_dynamic = true;
 		descInit.m_uniformBuffers[0].m_dynamic = true;
 
 
@@ -122,13 +122,13 @@ Error Bloom::initInternal(const ConfigSet& config)
 	}
 	}
 
 
 	{
 	{
-		ResourceGroupInitializer descInit;
+		ResourceGroupInitInfo descInit;
 		descInit.m_textures[0].m_texture = m_vblurRt;
 		descInit.m_textures[0].m_texture = m_vblurRt;
 		m_hDescrGroup = gl.newInstance<ResourceGroup>(descInit);
 		m_hDescrGroup = gl.newInstance<ResourceGroup>(descInit);
 	}
 	}
 
 
 	{
 	{
-		ResourceGroupInitializer descInit;
+		ResourceGroupInitInfo descInit;
 		descInit.m_textures[0].m_texture = m_hblurRt;
 		descInit.m_textures[0].m_texture = m_hblurRt;
 		m_vDescrGroup = gl.newInstance<ResourceGroup>(descInit);
 		m_vDescrGroup = gl.newInstance<ResourceGroup>(descInit);
 	}
 	}

+ 1 - 1
src/renderer/Dbg.cpp

@@ -50,7 +50,7 @@ Error Dbg::init(const ConfigSet& initializer)
 	enableBits(Flag::ALL);
 	enableBits(Flag::ALL);
 
 
 	// Chose the correct color FAI
 	// Chose the correct color FAI
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_depthStencilAttachment.m_texture = m_r->getMs().getDepthRt();
 	fbInit.m_depthStencilAttachment.m_texture = m_r->getMs().getDepthRt();
 	fbInit.m_depthStencilAttachment.m_loadOperation =
 	fbInit.m_depthStencilAttachment.m_loadOperation =

+ 2 - 2
src/renderer/DebugDrawer.cpp

@@ -43,7 +43,7 @@ Error DebugDrawer::create(Renderer* r)
 	ANKI_CHECK(
 	ANKI_CHECK(
 		r->getResourceManager().loadResource("shaders/Dbg.frag.glsl", m_frag));
 		r->getResourceManager().loadResource("shaders/Dbg.frag.glsl", m_frag));
 
 
-	PipelineInitializer init;
+	PipelineInitInfo init;
 	init.m_vertex.m_bindingCount = 1;
 	init.m_vertex.m_bindingCount = 1;
 	init.m_vertex.m_bindings[0].m_stride = 2 * sizeof(Vec4);
 	init.m_vertex.m_bindings[0].m_stride = 2 * sizeof(Vec4);
 	init.m_vertex.m_attributeCount = 2;
 	init.m_vertex.m_attributeCount = 2;
@@ -72,7 +72,7 @@ Error DebugDrawer::create(Renderer* r)
 		BufferUsageBit::VERTEX,
 		BufferUsageBit::VERTEX,
 		BufferAccessBit::CLIENT_WRITE);
 		BufferAccessBit::CLIENT_WRITE);
 
 
-	ResourceGroupInitializer rcinit;
+	ResourceGroupInitInfo rcinit;
 	rcinit.m_vertexBuffers[0].m_buffer = m_vertBuff;
 	rcinit.m_vertexBuffers[0].m_buffer = m_vertBuff;
 	m_rcGroup = gr.newInstance<ResourceGroup>(rcinit);
 	m_rcGroup = gr.newInstance<ResourceGroup>(rcinit);
 
 

+ 5 - 7
src/renderer/DownscaleBlur.cpp

@@ -15,7 +15,7 @@ Error DownscaleBlur::initSubpass(U idx, const UVec2& inputTexSize)
 {
 {
 	Subpass& pass = m_passes[idx];
 	Subpass& pass = m_passes[idx];
 
 
-	PipelineInitializer ppinit;
+	PipelineInitInfo ppinit;
 	ppinit.m_color.m_attachmentCount = 1;
 	ppinit.m_color.m_attachmentCount = 1;
 	ppinit.m_color.m_attachments[0].m_format = Is::RT_PIXEL_FORMAT;
 	ppinit.m_color.m_attachments[0].m_format = Is::RT_PIXEL_FORMAT;
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
@@ -41,10 +41,8 @@ Error DownscaleBlur::initSubpass(U idx, const UVec2& inputTexSize)
 		F32(inputTexSize.y()),
 		F32(inputTexSize.y()),
 		idx);
 		idx);
 
 
-	ANKI_CHECK(getResourceManager().loadResourceToCache(pass.m_frag,
-		"shaders/DownscaleBlur.frag.glsl",
-		pps.toCString(),
-		"r_"));
+	ANKI_CHECK(getResourceManager().loadResourceToCache(
+		pass.m_frag, "shaders/DownscaleBlur.frag.glsl", pps.toCString(), "r_"));
 
 
 	ppinit.m_shaders[ShaderType::FRAGMENT] = pass.m_frag->getGrShader();
 	ppinit.m_shaders[ShaderType::FRAGMENT] = pass.m_frag->getGrShader();
 
 
@@ -52,7 +50,7 @@ Error DownscaleBlur::initSubpass(U idx, const UVec2& inputTexSize)
 	pass.m_ppline = getGrManager().newInstance<Pipeline>(ppinit);
 	pass.m_ppline = getGrManager().newInstance<Pipeline>(ppinit);
 
 
 	// FB
 	// FB
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_r->getIs().getRt();
 	fbInit.m_colorAttachments[0].m_texture = m_r->getIs().getRt();
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -61,7 +59,7 @@ Error DownscaleBlur::initSubpass(U idx, const UVec2& inputTexSize)
 	pass.m_fb = getGrManager().newInstance<Framebuffer>(fbInit);
 	pass.m_fb = getGrManager().newInstance<Framebuffer>(fbInit);
 
 
 	// Resources
 	// Resources
-	ResourceGroupInitializer rcinit;
+	ResourceGroupInitInfo rcinit;
 	rcinit.m_textures[0].m_texture = m_r->getIs().getRt();
 	rcinit.m_textures[0].m_texture = m_r->getIs().getRt();
 	pass.m_rcGroup = getGrManager().newInstance<ResourceGroup>(rcinit);
 	pass.m_rcGroup = getGrManager().newInstance<ResourceGroup>(rcinit);
 
 

+ 2 - 2
src/renderer/Fs.cpp

@@ -30,7 +30,7 @@ Error Fs::init(const ConfigSet&)
 		1,
 		1,
 		m_rt);
 		m_rt);
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -43,7 +43,7 @@ Error Fs::init(const ConfigSet&)
 
 
 	// Init the global resources
 	// Init the global resources
 	{
 	{
-		ResourceGroupInitializer init;
+		ResourceGroupInitInfo init;
 		init.m_textures[0].m_texture = m_r->getMs().getDepthRt();
 		init.m_textures[0].m_texture = m_r->getMs().getDepthRt();
 		init.m_textures[1].m_texture =
 		init.m_textures[1].m_texture =
 			m_r->getIs().getSm().getSpotTextureArray();
 			m_r->getIs().getSm().getSpotTextureArray();

+ 5 - 5
src/renderer/Ir.cpp

@@ -205,7 +205,7 @@ Error Ir::init(const ConfigSet& config)
 		m_r->getGlobalTimestampPtr()));
 		m_r->getGlobalTimestampPtr()));
 
 
 	// Init the textures
 	// Init the textures
-	TextureInitializer texinit;
+	TextureInitInfo texinit;
 
 
 	texinit.m_width = m_fbSize;
 	texinit.m_width = m_fbSize;
 	texinit.m_height = m_fbSize;
 	texinit.m_height = m_fbSize;
@@ -232,7 +232,7 @@ Error Ir::init(const ConfigSet& config)
 	ANKI_CHECK(getResourceManager().loadResource(
 	ANKI_CHECK(getResourceManager().loadResource(
 		"engine_data/SplitSumIntegration.ankitex", m_integrationLut));
 		"engine_data/SplitSumIntegration.ankitex", m_integrationLut));
 
 
-	SamplerInitializer sinit;
+	SamplerInitInfo sinit;
 	sinit.m_minMagFilter = SamplingFilter::LINEAR;
 	sinit.m_minMagFilter = SamplingFilter::LINEAR;
 	sinit.m_mipmapFilter = SamplingFilter::BASE;
 	sinit.m_mipmapFilter = SamplingFilter::BASE;
 	sinit.m_minLod = 0.0;
 	sinit.m_minLod = 0.0;
@@ -241,7 +241,7 @@ Error Ir::init(const ConfigSet& config)
 	m_integrationLutSampler = getGrManager().newInstance<Sampler>(sinit);
 	m_integrationLutSampler = getGrManager().newInstance<Sampler>(sinit);
 
 
 	// Init the resource group
 	// Init the resource group
-	ResourceGroupInitializer rcInit;
+	ResourceGroupInitInfo rcInit;
 	rcInit.m_textures[0].m_texture = m_envCubemapArr;
 	rcInit.m_textures[0].m_texture = m_envCubemapArr;
 	rcInit.m_textures[1].m_texture = m_irradianceCubemapArr;
 	rcInit.m_textures[1].m_texture = m_irradianceCubemapArr;
 
 
@@ -279,7 +279,7 @@ Error Ir::initIrradiance()
 		m_computeIrradiancePpline);
 		m_computeIrradiancePpline);
 
 
 	// Create the resources
 	// Create the resources
-	ResourceGroupInitializer rcInit;
+	ResourceGroupInitInfo rcInit;
 	rcInit.m_uniformBuffers[0].m_dynamic = true;
 	rcInit.m_uniformBuffers[0].m_dynamic = true;
 	rcInit.m_textures[0].m_texture = m_envCubemapArr;
 	rcInit.m_textures[0].m_texture = m_envCubemapArr;
 
 
@@ -615,7 +615,7 @@ Error Ir::renderReflection(SceneNode& node,
 
 
 		cmdb->bindResourceGroup(m_computeIrradianceResources, 0, &dinf);
 		cmdb->bindResourceGroup(m_computeIrradianceResources, 0, &dinf);
 
 
-		FramebufferInitializer fbinit;
+		FramebufferInitInfo fbinit;
 		fbinit.m_colorAttachmentsCount = 1;
 		fbinit.m_colorAttachmentsCount = 1;
 		fbinit.m_colorAttachments[0].m_texture = m_irradianceCubemapArr;
 		fbinit.m_colorAttachments[0].m_texture = m_irradianceCubemapArr;
 		fbinit.m_colorAttachments[0].m_arrayIndex = cubemapIdx;
 		fbinit.m_colorAttachments[0].m_arrayIndex = cubemapIdx;

+ 3 - 3
src/renderer/Is.cpp

@@ -276,7 +276,7 @@ Error Is::initInternal(const ConfigSet& config)
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
 		m_lightFrag, "shaders/IsLp.frag.glsl", pps.toCString(), "r_"));
 		m_lightFrag, "shaders/IsLp.frag.glsl", pps.toCString(), "r_"));
 
 
-	PipelineInitializer init;
+	PipelineInitInfo init;
 
 
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 	init.m_depthStencil.m_depthWriteEnabled = false;
 	init.m_depthStencil.m_depthWriteEnabled = false;
@@ -298,7 +298,7 @@ Error Is::initInternal(const ConfigSet& config)
 		MIPMAPS_COUNT,
 		MIPMAPS_COUNT,
 		m_rt);
 		m_rt);
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -309,7 +309,7 @@ Error Is::initInternal(const ConfigSet& config)
 	// Create resource group
 	// Create resource group
 	//
 	//
 	{
 	{
-		ResourceGroupInitializer init;
+		ResourceGroupInitInfo init;
 		init.m_textures[0].m_texture = m_r->getMs().getRt0();
 		init.m_textures[0].m_texture = m_r->getMs().getRt0();
 		init.m_textures[1].m_texture = m_r->getMs().getRt1();
 		init.m_textures[1].m_texture = m_r->getMs().getRt1();
 		init.m_textures[2].m_texture = m_r->getMs().getRt2();
 		init.m_textures[2].m_texture = m_r->getMs().getRt2();

+ 3 - 3
src/renderer/Lf.cpp

@@ -80,7 +80,7 @@ Error Lf::initSprite(const ConfigSet& config)
 
 
 	// Create ppline.
 	// Create ppline.
 	// Writes to IS with blending
 	// Writes to IS with blending
-	PipelineInitializer init;
+	PipelineInitInfo init;
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 	init.m_depthStencil.m_depthWriteEnabled = false;
 	init.m_depthStencil.m_depthWriteEnabled = false;
 	init.m_depthStencil.m_depthCompareFunction = CompareOperation::ALWAYS;
 	init.m_depthStencil.m_depthCompareFunction = CompareOperation::ALWAYS;
@@ -111,7 +111,7 @@ Error Lf::initOcclusion(const ConfigSet& config)
 	// - test depth no write
 	// - test depth no write
 	// - will run after MS
 	// - will run after MS
 	// - will not update color
 	// - will not update color
-	PipelineInitializer init;
+	PipelineInitInfo init;
 	init.m_vertex.m_bindingCount = 1;
 	init.m_vertex.m_bindingCount = 1;
 	init.m_vertex.m_bindings[0].m_stride = sizeof(Vec3);
 	init.m_vertex.m_bindings[0].m_stride = sizeof(Vec3);
 	init.m_vertex.m_attributeCount = 1;
 	init.m_vertex.m_attributeCount = 1;
@@ -134,7 +134,7 @@ Error Lf::initOcclusion(const ConfigSet& config)
 
 
 	// Init resource group
 	// Init resource group
 	{
 	{
-		ResourceGroupInitializer rcInit;
+		ResourceGroupInitInfo rcInit;
 		rcInit.m_vertexBuffers[0].m_dynamic = true;
 		rcInit.m_vertexBuffers[0].m_dynamic = true;
 		rcInit.m_uniformBuffers[0].m_dynamic = true;
 		rcInit.m_uniformBuffers[0].m_dynamic = true;
 		m_occlusionRcGroup = getGrManager().newInstance<ResourceGroup>(rcInit);
 		m_occlusionRcGroup = getGrManager().newInstance<ResourceGroup>(rcInit);

+ 2 - 2
src/renderer/MainRenderer.cpp

@@ -52,7 +52,7 @@ Error MainRenderer::create(ThreadPool* threadpool,
 	// Init default FB
 	// Init default FB
 	m_width = config.getNumber("width");
 	m_width = config.getNumber("width");
 	m_height = config.getNumber("height");
 	m_height = config.getNumber("height");
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	m_defaultFb = gr->newInstance<Framebuffer>(fbInit);
 	m_defaultFb = gr->newInstance<Framebuffer>(fbInit);
 
 
 	// Init renderer and manipulate the width/height
 	// Init renderer and manipulate the width/height
@@ -99,7 +99,7 @@ Error MainRenderer::create(ThreadPool* threadpool,
 		"Main renderer initialized. Rendering size %dx%d", m_width, m_height);
 		"Main renderer initialized. Rendering size %dx%d", m_width, m_height);
 
 
 	// Init RC group
 	// Init RC group
-	ResourceGroupInitializer rcinit;
+	ResourceGroupInitInfo rcinit;
 	if(m_r->getPpsEnabled())
 	if(m_r->getPpsEnabled())
 	{
 	{
 		rcinit.m_textures[0].m_texture = m_r->getPps().getRt();
 		rcinit.m_textures[0].m_texture = m_r->getPps().getRt();

+ 1 - 1
src/renderer/Ms.cpp

@@ -69,7 +69,7 @@ Error Ms::createRt(U32 samples)
 	loadop = AttachmentLoadOperation::CLEAR;
 	loadop = AttachmentLoadOperation::CLEAR;
 #endif
 #endif
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = ATTACHMENT_COUNT;
 	fbInit.m_colorAttachmentsCount = ATTACHMENT_COUNT;
 	fbInit.m_colorAttachments[0].m_texture = m_rt0;
 	fbInit.m_colorAttachments[0].m_texture = m_rt0;
 	fbInit.m_colorAttachments[0].m_loadOperation = loadop;
 	fbInit.m_colorAttachments[0].m_loadOperation = loadop;

+ 2 - 2
src/renderer/Pps.cpp

@@ -62,7 +62,7 @@ Error Pps::initInternal(const ConfigSet& config)
 		1,
 		1,
 		m_rt);
 		m_rt);
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -104,7 +104,7 @@ Error Pps::initInternal(const ConfigSet& config)
 		BufferAccessBit::CLIENT_WRITE);
 		BufferAccessBit::CLIENT_WRITE);
 
 
 	// RC goup
 	// RC goup
-	ResourceGroupInitializer rcInit;
+	ResourceGroupInitInfo rcInit;
 	rcInit.m_textures[0].m_texture = m_r->getIs().getRt();
 	rcInit.m_textures[0].m_texture = m_r->getIs().getRt();
 
 
 	if(m_r->getSsaoEnabled())
 	if(m_r->getSsaoEnabled())

+ 2 - 2
src/renderer/Renderer.cpp

@@ -344,7 +344,7 @@ void Renderer::createRenderTarget(U32 w,
 		ANKI_ASSERT(isAligned(16, h));
 		ANKI_ASSERT(isAligned(16, h));
 	}
 	}
 
 
-	TextureInitializer init;
+	TextureInitInfo init;
 
 
 	init.m_width = w;
 	init.m_width = w;
 	init.m_height = h;
 	init.m_height = h;
@@ -372,7 +372,7 @@ void Renderer::createRenderTarget(U32 w,
 void Renderer::createDrawQuadPipeline(
 void Renderer::createDrawQuadPipeline(
 	ShaderPtr frag, const ColorStateInfo& colorState, PipelinePtr& ppline)
 	ShaderPtr frag, const ColorStateInfo& colorState, PipelinePtr& ppline)
 {
 {
-	PipelineInitializer init;
+	PipelineInitInfo init;
 
 
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 	init.m_inputAssembler.m_topology = PrimitiveTopology::TRIANGLE_STRIP;
 
 

+ 2 - 2
src/renderer/Sm.cpp

@@ -43,7 +43,7 @@ Error Sm::init(const ConfigSet& config)
 	}
 	}
 
 
 	// Create shadowmaps array
 	// Create shadowmaps array
-	TextureInitializer sminit;
+	TextureInitInfo sminit;
 	sminit.m_type = TextureType::_2D_ARRAY;
 	sminit.m_type = TextureType::_2D_ARRAY;
 	sminit.m_width = m_resolution;
 	sminit.m_width = m_resolution;
 	sminit.m_height = m_resolution;
 	sminit.m_height = m_resolution;
@@ -62,7 +62,7 @@ Error Sm::init(const ConfigSet& config)
 	// Init 2D layers
 	// Init 2D layers
 	m_spots.create(getAllocator(), config.getNumber("is.sm.maxLights"));
 	m_spots.create(getAllocator(), config.getNumber("is.sm.maxLights"));
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_depthStencilAttachment.m_texture = m_spotTexArray;
 	fbInit.m_depthStencilAttachment.m_texture = m_spotTexArray;
 	fbInit.m_depthStencilAttachment.m_loadOperation =
 	fbInit.m_depthStencilAttachment.m_loadOperation =
 		AttachmentLoadOperation::CLEAR;
 		AttachmentLoadOperation::CLEAR;

+ 7 - 7
src/renderer/Ssao.cpp

@@ -70,7 +70,7 @@ Error Ssao::createFb(FramebufferPtr& fb, TexturePtr& rt)
 		m_width, m_height, RT_PIXEL_FORMAT, 1, SamplingFilter::LINEAR, 1, rt);
 		m_width, m_height, RT_PIXEL_FORMAT, 1, SamplingFilter::LINEAR, 1, rt);
 
 
 	// Create FB
 	// Create FB
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = rt;
 	fbInit.m_colorAttachments[0].m_texture = rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -109,7 +109,7 @@ Error Ssao::initInternal(const ConfigSet& config)
 	//
 	//
 	// noise texture
 	// noise texture
 	//
 	//
-	TextureInitializer tinit;
+	TextureInitInfo tinit;
 
 
 	tinit.m_width = tinit.m_height = NOISE_TEX_SIZE;
 	tinit.m_width = tinit.m_height = NOISE_TEX_SIZE;
 	tinit.m_type = TextureType::_2D;
 	tinit.m_type = TextureType::_2D;
@@ -158,7 +158,7 @@ Error Ssao::initInternal(const ConfigSet& config)
 	//
 	//
 	// Shaders
 	// Shaders
 	//
 	//
-	PipelineInitializer ppinit;
+	PipelineInitInfo ppinit;
 	ppinit.m_color.m_attachmentCount = 1;
 	ppinit.m_color.m_attachmentCount = 1;
 	ppinit.m_color.m_attachments[0].m_format = RT_PIXEL_FORMAT;
 	ppinit.m_color.m_attachments[0].m_format = RT_PIXEL_FORMAT;
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
@@ -233,8 +233,8 @@ Error Ssao::initInternal(const ConfigSet& config)
 	//
 	//
 	// Resource groups
 	// Resource groups
 	//
 	//
-	ResourceGroupInitializer rcinit;
-	SamplerInitializer sinit;
+	ResourceGroupInitInfo rcinit;
+	SamplerInitInfo sinit;
 	sinit.m_minMagFilter = SamplingFilter::LINEAR;
 	sinit.m_minMagFilter = SamplingFilter::LINEAR;
 	sinit.m_mipmapFilter = SamplingFilter::NEAREST;
 	sinit.m_mipmapFilter = SamplingFilter::NEAREST;
 	sinit.m_repeat = false;
 	sinit.m_repeat = false;
@@ -250,11 +250,11 @@ Error Ssao::initInternal(const ConfigSet& config)
 	rcinit.m_uniformBuffers[0].m_dynamic = true;
 	rcinit.m_uniformBuffers[0].m_dynamic = true;
 	m_rcFirst = gr.newInstance<ResourceGroup>(rcinit);
 	m_rcFirst = gr.newInstance<ResourceGroup>(rcinit);
 
 
-	rcinit = ResourceGroupInitializer();
+	rcinit = ResourceGroupInitInfo();
 	rcinit.m_textures[0].m_texture = m_vblurRt;
 	rcinit.m_textures[0].m_texture = m_vblurRt;
 	m_hblurRc = gr.newInstance<ResourceGroup>(rcinit);
 	m_hblurRc = gr.newInstance<ResourceGroup>(rcinit);
 
 
-	rcinit = ResourceGroupInitializer();
+	rcinit = ResourceGroupInitInfo();
 	rcinit.m_textures[0].m_texture = m_hblurRt;
 	rcinit.m_textures[0].m_texture = m_hblurRt;
 	m_vblurRc = gr.newInstance<ResourceGroup>(rcinit);
 	m_vblurRc = gr.newInstance<ResourceGroup>(rcinit);
 
 

+ 2 - 2
src/renderer/Sslf.cpp

@@ -59,7 +59,7 @@ Error Sslf::initInternal(const ConfigSet& config)
 		1,
 		1,
 		m_rt);
 		m_rt);
 
 
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_texture = m_rt;
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =
@@ -67,7 +67,7 @@ Error Sslf::initInternal(const ConfigSet& config)
 	m_fb = getGrManager().newInstance<Framebuffer>(fbInit);
 	m_fb = getGrManager().newInstance<Framebuffer>(fbInit);
 
 
 	// Create the resource group
 	// Create the resource group
-	ResourceGroupInitializer rcInit;
+	ResourceGroupInitInfo rcInit;
 	rcInit.m_textures[0].m_texture = m_r->getBloom().getRt();
 	rcInit.m_textures[0].m_texture = m_r->getBloom().getRt();
 	rcInit.m_textures[1].m_texture = m_lensDirtTex->getGrTexture();
 	rcInit.m_textures[1].m_texture = m_lensDirtTex->getGrTexture();
 
 

+ 2 - 2
src/renderer/Tiler.cpp

@@ -57,7 +57,7 @@ Error Tiler::initInternal()
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
 	ANKI_CHECK(getResourceManager().loadResourceToCache(
 		m_shader, "shaders/TilerMinMax.comp.glsl", pps.toCString(), "r_"));
 		m_shader, "shaders/TilerMinMax.comp.glsl", pps.toCString(), "r_"));
 
 
-	PipelineInitializer pplineInit;
+	PipelineInitInfo pplineInit;
 	pplineInit.m_shaders[U(ShaderType::COMPUTE)] = m_shader->getGrShader();
 	pplineInit.m_shaders[U(ShaderType::COMPUTE)] = m_shader->getGrShader();
 	m_ppline = getGrManager().newInstance<Pipeline>(pplineInit);
 	m_ppline = getGrManager().newInstance<Pipeline>(pplineInit);
 
 
@@ -71,7 +71,7 @@ Error Tiler::initInternal()
 			pboSize, BufferUsageBit::STORAGE, BufferAccessBit::CLIENT_MAP_READ);
 			pboSize, BufferUsageBit::STORAGE, BufferAccessBit::CLIENT_MAP_READ);
 
 
 		// Create graphics resources
 		// Create graphics resources
-		ResourceGroupInitializer rcinit;
+		ResourceGroupInitInfo rcinit;
 		rcinit.m_storageBuffers[0].m_buffer = m_outBuffers[i];
 		rcinit.m_storageBuffers[0].m_buffer = m_outBuffers[i];
 		rcinit.m_textures[0].m_texture = m_r->getMs().getDepthRt();
 		rcinit.m_textures[0].m_texture = m_r->getMs().getDepthRt();
 
 

+ 2 - 2
src/renderer/Tm.cpp

@@ -29,7 +29,7 @@ Error Tm::create(const ConfigSet& initializer)
 		"rppstm_"));
 		"rppstm_"));
 
 
 	// Create ppline
 	// Create ppline
-	PipelineInitializer pplineInit;
+	PipelineInitInfo pplineInit;
 	pplineInit.m_shaders[U(ShaderType::COMPUTE)] =
 	pplineInit.m_shaders[U(ShaderType::COMPUTE)] =
 		m_luminanceShader->getGrShader();
 		m_luminanceShader->getGrShader();
 	m_luminancePpline = getGrManager().newInstance<Pipeline>(pplineInit);
 	m_luminancePpline = getGrManager().newInstance<Pipeline>(pplineInit);
@@ -47,7 +47,7 @@ Error Tm::create(const ConfigSet& initializer)
 	cmdb->flush();
 	cmdb->flush();
 
 
 	// Create descriptors
 	// Create descriptors
-	ResourceGroupInitializer rcinit;
+	ResourceGroupInitInfo rcinit;
 	rcinit.m_storageBuffers[0].m_buffer = m_luminanceBuff;
 	rcinit.m_storageBuffers[0].m_buffer = m_luminanceBuff;
 	rcinit.m_storageBuffers[0].m_range = sizeof(Vec4);
 	rcinit.m_storageBuffers[0].m_range = sizeof(Vec4);
 	rcinit.m_textures[0].m_texture = m_r->getIs().getRt();
 	rcinit.m_textures[0].m_texture = m_r->getIs().getRt();

+ 4 - 4
src/renderer/Upsample.cpp

@@ -19,8 +19,8 @@ Error Upsample::init(const ConfigSet& config)
 	GrManager& gr = getGrManager();
 	GrManager& gr = getGrManager();
 
 
 	// Create RC group
 	// Create RC group
-	ResourceGroupInitializer rcInit;
-	SamplerInitializer sinit;
+	ResourceGroupInitInfo rcInit;
+	SamplerInitInfo sinit;
 	sinit.m_repeat = false;
 	sinit.m_repeat = false;
 
 
 	rcInit.m_textures[0].m_texture = m_r->getMs().getDepthRt();
 	rcInit.m_textures[0].m_texture = m_r->getMs().getDepthRt();
@@ -60,7 +60,7 @@ Error Upsample::init(const ConfigSet& config)
 		"r_refl_"));
 		"r_refl_"));
 
 
 	// Ppline
 	// Ppline
-	PipelineInitializer ppinit;
+	PipelineInitInfo ppinit;
 
 
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
 	ppinit.m_depthStencil.m_depthWriteEnabled = false;
 	ppinit.m_depthStencil.m_depthCompareFunction = CompareOperation::ALWAYS;
 	ppinit.m_depthStencil.m_depthCompareFunction = CompareOperation::ALWAYS;
@@ -75,7 +75,7 @@ Error Upsample::init(const ConfigSet& config)
 	m_ppline = gr.newInstance<Pipeline>(ppinit);
 	m_ppline = gr.newInstance<Pipeline>(ppinit);
 
 
 	// Create FB
 	// Create FB
-	FramebufferInitializer fbInit;
+	FramebufferInitInfo fbInit;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachmentsCount = 1;
 	fbInit.m_colorAttachments[0].m_texture = m_r->getIs().getRt();
 	fbInit.m_colorAttachments[0].m_texture = m_r->getIs().getRt();
 	fbInit.m_colorAttachments[0].m_loadOperation =
 	fbInit.m_colorAttachments[0].m_loadOperation =

+ 1 - 1
src/resource/CollisionResource.cpp

@@ -30,7 +30,7 @@ Error CollisionResource::load(const ResourceFilename& filename)
 	ANKI_CHECK(collEl.getChildElement("value", valEl));
 	ANKI_CHECK(collEl.getChildElement("value", valEl));
 
 
 	PhysicsWorld& physics = getManager()._getPhysicsWorld();
 	PhysicsWorld& physics = getManager()._getPhysicsWorld();
-	PhysicsCollisionShape::Initializer csInit;
+	PhysicsCollisionShapeInitInfo csInit;
 
 
 	if(type == "sphere")
 	if(type == "sphere")
 	{
 	{

+ 2 - 2
src/resource/Material.cpp

@@ -29,7 +29,7 @@ namespace anki
 class UpdateTexturesVisitor
 class UpdateTexturesVisitor
 {
 {
 public:
 public:
-	ResourceGroupInitializer* m_init = nullptr;
+	ResourceGroupInitInfo* m_init = nullptr;
 	ResourceManager* m_manager = nullptr;
 	ResourceManager* m_manager = nullptr;
 
 
 	template<typename TMaterialVariableTemplate>
 	template<typename TMaterialVariableTemplate>
@@ -438,7 +438,7 @@ Error Material::createProgramSourceToCache(
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void Material::fillResourceGroupInitializer(ResourceGroupInitializer& rcinit)
+void Material::fillResourceGroupInitInfo(ResourceGroupInitInfo& rcinit)
 {
 {
 	rcinit.m_uniformBuffers[0].m_dynamic = true;
 	rcinit.m_uniformBuffers[0].m_dynamic = true;
 
 

+ 6 - 6
src/resource/Model.cpp

@@ -83,8 +83,8 @@ Error ModelPatch::create(SArray<CString> meshFNames,
 	ANKI_CHECK(manager->loadResource(mtlFName, m_mtl));
 	ANKI_CHECK(manager->loadResource(mtlFName, m_mtl));
 
 
 	// Iterate material variables for textures
 	// Iterate material variables for textures
-	ResourceGroupInitializer rcinit;
-	m_mtl->fillResourceGroupInitializer(rcinit);
+	ResourceGroupInitInfo rcinit;
+	m_mtl->fillResourceGroupInitInfo(rcinit);
 
 
 	// Load meshes and update resource group
 	// Load meshes and update resource group
 	m_meshCount = 0;
 	m_meshCount = 0;
@@ -144,8 +144,8 @@ PipelinePtr ModelPatch::getPipeline(const RenderingKey& key) const
 	{
 	{
 		const MaterialVariant& variant = m_mtl->getVariant(key);
 		const MaterialVariant& variant = m_mtl->getVariant(key);
 
 
-		PipelineInitializer pplineInit;
-		computePipelineInitializer(key, pplineInit);
+		PipelineInitInfo pplineInit;
+		computePipelineInitInfo(key, pplineInit);
 
 
 		pplineInit.m_shaders[U(ShaderType::VERTEX)] =
 		pplineInit.m_shaders[U(ShaderType::VERTEX)] =
 			variant.getShader(ShaderType::VERTEX);
 			variant.getShader(ShaderType::VERTEX);
@@ -171,8 +171,8 @@ PipelinePtr ModelPatch::getPipeline(const RenderingKey& key) const
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void ModelPatch::computePipelineInitializer(
-	const RenderingKey& key, PipelineInitializer& pinit) const
+void ModelPatch::computePipelineInitInfo(
+	const RenderingKey& key, PipelineInitInfo& pinit) const
 {
 {
 	//
 	//
 	// Vertex state
 	// Vertex state

+ 1 - 1
src/resource/ParticleEmitterResource.cpp

@@ -227,7 +227,7 @@ Error ParticleEmitterResource::load(const ResourceFilename& filename)
 
 
 	// Create ppline
 	// Create ppline
 	//
 	//
-	PipelineInitializer pinit;
+	PipelineInitInfo pinit;
 
 
 	pinit.m_vertex.m_bindingCount = 1;
 	pinit.m_vertex.m_bindingCount = 1;
 	pinit.m_vertex.m_bindings[0].m_stride = VERTEX_SIZE;
 	pinit.m_vertex.m_bindings[0].m_stride = VERTEX_SIZE;

+ 1 - 1
src/resource/ResourceManager.cpp

@@ -35,7 +35,7 @@ ResourceManager::~ResourceManager()
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-Error ResourceManager::create(Initializer& init)
+Error ResourceManager::create(ResourceManagerInitInfo& init)
 {
 {
 	Error err = ErrorCode::NONE;
 	Error err = ErrorCode::NONE;
 
 

+ 1 - 1
src/resource/TextureResource.cpp

@@ -81,7 +81,7 @@ Error TextureResource::load(const ResourceFilename& filename)
 	// Always first to avoid assertions (because of the check of the allocator)
 	// Always first to avoid assertions (because of the check of the allocator)
 	CommandBufferPtr cmdb = gr.newInstance<CommandBuffer>();
 	CommandBufferPtr cmdb = gr.newInstance<CommandBuffer>();
 
 
-	TextureInitializer init;
+	TextureInitInfo init;
 	U layers = 0;
 	U layers = 0;
 
 
 	// Load image
 	// Load image

+ 1 - 1
src/scene/BodyNode.cpp

@@ -66,7 +66,7 @@ Error BodyNode::create(const CString& name, const CString& resourceFname)
 	ANKI_CHECK(getResourceManager().loadResource(resourceFname, m_rsrc));
 	ANKI_CHECK(getResourceManager().loadResource(resourceFname, m_rsrc));
 
 
 	// Create body
 	// Create body
-	PhysicsBody::Initializer init;
+	PhysicsBodyInitInfo init;
 	init.m_mass = 1.0;
 	init.m_mass = 1.0;
 	init.m_shape = m_rsrc->getShape();
 	init.m_shape = m_rsrc->getShape();
 	m_body = getSceneGraph()._getPhysicsWorld().newInstance<PhysicsBody>(init);
 	m_body = getSceneGraph()._getPhysicsWorld().newInstance<PhysicsBody>(init);

+ 1 - 1
src/scene/LensFlareComponent.cpp

@@ -38,7 +38,7 @@ Error LensFlareComponent::create(const CString& textureFilename)
 	}
 	}
 
 
 	// Resource group
 	// Resource group
-	ResourceGroupInitializer rcInit;
+	ResourceGroupInitInfo rcInit;
 	rcInit.m_textures[0].m_texture = m_tex->getGrTexture();
 	rcInit.m_textures[0].m_texture = m_tex->getGrTexture();
 	rcInit.m_uniformBuffers[0].m_dynamic = true;
 	rcInit.m_uniformBuffers[0].m_dynamic = true;
 	m_rcGroup = gr.newInstance<ResourceGroup>(rcInit);
 	m_rcGroup = gr.newInstance<ResourceGroup>(rcInit);

+ 2 - 3
src/scene/ParticleEmitter.cpp

@@ -337,9 +337,8 @@ Error ParticleEmitter::create(const CString& name, const CString& filename)
 
 
 	GrManager& gr = getSceneGraph().getGrManager();
 	GrManager& gr = getSceneGraph().getGrManager();
 
 
-	ResourceGroupInitializer rcinit;
-	m_particleEmitterResource->getMaterial().fillResourceGroupInitializer(
-		rcinit);
+	ResourceGroupInitInfo rcinit;
+	m_particleEmitterResource->getMaterial().fillResourceGroupInitInfo(rcinit);
 
 
 	for(U i = 0; i < MAX_FRAMES_IN_FLIGHT; ++i)
 	for(U i = 0; i < MAX_FRAMES_IN_FLIGHT; ++i)
 	{
 	{

+ 1 - 1
src/scene/PlayerNode.cpp

@@ -142,7 +142,7 @@ Error PlayerNode::create(const CString& name, const Vec4& position)
 	ANKI_CHECK(SceneNode::create(name));
 	ANKI_CHECK(SceneNode::create(name));
 
 
 	// Create physics object
 	// Create physics object
-	PhysicsPlayerController::Initializer init;
+	PhysicsPlayerControllerInitInfo init;
 	init.m_position = position;
 	init.m_position = position;
 	m_player =
 	m_player =
 		getSceneGraph()._getPhysicsWorld().newInstance<PhysicsPlayerController>(
 		getSceneGraph()._getPhysicsWorld().newInstance<PhysicsPlayerController>(

+ 1 - 1
src/scene/StaticCollisionNode.cpp

@@ -33,7 +33,7 @@ Error StaticCollisionNode::create(const CString& name,
 	ANKI_CHECK(getResourceManager().loadResource(resourceFname, m_rsrc));
 	ANKI_CHECK(getResourceManager().loadResource(resourceFname, m_rsrc));
 
 
 	// Create body
 	// Create body
-	PhysicsBody::Initializer init;
+	PhysicsBodyInitInfo init;
 	init.m_shape = m_rsrc->getShape();
 	init.m_shape = m_rsrc->getShape();
 	init.m_static = true;
 	init.m_static = true;
 	init.m_startTrf = transform;
 	init.m_startTrf = transform;

+ 3 - 3
src/ui/UiInterfaceImpl.cpp

@@ -40,7 +40,7 @@ Error UiInterfaceImpl::init(GrManager* gr, ResourceManager* rc)
 		"shaders/UiLines.frag.glsl", m_stages[StageId::LINES].m_fShader));
 		"shaders/UiLines.frag.glsl", m_stages[StageId::LINES].m_fShader));
 
 
 	// Init pplines
 	// Init pplines
-	PipelineInitializer ppinit;
+	PipelineInitInfo ppinit;
 	ppinit.m_vertex.m_bindingCount = 1;
 	ppinit.m_vertex.m_bindingCount = 1;
 	ppinit.m_vertex.m_bindings[0].m_stride = sizeof(Vertex);
 	ppinit.m_vertex.m_bindings[0].m_stride = sizeof(Vertex);
 	ppinit.m_vertex.m_attributeCount = 3;
 	ppinit.m_vertex.m_attributeCount = 3;
@@ -89,7 +89,7 @@ Error UiInterfaceImpl::init(GrManager* gr, ResourceManager* rc)
 	{
 	{
 		for(U i = 0; i < m_stages[s].m_rcGroups.getSize(); ++i)
 		for(U i = 0; i < m_stages[s].m_rcGroups.getSize(); ++i)
 		{
 		{
-			ResourceGroupInitializer rcinit;
+			ResourceGroupInitInfo rcinit;
 			rcinit.m_vertexBuffers[0].m_buffer = m_stages[s].m_vertBuffs[i];
 			rcinit.m_vertexBuffers[0].m_buffer = m_stages[s].m_vertBuffs[i];
 
 
 			if(s == StageId::TEXTURED_TRIANGLES)
 			if(s == StageId::TEXTURED_TRIANGLES)
@@ -206,7 +206,7 @@ Error UiInterfaceImpl::createR8Image(
 	}
 	}
 
 
 	// Allocate the texture
 	// Allocate the texture
-	TextureInitializer tinit;
+	TextureInitInfo tinit;
 	tinit.m_width = size.x();
 	tinit.m_width = size.x();
 	tinit.m_height = size.y();
 	tinit.m_height = size.y();
 	tinit.m_format = PixelFormat(ComponentFormat::R8, TransformFormat::UNORM);
 	tinit.m_format = PixelFormat(ComponentFormat::R8, TransformFormat::UNORM);

+ 13 - 0
src/util/Memory.cpp

@@ -520,6 +520,19 @@ void StackMemoryPool::reset()
 	}
 	}
 }
 }
 
 
+//==============================================================================
+PtrSize StackMemoryPool::getMemoryCapacity() const
+{
+	PtrSize sum = 0;
+	U crntChunkIdx = m_crntChunkIdx.load();
+	for(U i = 0; i <= crntChunkIdx; ++i)
+	{
+		sum += m_chunks[i].m_size;
+	}
+
+	return sum;
+}
+
 //==============================================================================
 //==============================================================================
 // ChainMemoryPool                                                             =
 // ChainMemoryPool                                                             =
 //==============================================================================
 //==============================================================================

+ 1 - 1
tests/resource/ResourceManager.cpp

@@ -19,7 +19,7 @@ ANKI_TEST(Resource, ResourceManager)
 
 
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
 
 
-	ResourceManager::Initializer rinit;
+	ResourceManagerInitInfo rinit;
 	rinit.m_gr = nullptr;
 	rinit.m_gr = nullptr;
 	rinit.m_config = &config;
 	rinit.m_config = &config;
 	rinit.m_cacheDir = "/tmp/";
 	rinit.m_cacheDir = "/tmp/";