Browse Source

Add more compiler warnings. Modernize some attributes since we are in C++17 now

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
a6a08b42ba
100 changed files with 296 additions and 316 deletions
  1. 2 1
      AnKi/Collision/Aabb.cpp
  2. 1 1
      AnKi/Collision/Aabb.h
  3. 2 2
      AnKi/Collision/ConvexHullShape.h
  4. 6 6
      AnKi/Collision/FunctionsTestCollision.cpp
  5. 2 1
      AnKi/Collision/Obb.cpp
  6. 1 1
      AnKi/Collision/Obb.h
  7. 3 3
      AnKi/Collision/Ray.h
  8. 2 1
      AnKi/Collision/Sphere.cpp
  9. 0 2
      AnKi/Config.h.cmake
  10. 4 4
      AnKi/Core/App.cpp
  11. 5 6
      AnKi/Core/App.h
  12. 3 3
      AnKi/Core/ConfigSet.h
  13. 1 2
      AnKi/Core/CoreTracer.cpp
  14. 1 1
      AnKi/Core/CoreTracer.h
  15. 1 1
      AnKi/Core/DeveloperConsole.h
  16. 1 1
      AnKi/Core/GpuMemoryPools.cpp
  17. 3 3
      AnKi/Core/GpuMemoryPools.h
  18. 1 1
      AnKi/Core/NativeWindow.h
  19. 1 1
      AnKi/Core/NativeWindowAndroid.h
  20. 1 1
      AnKi/Core/NativeWindowSdl.h
  21. 1 1
      AnKi/Core/StatsUi.h
  22. 1 1
      AnKi/Core/StdinListener.h
  23. 2 2
      AnKi/Gr/AccelerationStructure.h
  24. 1 1
      AnKi/Gr/Buffer.h
  25. 1 1
      AnKi/Gr/CommandBuffer.h
  26. 1 1
      AnKi/Gr/Fence.h
  27. 1 1
      AnKi/Gr/Framebuffer.h
  28. 13 13
      AnKi/Gr/GrManager.h
  29. 1 1
      AnKi/Gr/OcclusionQuery.h
  30. 2 4
      AnKi/Gr/RenderGraph.cpp
  31. 2 3
      AnKi/Gr/RenderGraph.h
  32. 5 10
      AnKi/Gr/RenderGraph.inl.h
  33. 1 1
      AnKi/Gr/Sampler.h
  34. 1 1
      AnKi/Gr/Shader.h
  35. 1 1
      AnKi/Gr/ShaderProgram.h
  36. 1 1
      AnKi/Gr/Texture.h
  37. 1 1
      AnKi/Gr/TextureView.h
  38. 1 1
      AnKi/Gr/TimestampQuery.h
  39. 1 1
      AnKi/Gr/Utils/FrameGpuAllocator.h
  40. 4 2
      AnKi/Gr/Utils/Functions.cpp
  41. 1 1
      AnKi/Gr/Vulkan/AccelerationStructureImpl.h
  42. 3 4
      AnKi/Gr/Vulkan/BufferImpl.cpp
  43. 2 2
      AnKi/Gr/Vulkan/BufferImpl.h
  44. 3 2
      AnKi/Gr/Vulkan/CommandBuffer.cpp
  45. 2 4
      AnKi/Gr/Vulkan/CommandBufferFactory.cpp
  46. 4 4
      AnKi/Gr/Vulkan/CommandBufferFactory.h
  47. 2 2
      AnKi/Gr/Vulkan/CommandBufferImpl.cpp
  48. 1 1
      AnKi/Gr/Vulkan/CommandBufferImpl.h
  49. 13 11
      AnKi/Gr/Vulkan/CommandBufferImpl.inl.h
  50. 25 25
      AnKi/Gr/Vulkan/Common.h
  51. 11 13
      AnKi/Gr/Vulkan/DescriptorSet.cpp
  52. 4 7
      AnKi/Gr/Vulkan/DescriptorSet.h
  53. 2 2
      AnKi/Gr/Vulkan/FramebufferImpl.h
  54. 4 8
      AnKi/Gr/Vulkan/GpuMemoryManager.cpp
  55. 2 2
      AnKi/Gr/Vulkan/GpuMemoryManager.h
  56. 3 3
      AnKi/Gr/Vulkan/GrManagerImpl.cpp
  57. 7 8
      AnKi/Gr/Vulkan/GrManagerImpl.h
  58. 1 1
      AnKi/Gr/Vulkan/OcclusionQueryImpl.h
  59. 2 3
      AnKi/Gr/Vulkan/PipelineCache.h
  60. 2 2
      AnKi/Gr/Vulkan/PipelineLayout.h
  61. 1 1
      AnKi/Gr/Vulkan/QueryFactory.h
  62. 3 3
      AnKi/Gr/Vulkan/SamplerFactory.h
  63. 1 1
      AnKi/Gr/Vulkan/SamplerImpl.h
  64. 1 1
      AnKi/Gr/Vulkan/ShaderImpl.h
  65. 4 2
      AnKi/Gr/Vulkan/SwapchainFactory.cpp
  66. 1 1
      AnKi/Gr/Vulkan/SwapchainFactory.h
  67. 2 3
      AnKi/Gr/Vulkan/TextureImpl.cpp
  68. 8 9
      AnKi/Gr/Vulkan/TextureImpl.h
  69. 1 1
      AnKi/Gr/Vulkan/TextureViewImpl.h
  70. 1 1
      AnKi/Gr/Vulkan/TimestampQueryImpl.h
  71. 6 4
      AnKi/Importer/GltfImporter.cpp
  72. 15 16
      AnKi/Importer/GltfImporter.h
  73. 16 19
      AnKi/Importer/ImageImporter.cpp
  74. 1 1
      AnKi/Importer/ImageImporter.h
  75. 3 3
      AnKi/Input/Input.h
  76. 1 1
      AnKi/Input/InputAndroid.h
  77. 2 2
      AnKi/Math/Mat.h
  78. 1 2
      AnKi/Math/Transform.h
  79. 5 5
      AnKi/Physics/Common.h
  80. 5 4
      AnKi/Physics/PhysicsDrawer.h
  81. 2 1
      AnKi/Physics/PhysicsPlayerController.h
  82. 3 3
      AnKi/Physics/PhysicsTrigger.h
  83. 1 3
      AnKi/Physics/PhysicsWorld.cpp
  84. 2 2
      AnKi/Physics/PhysicsWorld.h
  85. 1 1
      AnKi/Renderer/AccelerationStructureBuilder.h
  86. 4 4
      AnKi/Renderer/Bloom.h
  87. 2 1
      AnKi/Renderer/ClusterBinning.cpp
  88. 1 1
      AnKi/Renderer/ClusterBinning.h
  89. 1 1
      AnKi/Renderer/Dbg.h
  90. 2 2
      AnKi/Renderer/DepthDownscale.h
  91. 2 2
      AnKi/Renderer/DownscaleBlur.h
  92. 2 2
      AnKi/Renderer/FinalComposite.h
  93. 1 1
      AnKi/Renderer/ForwardShading.h
  94. 3 3
      AnKi/Renderer/GBuffer.h
  95. 2 2
      AnKi/Renderer/GBufferPost.h
  96. 1 1
      AnKi/Renderer/GenericCompute.h
  97. 2 2
      AnKi/Renderer/IndirectDiffuse.h
  98. 6 6
      AnKi/Renderer/IndirectDiffuseProbes.h
  99. 1 1
      AnKi/Renderer/IndirectSpecular.cpp
  100. 2 2
      AnKi/Renderer/IndirectSpecular.h

+ 2 - 1
AnKi/Collision/Aabb.cpp

@@ -38,7 +38,8 @@ Aabb Aabb::getCompoundShape(const Aabb& b) const
 	return out;
 }
 
-void Aabb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride, PtrSize buffSize)
+void Aabb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride,
+							 [[maybe_unused]] PtrSize buffSize)
 {
 	// Preconditions
 	ANKI_ASSERT(pointBuffer);

+ 1 - 1
AnKi/Collision/Aabb.h

@@ -92,7 +92,7 @@ public:
 	}
 
 	/// Compute the GJK support.
-	ANKI_USE_RESULT Vec4 computeSupport(const Vec4& dir) const;
+	[[nodiscard]] Vec4 computeSupport(const Vec4& dir) const;
 
 	/// It uses a nice trick to avoid unwanted calculations
 	Aabb getTransformed(const Transform& transform) const;

+ 2 - 2
AnKi/Collision/ConvexHullShape.h

@@ -82,10 +82,10 @@ public:
 	void setTransform(const Transform& trf);
 
 	/// Get a transformed.
-	ANKI_USE_RESULT ConvexHullShape getTransformed(const Transform& trf) const;
+	[[nodiscard]] ConvexHullShape getTransformed(const Transform& trf) const;
 
 	/// Compute the GJK support.
-	ANKI_USE_RESULT Vec4 computeSupport(const Vec4& dir) const;
+	[[nodiscard]] Vec4 computeSupport(const Vec4& dir) const;
 
 private:
 	Transform m_trf;

+ 6 - 6
AnKi/Collision/FunctionsTestCollision.cpp

@@ -161,7 +161,7 @@ Bool testCollision(const Aabb& aabb, const LineSegment& ls)
 	return true;
 }
 
-Bool testCollision(const Aabb& aabb, const Cone& cone)
+Bool testCollision([[maybe_unused]] const Aabb& aabb, [[maybe_unused]] const Cone& cone)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;
@@ -294,7 +294,7 @@ Bool testCollision(const Obb& obb, const LineSegment& ls)
 	return true;
 }
 
-Bool testCollision(const Obb& obb, const Cone& cone)
+Bool testCollision([[maybe_unused]] const Obb& obb, [[maybe_unused]] const Cone& cone)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;
@@ -305,25 +305,25 @@ Bool testCollision(const ConvexHullShape& a, const ConvexHullShape& b)
 	return testCollisionGjk(a, b);
 }
 
-Bool testCollision(const ConvexHullShape& hull, const LineSegment& ls)
+Bool testCollision([[maybe_unused]] const ConvexHullShape& hull, [[maybe_unused]] const LineSegment& ls)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;
 }
 
-Bool testCollision(const ConvexHullShape& hull, const Cone& cone)
+Bool testCollision([[maybe_unused]] const ConvexHullShape& hull, [[maybe_unused]] const Cone& cone)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;
 }
 
-Bool testCollision(const LineSegment& a, const LineSegment& b)
+Bool testCollision([[maybe_unused]] const LineSegment& a, [[maybe_unused]] const LineSegment& b)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;
 }
 
-Bool testCollision(const Cone& a, const Cone& b)
+Bool testCollision([[maybe_unused]] const Cone& a, [[maybe_unused]] const Cone& b)
 {
 	ANKI_ASSERT(!"TODO");
 	return false;

+ 2 - 1
AnKi/Collision/Obb.cpp

@@ -74,7 +74,8 @@ void Obb::getExtremePoints(Array<Vec4, 8>& points) const
 	}
 }
 
-void Obb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride, PtrSize buffSize)
+void Obb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride,
+							[[maybe_unused]] PtrSize buffSize)
 {
 	// Preconditions
 	ANKI_ASSERT(pointBuffer);

+ 1 - 1
AnKi/Collision/Obb.h

@@ -105,7 +105,7 @@ public:
 	void getExtremePoints(Array<Vec4, 8>& points) const;
 
 	/// Compute the GJK support.
-	ANKI_USE_RESULT Vec4 computeSupport(const Vec4& dir) const;
+	[[nodiscard]] Vec4 computeSupport(const Vec4& dir) const;
 
 private:
 	Vec4 m_center

+ 3 - 3
AnKi/Collision/Ray.h

@@ -62,7 +62,7 @@ public:
 		m_origin = origin.xyz0();
 	}
 
-	ANKI_USE_RESULT const Vec4& getOrigin() const
+	[[nodiscard]] const Vec4& getOrigin() const
 	{
 		check();
 		return m_origin;
@@ -78,13 +78,13 @@ public:
 		m_dir = dir.xyz0();
 	}
 
-	ANKI_USE_RESULT const Vec4& getDirection() const
+	[[nodiscard]] const Vec4& getDirection() const
 	{
 		check();
 		return m_dir;
 	}
 
-	ANKI_USE_RESULT Ray getTransformed(const Transform& trf) const
+	[[nodiscard]] Ray getTransformed(const Transform& trf) const
 	{
 		check();
 		Ray out;

+ 2 - 1
AnKi/Collision/Sphere.cpp

@@ -31,7 +31,8 @@ Sphere Sphere::getCompoundShape(const Sphere& b) const
 	return Sphere((ca + cb) / 2.0f, (ca - cb).getLength() / 2.0f);
 }
 
-void Sphere::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride, PtrSize buffSize)
+void Sphere::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize pointStride,
+							   [[maybe_unused]] PtrSize buffSize)
 {
 	// Calc center
 	{

+ 0 - 2
AnKi/Config.h.cmake

@@ -167,7 +167,6 @@
 #	define ANKI_LIKELY(x) __builtin_expect(!!(x), 1)
 #	define ANKI_UNLIKELY(x) __builtin_expect(!!(x), 0)
 #	define ANKI_RESTRICT __restrict
-#	define ANKI_USE_RESULT __attribute__((warn_unused_result))
 #	define ANKI_FORCE_INLINE __attribute__((always_inline))
 #	define ANKI_DONT_INLINE __attribute__((noinline))
 #	define ANKI_UNUSED __attribute__((__unused__))
@@ -181,7 +180,6 @@
 #	define ANKI_LIKELY(x) (x)
 #	define ANKI_UNLIKELY(x) (x)
 #	define ANKI_RESTRICT
-#	define ANKI_USE_RESULT
 #	define ANKI_FORCE_INLINE
 #	define ANKI_DONT_INLINE
 #	define ANKI_UNUSED

+ 4 - 4
AnKi/Core/App.cpp

@@ -43,7 +43,7 @@ namespace anki {
 android_app* g_androidApp = nullptr;
 #endif
 
-void* App::MemStats::allocCallback(void* userData, void* ptr, PtrSize size, PtrSize alignment)
+void* App::MemStats::allocCallback(void* userData, void* ptr, PtrSize size, [[maybe_unused]] PtrSize alignment)
 {
 	ANKI_ASSERT(userData);
 
@@ -154,11 +154,11 @@ void App::cleanup()
 	m_cacheDir.destroy(m_heapAlloc);
 }
 
-Error App::init(ConfigSet* config, CString executableFilename, AllocAlignedCallback allocCb, void* allocCbUserData)
+Error App::init(ConfigSet* config, AllocAlignedCallback allocCb, void* allocCbUserData)
 {
 	ANKI_ASSERT(config);
 	m_config = config;
-	const Error err = initInternal(executableFilename, allocCb, allocCbUserData);
+	const Error err = initInternal(allocCb, allocCbUserData);
 	if(err)
 	{
 		ANKI_CORE_LOGE("App initialization failed. Shutting down");
@@ -168,7 +168,7 @@ Error App::init(ConfigSet* config, CString executableFilename, AllocAlignedCallb
 	return err;
 }
 
-Error App::initInternal(CString executableFilename, AllocAlignedCallback allocCb, void* allocCbUserData)
+Error App::initInternal(AllocAlignedCallback allocCb, void* allocCbUserData)
 {
 	LoggerSingleton::get().enableVerbosity(m_config->getCoreVerboseLog());
 

+ 5 - 6
AnKi/Core/App.h

@@ -42,8 +42,7 @@ public:
 
 	/// Initialize the application.
 	/// @param[in,out] config The config. Needs to be alive as long as the app is alive.
-	ANKI_USE_RESULT Error init(ConfigSet* config, CString executableFilename, AllocAlignedCallback allocCb,
-							   void* allocCbUserData);
+	Error init(ConfigSet* config, AllocAlignedCallback allocCb, void* allocCbUserData);
 
 	const String& getSettingsDirectory() const
 	{
@@ -81,10 +80,10 @@ public:
 	}
 
 	/// Run the main loop.
-	ANKI_USE_RESULT Error mainLoop();
+	Error mainLoop();
 
 	/// The user code to run along with the other main loop code.
-	virtual ANKI_USE_RESULT Error userMainLoop(Bool& quit, Second elapsedTime)
+	virtual Error userMainLoop([[maybe_unused]] Bool& quit, [[maybe_unused]] Second elapsedTime)
 	{
 		// Do nothing
 		return Error::NONE;
@@ -200,9 +199,9 @@ private:
 
 	void initMemoryCallbacks(AllocAlignedCallback allocCb, void* allocCbUserData);
 
-	ANKI_USE_RESULT Error initInternal(CString executableFilename, AllocAlignedCallback allocCb, void* allocCbUserData);
+	Error initInternal(AllocAlignedCallback allocCb, void* allocCbUserData);
 
-	ANKI_USE_RESULT Error initDirs();
+	Error initDirs();
 	void cleanup();
 
 	/// Inject a new UI element in the render queue for displaying various stuff.

+ 3 - 3
AnKi/Core/ConfigSet.h

@@ -37,11 +37,11 @@ public:
 
 	void init(AllocAlignedCallback allocCb, void* allocCbUserData);
 
-	ANKI_USE_RESULT Error loadFromFile(CString filename);
+	Error loadFromFile(CString filename);
 
-	ANKI_USE_RESULT Error saveToFile(CString filename) const;
+	Error saveToFile(CString filename) const;
 
-	ANKI_USE_RESULT Error setFromCommandLineArguments(U32 cmdLineArgsCount, char* cmdLineArgs[]);
+	Error setFromCommandLineArguments(U32 cmdLineArgsCount, char* cmdLineArgs[]);
 
 	// Define getters and setters
 #if ANKI_EXTRA_CHECKS

+ 1 - 2
AnKi/Core/CoreTracer.cpp

@@ -70,8 +70,7 @@ CoreTracer::~CoreTracer()
 		m_quit = true;
 		m_cvar.notifyOne();
 	}
-	Error err = m_thread.join();
-	(void)err;
+	[[maybe_unused]] Error err = m_thread.join();
 
 	// Finalize trace file
 	if(m_traceJsonFile.isOpen())

+ 1 - 1
AnKi/Core/CoreTracer.h

@@ -25,7 +25,7 @@ public:
 	~CoreTracer();
 
 	/// @param directory The directory to store the trace and counters.
-	ANKI_USE_RESULT Error init(GenericMemoryPoolAllocator<U8> alloc, CString directory);
+	Error init(GenericMemoryPoolAllocator<U8> alloc, CString directory);
 
 	/// It will flush everything.
 	void flushFrame(U64 frame);

+ 1 - 1
AnKi/Core/DeveloperConsole.h

@@ -26,7 +26,7 @@ public:
 
 	~DeveloperConsole();
 
-	ANKI_USE_RESULT Error init(AllocAlignedCallback allocCb, void* allocCbUserData, ScriptManager* scriptManager);
+	Error init(AllocAlignedCallback allocCb, void* allocCbUserData, ScriptManager* scriptManager);
 
 	void build(CanvasPtr ctx) override;
 

+ 1 - 1
AnKi/Core/GpuMemoryPools.cpp

@@ -42,7 +42,7 @@ Error VertexGpuMemoryPool::init(GenericMemoryPoolAllocator<U8> alloc, GrManager*
 	return Error::NONE;
 }
 
-ANKI_USE_RESULT Error VertexGpuMemoryPool::allocate(PtrSize size, PtrSize& offset)
+Error VertexGpuMemoryPool::allocate(PtrSize size, PtrSize& offset)
 {
 	U32 offset32;
 	const Bool success = m_buddyAllocator.allocate(size, 4, offset32);

+ 3 - 3
AnKi/Core/GpuMemoryPools.h

@@ -30,9 +30,9 @@ public:
 
 	VertexGpuMemoryPool& operator=(const VertexGpuMemoryPool&) = delete; // Non-copyable
 
-	ANKI_USE_RESULT Error init(GenericMemoryPoolAllocator<U8> alloc, GrManager* gr, const ConfigSet& cfg);
+	Error init(GenericMemoryPoolAllocator<U8> alloc, GrManager* gr, const ConfigSet& cfg);
 
-	ANKI_USE_RESULT Error allocate(PtrSize size, PtrSize& offset);
+	Error allocate(PtrSize size, PtrSize& offset);
 
 	void free(PtrSize size, PtrSize offset);
 
@@ -103,7 +103,7 @@ public:
 
 	StagingGpuMemoryPool& operator=(const StagingGpuMemoryPool&) = delete; // Non-copyable
 
-	ANKI_USE_RESULT Error init(GrManager* gr, const ConfigSet& cfg);
+	Error init(GrManager* gr, const ConfigSet& cfg);
 
 	void endFrame();
 

+ 1 - 1
AnKi/Core/NativeWindow.h

@@ -38,7 +38,7 @@ public:
 class NativeWindow
 {
 public:
-	static ANKI_USE_RESULT Error newInstance(const NativeWindowInitInfo& initInfo, NativeWindow*& nativeWindow);
+	static Error newInstance(const NativeWindowInitInfo& initInfo, NativeWindow*& nativeWindow);
 
 	static void deleteInstance(NativeWindow* nativeWindow);
 

+ 1 - 1
AnKi/Core/NativeWindowAndroid.h

@@ -18,7 +18,7 @@ public:
 
 	~NativeWindowAndroid();
 
-	ANKI_USE_RESULT Error init(const NativeWindowInitInfo& init);
+	Error init(const NativeWindowInitInfo& init);
 };
 
 } // end namespace anki

+ 1 - 1
AnKi/Core/NativeWindowSdl.h

@@ -18,7 +18,7 @@ public:
 
 	~NativeWindowSdl();
 
-	ANKI_USE_RESULT Error init(const NativeWindowInitInfo& init);
+	Error init(const NativeWindowInitInfo& init);
 
 private:
 	static constexpr U32 INIT_SUBSYSTEMS =

+ 1 - 1
AnKi/Core/StatsUi.h

@@ -26,7 +26,7 @@ public:
 
 	~StatsUi();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	void build(CanvasPtr ctx) override;
 

+ 1 - 1
AnKi/Core/StdinListener.h

@@ -26,7 +26,7 @@ public:
 
 	~StdinListener();
 
-	ANKI_USE_RESULT Error create(HeapAllocator<String>& alloc);
+	Error create(HeapAllocator<String>& alloc);
 
 	/// Get line from the queue or return an empty string
 	String getLine();

+ 2 - 2
AnKi/Gr/AccelerationStructure.h

@@ -137,8 +137,8 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT AccelerationStructure* newInstance(GrManager* manager,
-															  const AccelerationStructureInitInfo& init);
+	[[nodiscard]] static AccelerationStructure* newInstance(GrManager* manager,
+															const AccelerationStructureInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Buffer.h

@@ -125,7 +125,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT Buffer* newInstance(GrManager* manager, const BufferInitInfo& init);
+	[[nodiscard]] static Buffer* newInstance(GrManager* manager, const BufferInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/CommandBuffer.h

@@ -467,7 +467,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT CommandBuffer* newInstance(GrManager* manager, const CommandBufferInitInfo& init);
+	[[nodiscard]] static CommandBuffer* newInstance(GrManager* manager, const CommandBufferInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Fence.h

@@ -39,7 +39,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT Fence* newInstance(GrManager* manager);
+	[[nodiscard]] static Fence* newInstance(GrManager* manager);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Framebuffer.h

@@ -130,7 +130,7 @@ protected:
 	}
 
 private:
-	static ANKI_USE_RESULT Framebuffer* newInstance(GrManager* manager, const FramebufferInitInfo& init);
+	[[nodiscard]] static Framebuffer* newInstance(GrManager* manager, const FramebufferInitInfo& init);
 };
 /// @}
 

+ 13 - 13
AnKi/Gr/GrManager.h

@@ -50,7 +50,7 @@ class GrManager
 {
 public:
 	/// Create.
-	static ANKI_USE_RESULT Error newInstance(GrManagerInitInfo& init, GrManager*& gr);
+	static Error newInstance(GrManagerInitInfo& init, GrManager*& gr);
 
 	/// Destroy.
 	static void deleteInstance(GrManager* gr);
@@ -72,18 +72,18 @@ public:
 
 	/// @name Object creation methods. They are thread-safe.
 	/// @{
-	ANKI_USE_RESULT BufferPtr newBuffer(const BufferInitInfo& init);
-	ANKI_USE_RESULT TexturePtr newTexture(const TextureInitInfo& init);
-	ANKI_USE_RESULT TextureViewPtr newTextureView(const TextureViewInitInfo& init);
-	ANKI_USE_RESULT SamplerPtr newSampler(const SamplerInitInfo& init);
-	ANKI_USE_RESULT ShaderPtr newShader(const ShaderInitInfo& init);
-	ANKI_USE_RESULT ShaderProgramPtr newShaderProgram(const ShaderProgramInitInfo& init);
-	ANKI_USE_RESULT CommandBufferPtr newCommandBuffer(const CommandBufferInitInfo& init);
-	ANKI_USE_RESULT FramebufferPtr newFramebuffer(const FramebufferInitInfo& init);
-	ANKI_USE_RESULT OcclusionQueryPtr newOcclusionQuery();
-	ANKI_USE_RESULT TimestampQueryPtr newTimestampQuery();
-	ANKI_USE_RESULT RenderGraphPtr newRenderGraph();
-	ANKI_USE_RESULT AccelerationStructurePtr newAccelerationStructure(const AccelerationStructureInitInfo& init);
+	[[nodiscard]] BufferPtr newBuffer(const BufferInitInfo& init);
+	[[nodiscard]] TexturePtr newTexture(const TextureInitInfo& init);
+	[[nodiscard]] TextureViewPtr newTextureView(const TextureViewInitInfo& init);
+	[[nodiscard]] SamplerPtr newSampler(const SamplerInitInfo& init);
+	[[nodiscard]] ShaderPtr newShader(const ShaderInitInfo& init);
+	[[nodiscard]] ShaderProgramPtr newShaderProgram(const ShaderProgramInitInfo& init);
+	[[nodiscard]] CommandBufferPtr newCommandBuffer(const CommandBufferInitInfo& init);
+	[[nodiscard]] FramebufferPtr newFramebuffer(const FramebufferInitInfo& init);
+	[[nodiscard]] OcclusionQueryPtr newOcclusionQuery();
+	[[nodiscard]] TimestampQueryPtr newTimestampQuery();
+	[[nodiscard]] RenderGraphPtr newRenderGraph();
+	[[nodiscard]] AccelerationStructurePtr newAccelerationStructure(const AccelerationStructureInitInfo& init);
 	/// @}
 
 	GrManagerStats getStats() const;

+ 1 - 1
AnKi/Gr/OcclusionQuery.h

@@ -37,7 +37,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT OcclusionQuery* newInstance(GrManager* manager);
+	[[nodiscard]] static OcclusionQuery* newInstance(GrManager* manager);
 };
 /// @}
 

+ 2 - 4
AnKi/Gr/RenderGraph.cpp

@@ -1021,7 +1021,7 @@ void RenderGraph::setTextureBarrier(Batch& batch, const RenderPassDependency& de
 
 					crntUsage |= depUsage;
 
-					Bool found = false;
+					[[maybe_unused]] Bool found = false;
 					for(TextureBarrier& b : batch.m_textureBarriersBefore)
 					{
 						if(b.m_idx == rtIdx && b.m_surface == surf)
@@ -1032,7 +1032,6 @@ void RenderGraph::setTextureBarrier(Batch& batch, const RenderPassDependency& de
 						}
 					}
 
-					(void)found;
 					ANKI_ASSERT(found);
 				}
 				else
@@ -1439,8 +1438,7 @@ void RenderGraph::getStatistics(RenderGraphStatistics& statistics) const
 	if(m_statistics.m_timestamps[oldFrame * 2] && m_statistics.m_timestamps[oldFrame * 2 + 1])
 	{
 		Second start, end;
-		TimestampQueryResult res = m_statistics.m_timestamps[oldFrame * 2]->getResult(start);
-		(void)res;
+		[[maybe_unused]] TimestampQueryResult res = m_statistics.m_timestamps[oldFrame * 2]->getResult(start);
 		ANKI_ASSERT(res == TimestampQueryResult::AVAILABLE);
 
 		res = m_statistics.m_timestamps[oldFrame * 2 + 1]->getResult(end);

+ 2 - 3
AnKi/Gr/RenderGraph.h

@@ -705,7 +705,7 @@ private:
 
 	~RenderGraph();
 
-	static ANKI_USE_RESULT RenderGraph* newInstance(GrManager* manager);
+	[[nodiscard]] static RenderGraph* newInstance(GrManager* manager);
 
 	BakeContext* newContext(const RenderGraphDescription& descr, StackAllocator<U8>& alloc);
 	void initRenderPassesAndSetDeps(const RenderGraphDescription& descr, StackAllocator<U8>& alloc);
@@ -736,8 +736,7 @@ private:
 
 	/// @name Dump the dependency graph into a file.
 	/// @{
-	ANKI_USE_RESULT Error dumpDependencyDotFile(const RenderGraphDescription& descr, const BakeContext& ctx,
-												CString path) const;
+	Error dumpDependencyDotFile(const RenderGraphDescription& descr, const BakeContext& ctx, CString path) const;
 	static StringAuto textureUsageToStr(StackAllocator<U8>& alloc, TextureUsageBit usage);
 	static StringAuto bufferUsageToStr(StackAllocator<U8>& alloc, BufferUsageBit usage);
 	static StringAuto asUsageToStr(StackAllocator<U8>& alloc, AccelerationStructureUsageBit usage);

+ 5 - 10
AnKi/Gr/RenderGraph.inl.h

@@ -67,8 +67,7 @@ inline void RenderPassDescriptionBase::validateDep(const RenderPassDependency& d
 	// Validate dep
 	if(dep.m_type == RenderPassDependency::Type::TEXTURE)
 	{
-		const TextureUsageBit usage = dep.m_texture.m_usage;
-		(void)usage;
+		[[maybe_unused]] const TextureUsageBit usage = dep.m_texture.m_usage;
 		if(m_type == Type::GRAPHICS)
 		{
 			ANKI_ASSERT(!(usage & TextureUsageBit::ALL_COMPUTE));
@@ -82,8 +81,7 @@ inline void RenderPassDescriptionBase::validateDep(const RenderPassDependency& d
 	}
 	else if(dep.m_type == RenderPassDependency::Type::BUFFER)
 	{
-		const BufferUsageBit usage = dep.m_buffer.m_usage;
-		(void)usage;
+		[[maybe_unused]] const BufferUsageBit usage = dep.m_buffer.m_usage;
 		if(m_type == Type::GRAPHICS)
 		{
 			ANKI_ASSERT(!(usage & BufferUsageBit::ALL_COMPUTE));
@@ -254,9 +252,8 @@ inline ComputeRenderPassDescription& RenderGraphDescription::newComputeRenderPas
 
 inline RenderTargetHandle RenderGraphDescription::importRenderTarget(TexturePtr tex, TextureUsageBit usage)
 {
-	for(const RT& rt : m_renderTargets)
+	for([[maybe_unused]] const RT& rt : m_renderTargets)
 	{
-		(void)rt;
 		ANKI_ASSERT(rt.m_importedTex != tex && "Already imported");
 	}
 
@@ -307,9 +304,8 @@ inline BufferHandle RenderGraphDescription::importBuffer(BufferPtr buff, BufferU
 		ANKI_ASSERT((offset + range) <= buff->getSize());
 	}
 
-	for(const Buffer& bb : m_buffers)
+	for([[maybe_unused]] const Buffer& bb : m_buffers)
 	{
-		(void)bb;
 		ANKI_ASSERT((bb.m_importedBuff != buff || !bufferRangeOverlaps(bb.m_offset, bb.m_range, offset, range))
 					&& "Range already imported");
 	}
@@ -329,9 +325,8 @@ inline BufferHandle RenderGraphDescription::importBuffer(BufferPtr buff, BufferU
 inline AccelerationStructureHandle
 RenderGraphDescription::importAccelerationStructure(AccelerationStructurePtr as, AccelerationStructureUsageBit usage)
 {
-	for(const AS& a : m_as)
+	for([[maybe_unused]] const AS& a : m_as)
 	{
-		(void)a;
 		ANKI_ASSERT(a.m_importedAs != as && "Already imported");
 	}
 

+ 1 - 1
AnKi/Gr/Sampler.h

@@ -67,7 +67,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT Sampler* newInstance(GrManager* manager, const SamplerInitInfo& init);
+	[[nodiscard]] static Sampler* newInstance(GrManager* manager, const SamplerInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Shader.h

@@ -114,7 +114,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT Shader* newInstance(GrManager* manager, const ShaderInitInfo& init);
+	[[nodiscard]] static Shader* newInstance(GrManager* manager, const ShaderInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/ShaderProgram.h

@@ -85,7 +85,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT ShaderProgram* newInstance(GrManager* manager, const ShaderProgramInitInfo& init);
+	[[nodiscard]] static ShaderProgram* newInstance(GrManager* manager, const ShaderProgramInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Texture.h

@@ -266,7 +266,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT Texture* newInstance(GrManager* manager, const TextureInitInfo& init);
+	[[nodiscard]] static Texture* newInstance(GrManager* manager, const TextureInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/TextureView.h

@@ -131,7 +131,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT TextureView* newInstance(GrManager* manager, const TextureViewInitInfo& init);
+	[[nodiscard]] static TextureView* newInstance(GrManager* manager, const TextureViewInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/TimestampQuery.h

@@ -37,7 +37,7 @@ protected:
 
 private:
 	/// Allocate and initialize a new instance.
-	static ANKI_USE_RESULT TimestampQuery* newInstance(GrManager* manager);
+	[[nodiscard]] static TimestampQuery* newInstance(GrManager* manager);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Utils/FrameGpuAllocator.h

@@ -37,7 +37,7 @@ public:
 	void init(PtrSize size, U32 alignment, PtrSize maxAllocationSize = MAX_PTR_SIZE);
 
 	/// Allocate memory for a dynamic buffer.
-	ANKI_USE_RESULT Error allocate(PtrSize size, PtrSize& outOffset);
+	Error allocate(PtrSize size, PtrSize& outOffset);
 
 	/// Call this at the end of the frame.
 	/// @return The bytes that were not used. Used for statistics.

+ 4 - 2
AnKi/Gr/Utils/Functions.cpp

@@ -8,8 +8,10 @@
 namespace anki {
 
 template<typename T>
-static void writeShaderBlockMemorySanityChecks(const ShaderVariableBlockInfo& varBlkInfo, const void* elements,
-											   U32 elementsCount, void* buffBegin, const void* buffEnd)
+static void writeShaderBlockMemorySanityChecks(const ShaderVariableBlockInfo& varBlkInfo,
+											   [[maybe_unused]] const void* elements,
+											   [[maybe_unused]] U32 elementsCount, [[maybe_unused]] void* buffBegin,
+											   [[maybe_unused]] const void* buffEnd)
 {
 	// Check args
 	ANKI_ASSERT(elements != nullptr);

+ 1 - 1
AnKi/Gr/Vulkan/AccelerationStructureImpl.h

@@ -27,7 +27,7 @@ public:
 
 	~AccelerationStructureImpl();
 
-	ANKI_USE_RESULT Error init(const AccelerationStructureInitInfo& inf);
+	Error init(const AccelerationStructureInitInfo& inf);
 
 	VkAccelerationStructureKHR getHandle() const
 	{

+ 3 - 4
AnKi/Gr/Vulkan/BufferImpl.cpp

@@ -193,7 +193,7 @@ Error BufferImpl::init(const BufferInitInfo& inf)
 
 	// Allocate
 	const U32 alignment = U32(max(m_mappedMemoryRangeAlignment, req.alignment));
-	getGrManagerImpl().getGpuMemoryManager().allocateMemory(memIdx, req.size, alignment, true, m_memHandle);
+	getGrManagerImpl().getGpuMemoryManager().allocateMemory(memIdx, req.size, alignment, m_memHandle);
 
 	// Bind mem to buffer
 	{
@@ -223,7 +223,7 @@ Error BufferImpl::init(const BufferInitInfo& inf)
 	return Error::NONE;
 }
 
-void* BufferImpl::map(PtrSize offset, PtrSize range, BufferMapAccessBit access)
+void* BufferImpl::map(PtrSize offset, PtrSize range, [[maybe_unused]] BufferMapAccessBit access)
 {
 	ANKI_ASSERT(isCreated());
 	ANKI_ASSERT(access != BufferMapAccessBit::NONE);
@@ -396,8 +396,7 @@ VkBufferView BufferImpl::getOrCreateBufferView(Format fmt, PtrSize offset, PtrSi
 	ANKI_ASSERT((range % getFormatInfo(fmt).m_texelSize) == 0
 				&& "Range doesn't align with the number of texel elements");
 
-	const PtrSize elementCount = range / getFormatInfo(fmt).m_texelSize;
-	(void)elementCount;
+	[[maybe_unused]] const PtrSize elementCount = range / getFormatInfo(fmt).m_texelSize;
 	ANKI_ASSERT(elementCount <= getGrManagerImpl().getPhysicalDeviceProperties().limits.maxTexelBufferElements);
 
 	// Hash

+ 2 - 2
AnKi/Gr/Vulkan/BufferImpl.h

@@ -28,9 +28,9 @@ public:
 
 	~BufferImpl();
 
-	ANKI_USE_RESULT Error init(const BufferInitInfo& inf);
+	Error init(const BufferInitInfo& inf);
 
-	ANKI_USE_RESULT void* map(PtrSize offset, PtrSize range, BufferMapAccessBit access);
+	[[nodiscard]] void* map(PtrSize offset, PtrSize range, BufferMapAccessBit access);
 
 	void unmap()
 	{

+ 3 - 2
AnKi/Gr/Vulkan/CommandBuffer.cpp

@@ -312,12 +312,13 @@ void CommandBuffer::generateMipmaps2d(const TextureViewPtr& texView)
 	self.generateMipmaps2dInternal(texView);
 }
 
-void CommandBuffer::generateMipmaps3d(const TextureViewPtr& texView)
+void CommandBuffer::generateMipmaps3d([[maybe_unused]] const TextureViewPtr& texView)
 {
 	ANKI_ASSERT(!"TODO");
 }
 
-void CommandBuffer::blitTextureViews(const TextureViewPtr& srcView, const TextureViewPtr& destView)
+void CommandBuffer::blitTextureViews([[maybe_unused]] const TextureViewPtr& srcView,
+									 [[maybe_unused]] const TextureViewPtr& destView)
 {
 	ANKI_ASSERT(!"TODO");
 }

+ 2 - 4
AnKi/Gr/Vulkan/CommandBufferFactory.cpp

@@ -32,9 +32,8 @@ MicroCommandBuffer::~MicroCommandBuffer()
 		vkFreeCommandBuffers(m_threadAlloc->m_factory->m_dev, m_threadAlloc->m_pools[m_queue], 1, &m_handle);
 		m_handle = {};
 
-		const U32 count = m_threadAlloc->m_factory->m_createdCmdBufferCount.fetchSub(1);
+		[[maybe_unused]] const U32 count = m_threadAlloc->m_factory->m_createdCmdBufferCount.fetchSub(1);
 		ANKI_ASSERT(count > 0);
-		(void)count;
 	}
 }
 
@@ -151,9 +150,8 @@ Error CommandBufferThreadAllocator::newCommandBuffer(CommandBufferFlag cmdbFlags
 	}
 	else
 	{
-		for(GrObjectType type : EnumIterable<GrObjectType>())
+		for([[maybe_unused]] GrObjectType type : EnumIterable<GrObjectType>())
 		{
-			(void)type;
 			ANKI_ASSERT(out->m_objectRefs[type].getSize() == 0);
 		}
 	}

+ 4 - 4
AnKi/Gr/Vulkan/CommandBufferFactory.h

@@ -169,14 +169,14 @@ public:
 	{
 	}
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	void destroy();
 
 	GrAllocator<U8>& getAllocator();
 
 	/// Request a new command buffer.
-	ANKI_USE_RESULT Error newCommandBuffer(CommandBufferFlag cmdbFlags, MicroCommandBufferPtr& ptr);
+	Error newCommandBuffer(CommandBufferFlag cmdbFlags, MicroCommandBufferPtr& ptr);
 
 	/// It will recycle it.
 	void deleteCommandBuffer(MicroCommandBuffer* ptr);
@@ -208,12 +208,12 @@ public:
 
 	CommandBufferFactory& operator=(const CommandBufferFactory&) = delete; // Non-copyable
 
-	ANKI_USE_RESULT Error init(GrAllocator<U8> alloc, VkDevice dev, const VulkanQueueFamilies& queueFamilies);
+	Error init(GrAllocator<U8> alloc, VkDevice dev, const VulkanQueueFamilies& queueFamilies);
 
 	void destroy();
 
 	/// Request a new command buffer.
-	ANKI_USE_RESULT Error newCommandBuffer(ThreadId tid, CommandBufferFlag cmdbFlags, MicroCommandBufferPtr& ptr);
+	Error newCommandBuffer(ThreadId tid, CommandBufferFlag cmdbFlags, MicroCommandBufferPtr& ptr);
 
 	/// Stats.
 	U32 getCreatedCommandBufferCount() const

+ 2 - 2
AnKi/Gr/Vulkan/CommandBufferImpl.cpp

@@ -650,8 +650,8 @@ void CommandBufferImpl::flushWriteQueryResults()
 	m_writeQueryAtoms.resize(m_alloc, 0);
 }
 
-void CommandBufferImpl::copyBufferToTextureViewInternal(const BufferPtr& buff, PtrSize offset, PtrSize range,
-														const TextureViewPtr& texView)
+void CommandBufferImpl::copyBufferToTextureViewInternal(const BufferPtr& buff, PtrSize offset,
+														[[maybe_unused]] PtrSize range, const TextureViewPtr& texView)
 {
 	commandCommon();
 

+ 1 - 1
AnKi/Gr/Vulkan/CommandBufferImpl.h

@@ -58,7 +58,7 @@ public:
 
 	~CommandBufferImpl();
 
-	ANKI_USE_RESULT Error init(const CommandBufferInitInfo& init);
+	Error init(const CommandBufferInitInfo& init);
 
 	void setFence(MicroFencePtr& fence)
 	{

+ 13 - 11
AnKi/Gr/Vulkan/CommandBufferImpl.inl.h

@@ -256,9 +256,10 @@ inline void CommandBufferImpl::setBufferBarrierInternal(const BufferPtr& buff, B
 	m_microCmdb->pushObjectRef(buff);
 }
 
-inline void CommandBufferImpl::setAccelerationStructureBarrierInternal(const AccelerationStructurePtr& as,
-																	   AccelerationStructureUsageBit prevUsage,
-																	   AccelerationStructureUsageBit nextUsage)
+inline void
+CommandBufferImpl::setAccelerationStructureBarrierInternal([[maybe_unused]] const AccelerationStructurePtr& as,
+														   AccelerationStructureUsageBit prevUsage,
+														   AccelerationStructureUsageBit nextUsage)
 {
 	commandCommon();
 
@@ -288,6 +289,8 @@ inline void CommandBufferImpl::setAccelerationStructureBarrierInternal(const Acc
 #else
 	ANKI_ASSERT(!"TODO");
 #endif
+
+	// No need to hold reference since noone touches the AS
 }
 
 inline void CommandBufferImpl::drawArraysInternal(PrimitiveTopology topology, U32 count, U32 instanceCount, U32 first,
@@ -355,8 +358,8 @@ inline void CommandBufferImpl::dispatchComputeInternal(U32 groupCountX, U32 grou
 			Bool dirty;
 			Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET> dynamicOffsetsPtrSize;
 			U32 dynamicOffsetCount;
-			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(
-				   m_tid, m_alloc, m_dsetState[i], dset, dirty, dynamicOffsetsPtrSize, dynamicOffsetCount))
+			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(m_alloc, m_dsetState[i], dset, dirty,
+																			 dynamicOffsetsPtrSize, dynamicOffsetCount))
 			{
 				ANKI_VK_LOGF("Cannot recover");
 			}
@@ -400,8 +403,7 @@ inline void CommandBufferImpl::traceRaysInternal(const BufferPtr& sbtBuffer, Ptr
 	ANKI_ASSERT(rayTypeCount == sprog.getMissShaderCount() && "All the miss shaders should be in use");
 	ANKI_ASSERT((hitGroupSbtRecordCount % rayTypeCount) == 0);
 	const PtrSize sbtRecordCount = 1 + rayTypeCount + hitGroupSbtRecordCount;
-	const PtrSize sbtBufferSize = sbtRecordCount * sbtRecordSize;
-	(void)sbtBufferSize;
+	[[maybe_unused]] const PtrSize sbtBufferSize = sbtRecordCount * sbtRecordSize;
 	ANKI_ASSERT(sbtBufferSize + sbtBufferOffset <= sbtBuffer->getSize());
 	ANKI_ASSERT(isAligned(getGrManagerImpl().getDeviceCapabilities().m_sbtRecordAlignment, sbtBufferOffset));
 
@@ -420,8 +422,8 @@ inline void CommandBufferImpl::traceRaysInternal(const BufferPtr& sbtBuffer, Ptr
 			Bool dirty;
 			Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET> dynamicOffsetsPtrSize;
 			U32 dynamicOffsetCount;
-			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(
-				   m_tid, m_alloc, m_dsetState[i], dset, dirty, dynamicOffsetsPtrSize, dynamicOffsetCount))
+			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(m_alloc, m_dsetState[i], dset, dirty,
+																			 dynamicOffsetsPtrSize, dynamicOffsetCount))
 			{
 				ANKI_VK_LOGF("Cannot recover");
 			}
@@ -652,8 +654,8 @@ inline void CommandBufferImpl::drawcallCommon()
 			Bool dirty;
 			Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET> dynamicOffsetsPtrSize;
 			U32 dynamicOffsetCount;
-			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(
-				   m_tid, m_alloc, m_dsetState[i], dset, dirty, dynamicOffsetsPtrSize, dynamicOffsetCount))
+			if(getGrManagerImpl().getDescriptorSetFactory().newDescriptorSet(m_alloc, m_dsetState[i], dset, dirty,
+																			 dynamicOffsetsPtrSize, dynamicOffsetCount))
 			{
 				ANKI_VK_LOGF("Cannot recover");
 			}

+ 25 - 25
AnKi/Gr/Vulkan/Common.h

@@ -149,10 +149,10 @@ static_assert(!(BufferUsageBit::ALL & PrivateBufferUsageBit::ALL_PRIVATE), "Upda
 	} while(0)
 
 /// Convert compare op.
-ANKI_USE_RESULT VkCompareOp convertCompareOp(CompareOperation ak);
+[[nodiscard]] VkCompareOp convertCompareOp(CompareOperation ak);
 
 /// Convert format.
-ANKI_USE_RESULT inline VkFormat convertFormat(const Format ak)
+[[nodiscard]] inline VkFormat convertFormat(const Format ak)
 {
 	ANKI_ASSERT(ak != Format::NONE);
 	const VkFormat out = static_cast<VkFormat>(ak);
@@ -160,7 +160,7 @@ ANKI_USE_RESULT inline VkFormat convertFormat(const Format ak)
 }
 
 /// Get format aspect mask.
-ANKI_USE_RESULT inline DepthStencilAspectBit getImageAspectFromFormat(const Format ak)
+[[nodiscard]] inline DepthStencilAspectBit getImageAspectFromFormat(const Format ak)
 {
 	DepthStencilAspectBit out = DepthStencilAspectBit::NONE;
 	if(getFormatInfo(ak).isStencil())
@@ -177,7 +177,7 @@ ANKI_USE_RESULT inline DepthStencilAspectBit getImageAspectFromFormat(const Form
 }
 
 /// Convert image aspect.
-ANKI_USE_RESULT inline VkImageAspectFlags convertImageAspect(const DepthStencilAspectBit ak)
+[[nodiscard]] inline VkImageAspectFlags convertImageAspect(const DepthStencilAspectBit ak)
 {
 	VkImageAspectFlags out = 0;
 	if(!!(ak & DepthStencilAspectBit::DEPTH))
@@ -199,46 +199,46 @@ ANKI_USE_RESULT inline VkImageAspectFlags convertImageAspect(const DepthStencilA
 }
 
 /// Convert topology.
-ANKI_USE_RESULT VkPrimitiveTopology convertTopology(PrimitiveTopology ak);
+[[nodiscard]] VkPrimitiveTopology convertTopology(PrimitiveTopology ak);
 
 /// Convert fill mode.
-ANKI_USE_RESULT VkPolygonMode convertFillMode(FillMode ak);
+[[nodiscard]] VkPolygonMode convertFillMode(FillMode ak);
 
 /// Convert cull mode.
-ANKI_USE_RESULT VkCullModeFlags convertCullMode(FaceSelectionBit ak);
+[[nodiscard]] VkCullModeFlags convertCullMode(FaceSelectionBit ak);
 
 /// Convert blend method.
-ANKI_USE_RESULT VkBlendFactor convertBlendFactor(BlendFactor ak);
+[[nodiscard]] VkBlendFactor convertBlendFactor(BlendFactor ak);
 
 /// Convert blend function.
-ANKI_USE_RESULT VkBlendOp convertBlendOperation(BlendOperation ak);
+[[nodiscard]] VkBlendOp convertBlendOperation(BlendOperation ak);
 
 /// Convert color write mask.
-inline ANKI_USE_RESULT VkColorComponentFlags convertColorWriteMask(ColorBit ak)
+[[nodiscard]] inline VkColorComponentFlags convertColorWriteMask(ColorBit ak)
 {
 	return static_cast<VkColorComponentFlags>(ak);
 }
 
 /// Convert load op.
-ANKI_USE_RESULT VkAttachmentLoadOp convertLoadOp(AttachmentLoadOperation ak);
+[[nodiscard]] VkAttachmentLoadOp convertLoadOp(AttachmentLoadOperation ak);
 
 /// Convert store op.
-ANKI_USE_RESULT VkAttachmentStoreOp convertStoreOp(AttachmentStoreOperation ak);
+[[nodiscard]] VkAttachmentStoreOp convertStoreOp(AttachmentStoreOperation ak);
 
 /// Convert buffer usage bitmask.
-ANKI_USE_RESULT VkBufferUsageFlags convertBufferUsageBit(BufferUsageBit usageMask);
+[[nodiscard]] VkBufferUsageFlags convertBufferUsageBit(BufferUsageBit usageMask);
 
-ANKI_USE_RESULT VkImageType convertTextureType(TextureType ak);
+[[nodiscard]] VkImageType convertTextureType(TextureType ak);
 
-ANKI_USE_RESULT VkImageViewType convertTextureViewType(TextureType ak);
+[[nodiscard]] VkImageViewType convertTextureViewType(TextureType ak);
 
-ANKI_USE_RESULT VkImageUsageFlags convertTextureUsage(const TextureUsageBit ak, const Format format);
+[[nodiscard]] VkImageUsageFlags convertTextureUsage(const TextureUsageBit ak, const Format format);
 
-ANKI_USE_RESULT VkStencilOp convertStencilOp(StencilOperation ak);
+[[nodiscard]] VkStencilOp convertStencilOp(StencilOperation ak);
 
-ANKI_USE_RESULT VkShaderStageFlags convertShaderTypeBit(ShaderTypeBit bit);
+[[nodiscard]] VkShaderStageFlags convertShaderTypeBit(ShaderTypeBit bit);
 
-ANKI_USE_RESULT inline VkVertexInputRate convertVertexStepRate(VertexStepRate ak)
+[[nodiscard]] inline VkVertexInputRate convertVertexStepRate(VertexStepRate ak)
 {
 	VkVertexInputRate out;
 	switch(ak)
@@ -256,7 +256,7 @@ ANKI_USE_RESULT inline VkVertexInputRate convertVertexStepRate(VertexStepRate ak
 	return out;
 }
 
-ANKI_USE_RESULT inline VkDescriptorType convertDescriptorType(DescriptorType ak)
+[[nodiscard]] inline VkDescriptorType convertDescriptorType(DescriptorType ak)
 {
 	VkDescriptorType out;
 	switch(ak)
@@ -296,7 +296,7 @@ ANKI_USE_RESULT inline VkDescriptorType convertDescriptorType(DescriptorType ak)
 	return out;
 }
 
-ANKI_USE_RESULT inline VkIndexType convertIndexType(IndexType ak)
+[[nodiscard]] inline VkIndexType convertIndexType(IndexType ak)
 {
 	VkIndexType out;
 	switch(ak)
@@ -315,7 +315,7 @@ ANKI_USE_RESULT inline VkIndexType convertIndexType(IndexType ak)
 	return out;
 }
 
-ANKI_USE_RESULT inline VkRasterizationOrderAMD convertRasterizationOrder(RasterizationOrder ak)
+[[nodiscard]] inline VkRasterizationOrderAMD convertRasterizationOrder(RasterizationOrder ak)
 {
 	VkRasterizationOrderAMD out;
 	switch(ak)
@@ -334,7 +334,7 @@ ANKI_USE_RESULT inline VkRasterizationOrderAMD convertRasterizationOrder(Rasteri
 	return out;
 }
 
-ANKI_USE_RESULT inline VkAccelerationStructureTypeKHR convertAccelerationStructureType(AccelerationStructureType ak)
+[[nodiscard]] inline VkAccelerationStructureTypeKHR convertAccelerationStructureType(AccelerationStructureType ak)
 {
 	VkAccelerationStructureTypeKHR out;
 	switch(ak)
@@ -353,9 +353,9 @@ ANKI_USE_RESULT inline VkAccelerationStructureTypeKHR convertAccelerationStructu
 	return out;
 }
 
-ANKI_USE_RESULT const char* vkResultToString(VkResult res);
+[[nodiscard]] const char* vkResultToString(VkResult res);
 
-ANKI_USE_RESULT inline VkExtent2D convertVrsShadingRate(VrsRate rate)
+[[nodiscard]] inline VkExtent2D convertVrsShadingRate(VrsRate rate)
 {
 	VkExtent2D out = {};
 	switch(rate)

+ 11 - 13
AnKi/Gr/Vulkan/DescriptorSet.cpp

@@ -99,12 +99,11 @@ public:
 
 	~DSAllocator();
 
-	ANKI_USE_RESULT Error init();
-	ANKI_USE_RESULT Error createNewPool();
+	Error init();
+	Error createNewPool();
 
-	ANKI_USE_RESULT Error getOrCreateSet(U64 hash,
-										 const Array<AnyBindingExtended, MAX_BINDINGS_PER_DESCRIPTOR_SET>& bindings,
-										 StackAllocator<U8>& tmpAlloc, const DS*& out)
+	Error getOrCreateSet(U64 hash, const Array<AnyBindingExtended, MAX_BINDINGS_PER_DESCRIPTOR_SET>& bindings,
+						 StackAllocator<U8>& tmpAlloc, const DS*& out)
 	{
 		out = tryFindSet(hash);
 		if(out == nullptr)
@@ -125,9 +124,9 @@ private:
 	IntrusiveList<DS> m_list; ///< At the left of the list are the least used sets.
 	HashMap<U64, DS*> m_hashmap;
 
-	ANKI_USE_RESULT const DS* tryFindSet(U64 hash);
-	ANKI_USE_RESULT Error newSet(U64 hash, const Array<AnyBindingExtended, MAX_BINDINGS_PER_DESCRIPTOR_SET>& bindings,
-								 StackAllocator<U8>& tmpAlloc, const DS*& out);
+	[[nodiscard]] const DS* tryFindSet(U64 hash);
+	Error newSet(U64 hash, const Array<AnyBindingExtended, MAX_BINDINGS_PER_DESCRIPTOR_SET>& bindings,
+				 StackAllocator<U8>& tmpAlloc, const DS*& out);
 	void writeSet(const Array<AnyBindingExtended, MAX_BINDINGS_PER_DESCRIPTOR_SET>& bindings, const DS& set,
 				  StackAllocator<U8>& tmpAlloc);
 };
@@ -165,10 +164,10 @@ public:
 
 	~DSLayoutCacheEntry();
 
-	ANKI_USE_RESULT Error init(const DescriptorBinding* bindings, U32 bindingCount, U64 hash);
+	Error init(const DescriptorBinding* bindings, U32 bindingCount, U64 hash);
 
 	/// @note Thread-safe.
-	ANKI_USE_RESULT Error getOrCreateDSAllocator(DescriptorSetFactory::DSAllocator*& alloc);
+	Error getOrCreateDSAllocator(DescriptorSetFactory::DSAllocator*& alloc);
 };
 
 DescriptorSetFactory::BindlessDescriptorSet::~BindlessDescriptorSet()
@@ -501,8 +500,7 @@ Error DescriptorSetFactory::DSAllocator::newSet(
 		ci.descriptorSetCount = 1;
 
 		VkDescriptorSet handle;
-		VkResult rez = vkAllocateDescriptorSets(m_layoutEntry->m_factory->m_dev, &ci, &handle);
-		(void)rez;
+		[[maybe_unused]] VkResult rez = vkAllocateDescriptorSets(m_layoutEntry->m_factory->m_dev, &ci, &handle);
 		ANKI_ASSERT(rez == VK_SUCCESS && "That allocation can't fail");
 		ANKI_TRACE_INC_COUNTER(VK_DESCRIPTOR_SET_CREATE, 1);
 
@@ -1066,7 +1064,7 @@ Error DescriptorSetFactory::newDescriptorSetLayout(const DescriptorSetLayoutInit
 	return Error::NONE;
 }
 
-Error DescriptorSetFactory::newDescriptorSet(ThreadId tid, StackAllocator<U8>& tmpAlloc, DescriptorSetState& state,
+Error DescriptorSetFactory::newDescriptorSet(StackAllocator<U8>& tmpAlloc, DescriptorSetState& state,
 											 DescriptorSet& set, Bool& dirty,
 											 Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET>& dynamicOffsets,
 											 U32& dynamicOffsetCount)

+ 4 - 7
AnKi/Gr/Vulkan/DescriptorSet.h

@@ -409,19 +409,16 @@ public:
 	DescriptorSetFactory() = default;
 	~DescriptorSetFactory();
 
-	ANKI_USE_RESULT Error init(const GrAllocator<U8>& alloc, VkDevice dev, U32 bindlessTextureCount,
-							   U32 bindlessImageCount);
+	Error init(const GrAllocator<U8>& alloc, VkDevice dev, U32 bindlessTextureCount, U32 bindlessImageCount);
 
 	void destroy();
 
 	/// @note It's thread-safe.
-	ANKI_USE_RESULT Error newDescriptorSetLayout(const DescriptorSetLayoutInitInfo& init, DescriptorSetLayout& layout);
+	Error newDescriptorSetLayout(const DescriptorSetLayoutInitInfo& init, DescriptorSetLayout& layout);
 
 	/// @note It's thread-safe.
-	ANKI_USE_RESULT Error newDescriptorSet(ThreadId tid, StackAllocator<U8>& tmpAlloc, DescriptorSetState& state,
-										   DescriptorSet& set, Bool& dirty,
-										   Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET>& dynamicOffsets,
-										   U32& dynamicOffsetCount);
+	Error newDescriptorSet(StackAllocator<U8>& tmpAlloc, DescriptorSetState& state, DescriptorSet& set, Bool& dirty,
+						   Array<PtrSize, MAX_BINDINGS_PER_DESCRIPTOR_SET>& dynamicOffsets, U32& dynamicOffsetCount);
 
 	void endFrame()
 	{

+ 2 - 2
AnKi/Gr/Vulkan/FramebufferImpl.h

@@ -30,7 +30,7 @@ public:
 
 	~FramebufferImpl();
 
-	ANKI_USE_RESULT Error init(const FramebufferInitInfo& init);
+	Error init(const FramebufferInitInfo& init);
 
 	/// Good for pipeline creation.
 	VkRenderPass getCompatibleRenderPass() const
@@ -144,7 +144,7 @@ private:
 	VkFragmentShadingRateAttachmentInfoKHR m_sriAttachmentInfo = {};
 
 	// Methods
-	ANKI_USE_RESULT Error initFbs(const FramebufferInitInfo& init);
+	Error initFbs(const FramebufferInitInfo& init);
 	void initRpassCreateInfo(const FramebufferInitInfo& init);
 	void initClearValues(const FramebufferInitInfo& init);
 	void setupAttachmentDescriptor(const FramebufferAttachmentInfo& att, VkAttachmentDescription2& desc,

+ 4 - 8
AnKi/Gr/Vulkan/GpuMemoryManager.cpp

@@ -161,8 +161,7 @@ void GpuMemoryManager::init(VkPhysicalDevice pdev, VkDevice dev, GrAllocator<U8>
 	}
 }
 
-void GpuMemoryManager::allocateMemory(U32 memTypeIdx, PtrSize size, U32 alignment, Bool linearResource,
-									  GpuMemoryHandle& handle)
+void GpuMemoryManager::allocateMemory(U32 memTypeIdx, PtrSize size, U32 alignment, GpuMemoryHandle& handle)
 {
 	ClassAllocator& calloc = m_callocs[memTypeIdx];
 
@@ -170,8 +169,7 @@ void GpuMemoryManager::allocateMemory(U32 memTypeIdx, PtrSize size, U32 alignmen
 
 	GpuMemoryManagerChunk* chunk;
 	PtrSize offset;
-	const Error err = calloc.allocate(size, alignment, chunk, offset);
-	(void)err;
+	[[maybe_unused]] const Error err = calloc.allocate(size, alignment, chunk, offset);
 
 	handle.m_memory = chunk->m_handle;
 	handle.m_offset = offset;
@@ -212,13 +210,11 @@ void GpuMemoryManager::freeMemory(GpuMemoryHandle& handle)
 	if(handle.isDedicated())
 	{
 		vkFreeMemory(m_dev, handle.m_memory, nullptr);
-		const PtrSize prevSize = m_dedicatedAllocatedMemory.fetchSub(handle.m_size);
+		[[maybe_unused]] const PtrSize prevSize = m_dedicatedAllocatedMemory.fetchSub(handle.m_size);
 		ANKI_ASSERT(prevSize >= handle.m_size);
-		(void)prevSize;
 
-		const U32 count = m_dedicatedAllocationCount.fetchSub(1);
+		[[maybe_unused]] const U32 count = m_dedicatedAllocationCount.fetchSub(1);
 		ANKI_ASSERT(count > 0);
-		(void)count;
 	}
 	else
 	{

+ 2 - 2
AnKi/Gr/Vulkan/GpuMemoryManager.h

@@ -135,7 +135,7 @@ public:
 	void destroy();
 
 	/// Allocate memory.
-	void allocateMemory(U32 memTypeIdx, PtrSize size, U32 alignment, Bool linearResource, GpuMemoryHandle& handle);
+	void allocateMemory(U32 memTypeIdx, PtrSize size, U32 alignment, GpuMemoryHandle& handle);
 
 	void allocateMemoryDedicated(U32 memTypeIdx, PtrSize size, VkImage image, GpuMemoryHandle& handle);
 
@@ -143,7 +143,7 @@ public:
 	void freeMemory(GpuMemoryHandle& handle);
 
 	/// Map memory.
-	ANKI_USE_RESULT void* getMappedAddress(GpuMemoryHandle& handle);
+	[[nodiscard]] void* getMappedAddress(GpuMemoryHandle& handle);
 
 	/// Find a suitable memory type.
 	U32 findMemoryType(U32 resourceMemTypeBits, VkMemoryPropertyFlags preferFlags,

+ 3 - 3
AnKi/Gr/Vulkan/GrManagerImpl.cpp

@@ -119,7 +119,7 @@ Error GrManagerImpl::initInternal(const GrManagerInitInfo& init)
 	m_config = init.m_config;
 	ANKI_ASSERT(m_config);
 
-	ANKI_CHECK(initInstance(init));
+	ANKI_CHECK(initInstance());
 	ANKI_CHECK(initSurface(init));
 	ANKI_CHECK(initDevice(init));
 
@@ -200,7 +200,7 @@ Error GrManagerImpl::initInternal(const GrManagerInitInfo& init)
 	return Error::NONE;
 }
 
-Error GrManagerImpl::initInstance(const GrManagerInitInfo& init)
+Error GrManagerImpl::initInstance()
 {
 	// Init VOLK
 	//
@@ -1435,7 +1435,7 @@ void GrManagerImpl::trySetVulkanHandleName(CString name, VkObjectType type, U64
 }
 
 VkBool32 GrManagerImpl::debugReportCallbackEXT(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
-											   VkDebugUtilsMessageTypeFlagsEXT messageTypes,
+											   [[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT messageTypes,
 											   const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
 											   void* pUserData)
 {

+ 7 - 8
AnKi/Gr/Vulkan/GrManagerImpl.h

@@ -45,7 +45,7 @@ public:
 
 	~GrManagerImpl();
 
-	ANKI_USE_RESULT Error init(const GrManagerInitInfo& cfg);
+	Error init(const GrManagerInitInfo& cfg);
 
 	ConstWeakArray<U32> getQueueFamilies() const
 	{
@@ -325,11 +325,11 @@ private:
 	Mutex* m_globalCreatePipelineMtx = nullptr;
 #endif
 
-	ANKI_USE_RESULT Error initInternal(const GrManagerInitInfo& init);
-	ANKI_USE_RESULT Error initInstance(const GrManagerInitInfo& init);
-	ANKI_USE_RESULT Error initSurface(const GrManagerInitInfo& init);
-	ANKI_USE_RESULT Error initDevice(const GrManagerInitInfo& init);
-	ANKI_USE_RESULT Error initMemory();
+	Error initInternal(const GrManagerInitInfo& init);
+	Error initInstance();
+	Error initSurface(const GrManagerInitInfo& init);
+	Error initDevice(const GrManagerInitInfo& init);
+	Error initMemory();
 
 #if ANKI_GR_MANAGER_DEBUG_MEMMORY
 	static void* allocateCallback(void* userData, size_t size, size_t alignment,
@@ -347,8 +347,7 @@ private:
 										   VkDebugUtilsMessageTypeFlagsEXT messageTypes,
 										   const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData);
 
-	ANKI_USE_RESULT Error printPipelineShaderInfoInternal(VkPipeline ppline, CString name, ShaderTypeBit stages,
-														  U64 hash) const;
+	Error printPipelineShaderInfoInternal(VkPipeline ppline, CString name, ShaderTypeBit stages, U64 hash) const;
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Vulkan/OcclusionQueryImpl.h

@@ -28,7 +28,7 @@ public:
 	~OcclusionQueryImpl();
 
 	/// Create the query.
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Get query result.
 	OcclusionQueryResult getResultInternal() const;

+ 2 - 3
AnKi/Gr/Vulkan/PipelineCache.h

@@ -21,8 +21,7 @@ class PipelineCache
 public:
 	VkPipelineCache m_cacheHandle = VK_NULL_HANDLE;
 
-	ANKI_USE_RESULT Error init(VkDevice dev, VkPhysicalDevice pdev, CString cacheDir, const ConfigSet& cfg,
-							   GrAllocator<U8> alloc);
+	Error init(VkDevice dev, VkPhysicalDevice pdev, CString cacheDir, const ConfigSet& cfg, GrAllocator<U8> alloc);
 
 	void destroy(VkDevice dev, VkPhysicalDevice pdev, GrAllocator<U8> alloc);
 
@@ -30,7 +29,7 @@ private:
 	String m_dumpFilename;
 	PtrSize m_dumpSize = 0;
 
-	ANKI_USE_RESULT Error destroyInternal(VkDevice dev, VkPhysicalDevice pdev, GrAllocator<U8> alloc);
+	Error destroyInternal(VkDevice dev, VkPhysicalDevice pdev, GrAllocator<U8> alloc);
 };
 /// @}
 

+ 2 - 2
AnKi/Gr/Vulkan/PipelineLayout.h

@@ -44,8 +44,8 @@ public:
 	void destroy();
 
 	/// @note It's thread-safe.
-	ANKI_USE_RESULT Error newPipelineLayout(const WeakArray<DescriptorSetLayout>& dsetLayouts, U32 pushConstantsSize,
-											PipelineLayout& layout);
+	Error newPipelineLayout(const WeakArray<DescriptorSetLayout>& dsetLayouts, U32 pushConstantsSize,
+							PipelineLayout& layout);
 
 private:
 	GrAllocator<U8> m_alloc;

+ 1 - 1
AnKi/Gr/Vulkan/QueryFactory.h

@@ -82,7 +82,7 @@ public:
 	}
 
 	/// @note It's thread-safe.
-	ANKI_USE_RESULT Error newQuery(MicroQuery& handle);
+	Error newQuery(MicroQuery& handle);
 
 	/// @note It's thread-safe.
 	void deleteQuery(MicroQuery& handle);

+ 3 - 3
AnKi/Gr/Vulkan/SamplerFactory.h

@@ -59,14 +59,14 @@ private:
 
 	~MicroSampler();
 
-	ANKI_USE_RESULT Error init(const SamplerInitInfo& inf);
+	Error init(const SamplerInitInfo& inf);
 };
 
 /// MicroSamplerPtr deleter.
 class MicroSamplerPtrDeleter
 {
 public:
-	void operator()(MicroSampler* s)
+	void operator()([[maybe_unused]] MicroSampler* s)
 	{
 		ANKI_ASSERT(s);
 		// Do nothing. The samplers will be destroyed at app shutdown
@@ -96,7 +96,7 @@ public:
 	void destroy();
 
 	/// Create a new sampler. It's thread-safe.
-	ANKI_USE_RESULT Error newInstance(const SamplerInitInfo& inf, MicroSamplerPtr& psampler);
+	Error newInstance(const SamplerInitInfo& inf, MicroSamplerPtr& psampler);
 
 private:
 	GrManagerImpl* m_gr = nullptr;

+ 1 - 1
AnKi/Gr/Vulkan/SamplerImpl.h

@@ -29,7 +29,7 @@ public:
 	{
 	}
 
-	ANKI_USE_RESULT Error init(const SamplerInitInfo& init);
+	Error init(const SamplerInitInfo& init);
 };
 /// @}
 

+ 1 - 1
AnKi/Gr/Vulkan/ShaderImpl.h

@@ -36,7 +36,7 @@ public:
 
 	~ShaderImpl();
 
-	ANKI_USE_RESULT Error init(const ShaderInitInfo& init);
+	Error init(const ShaderInitInfo& init);
 
 	const VkSpecializationInfo* getSpecConstInfo() const
 	{

+ 4 - 2
AnKi/Gr/Vulkan/SwapchainFactory.cpp

@@ -260,9 +260,11 @@ MicroSwapchainPtr SwapchainFactory::newInstance()
 {
 	// Delete stale swapchains (they are stale because they are probably out of data) and always create a new one
 	m_recycler.trimCache();
-	MicroSwapchain* dummy = m_recycler.findToReuse(); // This is useless but call it to avoid assertions
+
+	// This is useless but call it to avoid assertions
+	[[maybe_unused]] MicroSwapchain* dummy = m_recycler.findToReuse();
 	ANKI_ASSERT(dummy == nullptr);
-	(void)dummy;
+
 	return MicroSwapchainPtr(m_gr->getAllocator().newInstance<MicroSwapchain>(this));
 }
 

+ 1 - 1
AnKi/Gr/Vulkan/SwapchainFactory.h

@@ -86,7 +86,7 @@ private:
 
 	MicroFencePtr m_fence;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 };
 
 /// Deleter for MicroSwapchainPtr smart pointer.

+ 2 - 3
AnKi/Gr/Vulkan/TextureImpl.cpp

@@ -344,9 +344,8 @@ Error TextureImpl::initImage(const TextureInitInfo& init)
 	// Allocate
 	if(!dedicatedRequirements.prefersDedicatedAllocation)
 	{
-		getGrManagerImpl().getGpuMemoryManager().allocateMemory(memIdx, requirements.memoryRequirements.size,
-																U32(requirements.memoryRequirements.alignment), false,
-																m_memHandle);
+		getGrManagerImpl().getGpuMemoryManager().allocateMemory(
+			memIdx, requirements.memoryRequirements.size, U32(requirements.memoryRequirements.alignment), m_memHandle);
 	}
 	else
 	{

+ 8 - 9
AnKi/Gr/Vulkan/TextureImpl.h

@@ -35,10 +35,9 @@ public:
 
 	~MicroImageView()
 	{
-		for(U32 idx : m_bindlessIndices)
+		for([[maybe_unused]] U32 idx : m_bindlessIndices)
 		{
 			ANKI_ASSERT(idx == MAX_U32 && "Forgot to unbind the bindless");
-			(void)idx;
 		}
 		ANKI_ASSERT(m_handle == VK_NULL_HANDLE);
 	}
@@ -103,12 +102,12 @@ public:
 
 	~TextureImpl();
 
-	ANKI_USE_RESULT Error init(const TextureInitInfo& init)
+	Error init(const TextureInitInfo& init)
 	{
 		return initInternal(VK_NULL_HANDLE, init);
 	}
 
-	ANKI_USE_RESULT Error initExternal(VkImage image, const TextureInitInfo& init)
+	Error initExternal(VkImage image, const TextureInitInfo& init)
 	{
 		return initInternal(image, init);
 	}
@@ -143,7 +142,7 @@ public:
 		return layer;
 	}
 
-	U32 computeVkArrayLayer(const TextureVolumeInfo& vol) const
+	U32 computeVkArrayLayer([[maybe_unused]] const TextureVolumeInfo& vol) const
 	{
 		ANKI_ASSERT(m_texType == TextureType::_3D);
 		return 0;
@@ -207,16 +206,16 @@ private:
 	mutable SpinLock m_usedForMtx;
 #endif
 
-	ANKI_USE_RESULT static VkImageCreateFlags calcCreateFlags(const TextureInitInfo& init);
+	[[nodiscard]] static VkImageCreateFlags calcCreateFlags(const TextureInitInfo& init);
 
-	ANKI_USE_RESULT Bool imageSupported(const TextureInitInfo& init);
+	[[nodiscard]] Bool imageSupported(const TextureInitInfo& init);
 
-	ANKI_USE_RESULT Error initImage(const TextureInitInfo& init);
+	Error initImage(const TextureInitInfo& init);
 
 	/// Compute the new type of a texture view.
 	TextureType computeNewTexTypeOfSubresource(const TextureSubresourceInfo& subresource) const;
 
-	ANKI_USE_RESULT Error initInternal(VkImage externalImage, const TextureInitInfo& init);
+	Error initInternal(VkImage externalImage, const TextureInitInfo& init);
 
 	void computeBarrierInfo(TextureUsageBit usage, Bool src, U32 level, VkPipelineStageFlags& stages,
 							VkAccessFlags& accesses) const;

+ 1 - 1
AnKi/Gr/Vulkan/TextureViewImpl.h

@@ -25,7 +25,7 @@ public:
 
 	~TextureViewImpl();
 
-	ANKI_USE_RESULT Error init(const TextureViewInitInfo& inf);
+	Error init(const TextureViewInitInfo& inf);
 
 	VkImageSubresourceRange getVkImageSubresourceRange() const
 	{

+ 1 - 1
AnKi/Gr/Vulkan/TimestampQueryImpl.h

@@ -28,7 +28,7 @@ public:
 	~TimestampQueryImpl();
 
 	/// Create the query.
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Get query result.
 	TimestampQueryResult getResultInternal(Second& timestamp) const;

+ 6 - 4
AnKi/Importer/GltfImporter.cpp

@@ -29,7 +29,7 @@ static F32 computeLightRadius(const Vec3 color)
 }
 
 #if 0
-static ANKI_USE_RESULT Error getUniformScale(const Mat4& m, F32& out)
+static Error getUniformScale(const Mat4& m, F32& out)
 {
 	const F32 SCALE_THRESHOLD = 0.01f; // 1 cm
 
@@ -114,7 +114,7 @@ static void getNodeTransform(const cgltf_node& node, Vec3& tsl, Mat3& rot, Vec3&
 	}
 }
 
-static ANKI_USE_RESULT Error getNodeTransform(const cgltf_node& node, Transform& trf)
+static Error getNodeTransform(const cgltf_node& node, Transform& trf)
 {
 	Vec3 tsl;
 	Mat3 rot;
@@ -712,7 +712,8 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 			}
 
 			// Thread task
-			auto callback = [](void* userData, U32 threadId, ThreadHive& hive, ThreadHiveSemaphore* signalSemaphore) {
+			auto callback = [](void* userData, [[maybe_unused]] U32 threadId, [[maybe_unused]] ThreadHive& hive,
+							   [[maybe_unused]] ThreadHiveSemaphore* signalSemaphore) {
 				Ctx& self = *static_cast<Ctx*>(userData);
 
 				// LOD 0
@@ -1403,7 +1404,8 @@ Error GltfImporter::writeLight(const cgltf_node& node, const HashMapAuto<CString
 	return Error::NONE;
 }
 
-Error GltfImporter::writeCamera(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras)
+Error GltfImporter::writeCamera(const cgltf_node& node,
+								[[maybe_unused]] const HashMapAuto<CString, StringAuto>& parentExtras)
 {
 	if(node.camera->type != cgltf_camera_type_perspective)
 	{

+ 15 - 16
AnKi/Importer/GltfImporter.h

@@ -43,9 +43,9 @@ public:
 
 	~GltfImporter();
 
-	ANKI_USE_RESULT Error init(const GltfImporterInitInfo& initInfo);
+	Error init(const GltfImporterInitInfo& initInfo);
 
-	ANKI_USE_RESULT Error writeAll();
+	Error writeAll();
 
 private:
 	class PtrHasher
@@ -89,9 +89,8 @@ private:
 	U32 m_skipLodVertexCountThreshold = 256;
 
 	// Misc
-	ANKI_USE_RESULT Error getExtras(const cgltf_extras& extras, HashMapAuto<CString, StringAuto>& out);
-	ANKI_USE_RESULT Error parseArrayOfNumbers(CString str, DynamicArrayAuto<F64>& out,
-											  const U32* expectedArraySize = nullptr);
+	Error getExtras(const cgltf_extras& extras, HashMapAuto<CString, StringAuto>& out);
+	Error parseArrayOfNumbers(CString str, DynamicArrayAuto<F64>& out, const U32* expectedArraySize = nullptr);
 	void populateNodePtrToIdx();
 	void populateNodePtrToIdxInternal(const cgltf_node& node, U32& idx);
 	StringAuto getNodeName(const cgltf_node& node);
@@ -136,19 +135,19 @@ private:
 	StringAuto computeSkeletonResourceFilename(const cgltf_skin& skin) const;
 
 	// Resources
-	ANKI_USE_RESULT Error writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFactor);
-	ANKI_USE_RESULT Error writeMaterial(const cgltf_material& mtl, Bool writeRayTracing);
-	ANKI_USE_RESULT Error writeModel(const cgltf_mesh& mesh);
-	ANKI_USE_RESULT Error writeAnimation(const cgltf_animation& anim);
-	ANKI_USE_RESULT Error writeSkeleton(const cgltf_skin& skin);
+	Error writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFactor);
+	Error writeMaterial(const cgltf_material& mtl, Bool writeRayTracing);
+	Error writeModel(const cgltf_mesh& mesh);
+	Error writeAnimation(const cgltf_animation& anim);
+	Error writeSkeleton(const cgltf_skin& skin);
 
 	// Scene
-	ANKI_USE_RESULT Error writeTransform(const Transform& trf);
-	ANKI_USE_RESULT Error visitNode(const cgltf_node& node, const Transform& parentTrf,
-									const HashMapAuto<CString, StringAuto>& parentExtras);
-	ANKI_USE_RESULT Error writeLight(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
-	ANKI_USE_RESULT Error writeCamera(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
-	ANKI_USE_RESULT Error writeModelNode(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
+	Error writeTransform(const Transform& trf);
+	Error visitNode(const cgltf_node& node, const Transform& parentTrf,
+					const HashMapAuto<CString, StringAuto>& parentExtras);
+	Error writeLight(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
+	Error writeCamera(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
+	Error writeModelNode(const cgltf_node& node, const HashMapAuto<CString, StringAuto>& parentExtras);
 };
 /// @}
 

+ 16 - 19
AnKi/Importer/ImageImporter.cpp

@@ -158,7 +158,7 @@ public:
 
 } // namespace
 
-static ANKI_USE_RESULT Error checkConfig(const ImageImporterConfig& config)
+static Error checkConfig(const ImageImporterConfig& config)
 {
 #define ANKI_CFG_ASSERT(x, message) \
 	do \
@@ -212,7 +212,7 @@ static ANKI_USE_RESULT Error checkConfig(const ImageImporterConfig& config)
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error identifyImage(CString filename, U32& width, U32& height, U32& channelCount, Bool& hdr)
+static Error identifyImage(CString filename, U32& width, U32& height, U32& channelCount, Bool& hdr)
 {
 	I32 iwidth, iheight, ichannelCount;
 	const I ok = stbi_info(filename.cstr(), &iwidth, &iheight, &ichannelCount);
@@ -232,8 +232,8 @@ static ANKI_USE_RESULT Error identifyImage(CString filename, U32& width, U32& he
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error checkInputImages(const ImageImporterConfig& config, U32& width, U32& height,
-											  U32& channelCount, Bool& isHdr)
+static Error checkInputImages(const ImageImporterConfig& config, U32& width, U32& height, U32& channelCount,
+							  Bool& isHdr)
 {
 	width = 0;
 	height = 0;
@@ -271,8 +271,8 @@ static ANKI_USE_RESULT Error checkInputImages(const ImageImporterConfig& config,
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error resizeImage(CString inImageFilename, U32 outWidth, U32 outHeight, CString tempDirectory,
-										 GenericMemoryPoolAllocator<U8> alloc, StringAuto& tmpFilename)
+static Error resizeImage(CString inImageFilename, U32 outWidth, U32 outHeight, CString tempDirectory,
+						 GenericMemoryPoolAllocator<U8> alloc, StringAuto& tmpFilename)
 {
 	U32 inWidth, inHeight, channelCount;
 	Bool hdr;
@@ -410,7 +410,7 @@ static void linearToSRgbBatch(WeakArray<TVec> pixels, TFunc func)
 	}
 }
 
-static ANKI_USE_RESULT Error loadFirstMipmap(const ImageImporterConfig& config, ImageImporterContext& ctx)
+static Error loadFirstMipmap(const ImageImporterConfig& config, ImageImporterContext& ctx)
 {
 	GenericMemoryPoolAllocator<U8> alloc = ctx.getAllocator();
 
@@ -587,10 +587,9 @@ static void generateSurfaceMipmap(ConstWeakArray<U8, PtrSize> inBuffer, U32 inWi
 	}
 }
 
-static ANKI_USE_RESULT Error compressS3tc(GenericMemoryPoolAllocator<U8> alloc, CString tempDirectory,
-										  CString compressonatorFilename, ConstWeakArray<U8, PtrSize> inPixels,
-										  U32 inWidth, U32 inHeight, U32 channelCount, Bool hdr,
-										  WeakArray<U8, PtrSize> outPixels)
+static Error compressS3tc(GenericMemoryPoolAllocator<U8> alloc, CString tempDirectory, CString compressonatorFilename,
+						  ConstWeakArray<U8, PtrSize> inPixels, U32 inWidth, U32 inHeight, U32 channelCount, Bool hdr,
+						  WeakArray<U8, PtrSize> outPixels)
 {
 	ANKI_ASSERT(inPixels.getSizeInBytes()
 				== PtrSize(inWidth) * inHeight * channelCount * ((hdr) ? sizeof(F32) : sizeof(U8)));
@@ -700,13 +699,11 @@ static ANKI_USE_RESULT Error compressS3tc(GenericMemoryPoolAllocator<U8> alloc,
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error compressAstc(GenericMemoryPoolAllocator<U8> alloc, CString tempDirectory,
-										  CString astcencFilename, ConstWeakArray<U8, PtrSize> inPixels, U32 inWidth,
-										  U32 inHeight, U32 inChannelCount, UVec2 blockSize, Bool hdr,
-										  WeakArray<U8, PtrSize> outPixels)
+static Error compressAstc(GenericMemoryPoolAllocator<U8> alloc, CString tempDirectory, CString astcencFilename,
+						  ConstWeakArray<U8, PtrSize> inPixels, U32 inWidth, U32 inHeight, U32 inChannelCount,
+						  UVec2 blockSize, Bool hdr, WeakArray<U8, PtrSize> outPixels)
 {
-	const PtrSize blockBytes = 16;
-	(void)blockBytes;
+	[[maybe_unused]] const PtrSize blockBytes = 16;
 	ANKI_ASSERT(inPixels.getSizeInBytes()
 				== PtrSize(inWidth) * inHeight * inChannelCount * ((hdr) ? sizeof(F32) : sizeof(U8)));
 	ANKI_ASSERT(inWidth > 0 && isPowerOfTwo(inWidth) && inHeight > 0 && isPowerOfTwo(inHeight));
@@ -816,7 +813,7 @@ static ANKI_USE_RESULT Error compressAstc(GenericMemoryPoolAllocator<U8> alloc,
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error storeAnkiImage(const ImageImporterConfig& config, const ImageImporterContext& ctx)
+static Error storeAnkiImage(const ImageImporterConfig& config, const ImageImporterContext& ctx)
 {
 	ANKI_IMPORTER_LOGV("Storing to %s", config.m_outFilename.cstr());
 
@@ -909,7 +906,7 @@ static ANKI_USE_RESULT Error storeAnkiImage(const ImageImporterConfig& config, c
 	return Error::NONE;
 }
 
-static ANKI_USE_RESULT Error importImageInternal(const ImageImporterConfig& configOriginal)
+static Error importImageInternal(const ImageImporterConfig& configOriginal)
 {
 	GenericMemoryPoolAllocator<U8> alloc = configOriginal.m_allocator;
 	ImageImporterConfig config = configOriginal;

+ 1 - 1
AnKi/Importer/ImageImporter.h

@@ -36,7 +36,7 @@ public:
 };
 
 /// Converts images to AnKi's specific format.
-ANKI_USE_RESULT Error importImage(const ImageImporterConfig& config);
+Error importImage(const ImageImporterConfig& config);
 /// @}
 
 } // end namespace anki

+ 3 - 3
AnKi/Input/Input.h

@@ -32,8 +32,8 @@ class Input
 	ANKI_FRIEND_ALLOCATOR
 
 public:
-	static ANKI_USE_RESULT Error newInstance(AllocAlignedCallback allocCallback, void* allocCallbackUserData,
-											 NativeWindow* nativeWindow, Input*& input);
+	static Error newInstance(AllocAlignedCallback allocCallback, void* allocCallbackUserData,
+							 NativeWindow* nativeWindow, Input*& input);
 
 	static void deleteInstance(Input* input);
 
@@ -78,7 +78,7 @@ public:
 	}
 
 	/// Populate the key and button with the new state
-	ANKI_USE_RESULT Error handleEvents();
+	Error handleEvents();
 
 	/// Move the mouse cursor to a position inside the window. Useful for locking the cursor into a fixed location (eg
 	/// in the center of the screen)

+ 1 - 1
AnKi/Input/InputAndroid.h

@@ -15,7 +15,7 @@ namespace anki {
 class InputAndroid : public Input
 {
 public:
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	void handleAndroidEvents(android_app* app, int32_t cmd);
 	int handleAndroidInput(android_app* app, AInputEvent* event);

+ 2 - 2
AnKi/Math/Mat.h

@@ -1345,7 +1345,7 @@ public:
 
 	/// Calculate a perspective projection matrix. The z is mapped in [0, 1] range just like DX and Vulkan.
 	ANKI_ENABLE_METHOD(I == 4 && J == 4)
-	static ANKI_USE_RESULT TMat calculatePerspectiveProjectionMatrix(T fovX, T fovY, T near, T far)
+	[[nodiscard]] static TMat calculatePerspectiveProjectionMatrix(T fovX, T fovY, T near, T far)
 	{
 		ANKI_ASSERT(fovX > T(0) && fovY > T(0) && near > T(0) && far > T(0));
 		const T g = near - far;
@@ -1374,7 +1374,7 @@ public:
 
 	/// Calculate an orthographic projection matrix. The z is mapped in [0, 1] range just like DX and Vulkan.
 	ANKI_ENABLE_METHOD(I == 4 && J == 4)
-	static ANKI_USE_RESULT TMat calculateOrthographicProjectionMatrix(T right, T left, T top, T bottom, T near, T far)
+	[[nodiscard]] static TMat calculateOrthographicProjectionMatrix(T right, T left, T top, T bottom, T near, T far)
 	{
 		ANKI_ASSERT(right != T(0) && left != T(0) && top != T(0) && bottom != T(0) && near != T(0) && far != T(0));
 		const T difx = right - left;

+ 1 - 2
AnKi/Math/Transform.h

@@ -38,8 +38,7 @@ public:
 		const TVec<T, 3> s2 = m4.getColumn(2).xyz();
 
 		const TVec<T, 3> scales(s0.getLength(), s1.getLength(), s2.getLength());
-		const T E = T(0.001);
-		(void)E;
+		[[maybe_unused]] const T E = T(0.001);
 		ANKI_ASSERT(isZero(scales.x() - scales.y(), E) && isZero(scales.y() - scales.z(), E)
 					&& "Expecting uniform scale");
 

+ 5 - 5
AnKi/Physics/Common.h

@@ -90,17 +90,17 @@ enum class PhysicsMaterialBit : U64
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PhysicsMaterialBit)
 
-ANKI_USE_RESULT inline Vec3 toAnki(const btVector3& v)
+[[nodiscard]] inline Vec3 toAnki(const btVector3& v)
 {
 	return Vec3(v.getX(), v.getY(), v.getZ());
 }
 
-ANKI_USE_RESULT inline btVector3 toBt(const Vec3& v)
+[[nodiscard]] inline btVector3 toBt(const Vec3& v)
 {
 	return btVector3(v.x(), v.y(), v.z());
 }
 
-ANKI_USE_RESULT inline btTransform toBt(const Transform& a)
+[[nodiscard]] inline btTransform toBt(const Transform& a)
 {
 	Mat4 mat(a);
 	mat.transpose();
@@ -109,14 +109,14 @@ ANKI_USE_RESULT inline btTransform toBt(const Transform& a)
 	return out;
 }
 
-ANKI_USE_RESULT inline Mat3x4 toAnki(const btMatrix3x3& m)
+[[nodiscard]] inline Mat3x4 toAnki(const btMatrix3x3& m)
 {
 	Mat3x4 m3;
 	m3.setRows(Vec4(toAnki(m[0]), 0.0f), Vec4(toAnki(m[1]), 0.0f), Vec4(toAnki(m[2]), 0.0f));
 	return m3;
 }
 
-ANKI_USE_RESULT inline Transform toAnki(const btTransform& t)
+[[nodiscard]] inline Transform toAnki(const btTransform& t)
 {
 	Transform out;
 	out.setRotation(toAnki(t.getBasis()));

+ 5 - 4
AnKi/Physics/PhysicsDrawer.h

@@ -43,8 +43,9 @@ private:
 			m_drawer->drawLines(&lines[0], 2, Vec4(toAnki(color), 1.0f));
 		}
 
-		void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime,
-							  const btVector3& color) override
+		void drawContactPoint([[maybe_unused]] const btVector3& PointOnB, [[maybe_unused]] const btVector3& normalOnB,
+							  [[maybe_unused]] btScalar distance, [[maybe_unused]] int lifeTime,
+							  [[maybe_unused]] const btVector3& color) override
 		{
 			// TODO
 		}
@@ -54,12 +55,12 @@ private:
 			ANKI_PHYS_LOGW("%s", warningString);
 		}
 
-		void draw3dText(const btVector3& location, const char* textString) override
+		void draw3dText([[maybe_unused]] const btVector3& location, [[maybe_unused]] const char* textString) override
 		{
 			// TODO
 		}
 
-		void setDebugMode(int debugMode) override
+		void setDebugMode([[maybe_unused]] int debugMode) override
 		{
 			// TODO
 		}

+ 2 - 1
AnKi/Physics/PhysicsPlayerController.h

@@ -32,7 +32,8 @@ class PhysicsPlayerController final : public PhysicsFilteredObject
 
 public:
 	// Update the state machine
-	void setVelocity(F32 forwardSpeed, F32 strafeSpeed, F32 jumpSpeed, const Vec4& forwardDir)
+	void setVelocity(F32 forwardSpeed, [[maybe_unused]] F32 strafeSpeed, [[maybe_unused]] F32 jumpSpeed,
+					 const Vec4& forwardDir)
 	{
 		m_controller->setWalkDirection(toBt((forwardDir * forwardSpeed).xyz()));
 	}

+ 3 - 3
AnKi/Physics/PhysicsTrigger.h

@@ -21,17 +21,17 @@ class PhysicsTriggerProcessContactCallback
 {
 public:
 	/// Will be called whenever a contact first touches a trigger.
-	virtual void onTriggerEnter(PhysicsTrigger& trigger, PhysicsFilteredObject& obj)
+	virtual void onTriggerEnter([[maybe_unused]] PhysicsTrigger& trigger, [[maybe_unused]] PhysicsFilteredObject& obj)
 	{
 	}
 
 	/// Will be called whenever a contact touches a trigger.
-	virtual void onTriggerInside(PhysicsTrigger& trigger, PhysicsFilteredObject& obj)
+	virtual void onTriggerInside([[maybe_unused]] PhysicsTrigger& trigger, [[maybe_unused]] PhysicsFilteredObject& obj)
 	{
 	}
 
 	/// Will be called whenever a contact stops touching a trigger.
-	virtual void onTriggerExit(PhysicsTrigger& trigger, PhysicsFilteredObject& obj)
+	virtual void onTriggerExit([[maybe_unused]] PhysicsTrigger& trigger, [[maybe_unused]] PhysicsFilteredObject& obj)
 	{
 	}
 };

+ 1 - 3
AnKi/Physics/PhysicsWorld.cpp

@@ -222,7 +222,7 @@ void PhysicsWorld::destroyMarkedForDeletion()
 	}
 }
 
-Error PhysicsWorld::update(Second dt)
+void PhysicsWorld::update(Second dt)
 {
 	// First destroy
 	destroyMarkedForDeletion();
@@ -260,8 +260,6 @@ Error PhysicsWorld::update(Second dt)
 
 	// Reset the pool
 	m_tmpAlloc.getMemoryPool().reset();
-
-	return Error::NONE;
 }
 
 void PhysicsWorld::destroyObject(PhysicsObject* obj)

+ 2 - 2
AnKi/Physics/PhysicsWorld.h

@@ -43,7 +43,7 @@ public:
 	PhysicsWorld();
 	~PhysicsWorld();
 
-	ANKI_USE_RESULT Error init(AllocAlignedCallback allocCb, void* allocCbData);
+	Error init(AllocAlignedCallback allocCb, void* allocCbData);
 
 	template<typename T, typename... TArgs>
 	PhysicsPtr<T> newInstance(TArgs&&... args)
@@ -62,7 +62,7 @@ public:
 	}
 
 	/// Do the update.
-	Error update(Second dt);
+	void update(Second dt);
 
 	HeapAllocator<U8> getAllocator() const
 	{

+ 1 - 1
AnKi/Renderer/AccelerationStructureBuilder.h

@@ -25,7 +25,7 @@ public:
 	{
 	}
 
-	ANKI_USE_RESULT Error init()
+	Error init()
 	{
 		return Error::NONE;
 	}

+ 4 - 4
AnKi/Renderer/Bloom.h

@@ -22,7 +22,7 @@ public:
 
 	~Bloom();
 
-	ANKI_USE_RESULT Error init()
+	Error init()
 	{
 		const Error err = initInternal();
 		if(err)
@@ -79,10 +79,10 @@ private:
 		RenderTargetHandle m_upscaleRt;
 	} m_runCtx;
 
-	ANKI_USE_RESULT Error initExposure();
-	ANKI_USE_RESULT Error initUpscale();
+	Error initExposure();
+	Error initUpscale();
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 };
 
 /// @}

+ 2 - 1
AnKi/Renderer/ClusterBinning.cpp

@@ -223,7 +223,8 @@ void ClusterBinning::writeClustererBuffers(RenderingContext& ctx)
 void ClusterBinning::writeClusterBuffersAsync()
 {
 	m_r->getThreadHive().submitTask(
-		[](void* userData, U32 threadId, ThreadHive& hive, ThreadHiveSemaphore* signalSemaphore) {
+		[](void* userData, [[maybe_unused]] U32 threadId, [[maybe_unused]] ThreadHive& hive,
+		   [[maybe_unused]] ThreadHiveSemaphore* signalSemaphore) {
 			static_cast<ClusterBinning*>(userData)->writeClustererBuffersTask();
 		},
 		this);

+ 1 - 1
AnKi/Renderer/ClusterBinning.h

@@ -20,7 +20,7 @@ public:
 
 	~ClusterBinning();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);

+ 1 - 1
AnKi/Renderer/Dbg.h

@@ -23,7 +23,7 @@ public:
 
 	~Dbg();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);

+ 2 - 2
AnKi/Renderer/DepthDownscale.h

@@ -25,7 +25,7 @@ public:
 
 	~DepthDownscale();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Import render targets
 	void importRenderTargets(RenderingContext& ctx);
@@ -80,7 +80,7 @@ private:
 		RenderTargetHandle m_hizRt;
 	} m_runCtx; ///< Run context.
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void runCompute(RenderPassWorkContext& rgraphCtx);
 	void runGraphics(U32 mip, RenderPassWorkContext& rgraphCtx);

+ 2 - 2
AnKi/Renderer/DownscaleBlur.h

@@ -23,7 +23,7 @@ public:
 
 	~DownscaleBlur();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Import render targets
 	void importRenderTargets(RenderingContext& ctx);
@@ -69,7 +69,7 @@ private:
 		RenderTargetHandle m_rt;
 	} m_runCtx;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void run(U32 passIdx, RenderPassWorkContext& rgraphCtx);
 };

+ 2 - 2
AnKi/Renderer/FinalComposite.h

@@ -20,7 +20,7 @@ public:
 	FinalComposite(Renderer* r);
 	~FinalComposite();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);
@@ -42,7 +42,7 @@ private:
 	ImageResourcePtr m_lut; ///< Color grading lookup texture.
 	ImageResourcePtr m_blueNoise;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void run(RenderingContext& ctx, RenderPassWorkContext& rgraphCtx);
 };

+ 1 - 1
AnKi/Renderer/ForwardShading.h

@@ -23,7 +23,7 @@ public:
 
 	~ForwardShading();
 
-	ANKI_USE_RESULT Error init()
+	Error init()
 	{
 		return Error::NONE;
 	}

+ 3 - 3
AnKi/Renderer/GBuffer.h

@@ -27,7 +27,7 @@ public:
 
 	~GBuffer();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);
@@ -48,7 +48,7 @@ public:
 	}
 
 	void getDebugRenderTarget(CString rtName, RenderTargetHandle& handle,
-							  ShaderProgramPtr& optionalShaderProgram) const override
+							  [[maybe_unused]] ShaderProgramPtr& optionalShaderProgram) const override
 	{
 		if(rtName == "GBufferAlbedo")
 		{
@@ -81,7 +81,7 @@ private:
 		RenderTargetHandle m_prevFrameDepthRt;
 	} m_runCtx;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void runInThread(const RenderingContext& ctx, RenderPassWorkContext& rgraphCtx) const;
 };

+ 2 - 2
AnKi/Renderer/GBufferPost.h

@@ -23,7 +23,7 @@ public:
 
 	~GBufferPost();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);
@@ -34,7 +34,7 @@ private:
 
 	FramebufferDescription m_fbDescr;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void run(const RenderingContext& ctx, RenderPassWorkContext& rgraphCtx);
 };

+ 1 - 1
AnKi/Renderer/GenericCompute.h

@@ -24,7 +24,7 @@ public:
 
 	~GenericCompute();
 
-	ANKI_USE_RESULT Error init()
+	Error init()
 	{
 		return Error::NONE;
 	}

+ 2 - 2
AnKi/Renderer/IndirectDiffuse.h

@@ -27,7 +27,7 @@ public:
 
 	~IndirectDiffuse();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	void populateRenderGraph(RenderingContext& ctx);
 
@@ -82,7 +82,7 @@ private:
 		Array<RenderTargetHandle, 2> m_mainRtHandles;
 	} m_runCtx;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 };
 /// @}
 

+ 6 - 6
AnKi/Renderer/IndirectDiffuseProbes.h

@@ -29,7 +29,7 @@ public:
 
 	~IndirectDiffuseProbes();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);
@@ -100,11 +100,11 @@ private:
 	U32 m_tileSize = 0;
 	U32 m_maxVisibleProbes = 0;
 
-	ANKI_USE_RESULT Error initInternal();
-	ANKI_USE_RESULT Error initGBuffer();
-	ANKI_USE_RESULT Error initShadowMapping();
-	ANKI_USE_RESULT Error initLightShading();
-	ANKI_USE_RESULT Error initIrradiance();
+	Error initInternal();
+	Error initGBuffer();
+	Error initShadowMapping();
+	Error initLightShading();
+	Error initIrradiance();
 
 	void runGBufferInThread(RenderPassWorkContext& rgraphCtx, InternalContext& giCtx) const;
 	void runShadowmappingInThread(RenderPassWorkContext& rgraphCtx, InternalContext& giCtx) const;

+ 1 - 1
AnKi/Renderer/IndirectSpecular.cpp

@@ -225,7 +225,7 @@ void IndirectSpecular::run(const RenderingContext& ctx, RenderPassWorkContext& r
 }
 
 void IndirectSpecular::getDebugRenderTarget(CString rtName, RenderTargetHandle& handle,
-											ShaderProgramPtr& optionalShaderProgram) const
+											[[maybe_unused]] ShaderProgramPtr& optionalShaderProgram) const
 {
 	if(rtName == "SSR")
 	{

+ 2 - 2
AnKi/Renderer/IndirectSpecular.h

@@ -24,7 +24,7 @@ public:
 
 	~IndirectSpecular();
 
-	ANKI_USE_RESULT Error init();
+	Error init();
 
 	/// Populate the rendergraph.
 	void populateRenderGraph(RenderingContext& ctx);
@@ -54,7 +54,7 @@ private:
 		Array<RenderTargetHandle, 2> m_rts;
 	} m_runCtx;
 
-	ANKI_USE_RESULT Error initInternal();
+	Error initInternal();
 
 	void run(const RenderingContext& ctx, RenderPassWorkContext& rgraphCtx);
 

Some files were not shown because too many files changed in this diff