Browse Source

Fixing bugs. Enhancing DArray

Panagiotis Christopoulos Charitos 11 years ago
parent
commit
c541648b92

+ 3 - 0
include/anki/resource/Common.h

@@ -33,6 +33,9 @@ using TempResourceAllocator = StackAllocator<T>;
 template<typename T>
 using TempResourceDArray = DArray<T, TempResourceAllocator<T>>;
 
+template<typename T>
+using TempResourceDArrayAuto = DArrayAuto<T, TempResourceAllocator<T>>;
+
 using TempResourceString = StringBase<TempResourceAllocator<char>>;
 
 /// Contains initialization information for the resource classes.

+ 2 - 0
include/anki/resource/Material.h

@@ -18,6 +18,7 @@ namespace anki {
 
 // Forward
 class XmlElement;
+class Material;
 class MaterialProgramCreator;
 class MaterialProgramCreatorInputVariable;
 
@@ -145,6 +146,7 @@ public:
 
 	void destroy(ResourceAllocator<U8> alloc)
 	{
+		m_name.destroy(alloc);
 		m_data.destroy(alloc);
 	}
 

+ 4 - 2
include/anki/scene/Common.h

@@ -20,7 +20,7 @@ class SceneNode;
 
 /// The type of the scene's allocator
 template<typename T>
-using SceneAllocator = StackAllocator<T, false>;
+using SceneAllocator = ChainAllocator<T, true>;
 
 /// The type of the scene's frame allocator
 template<typename T>
@@ -33,10 +33,12 @@ using SceneString = StringBase<SceneAllocator<char>>;
 template<typename T>
 using SceneDArray = DArray<T, SceneAllocator<T>>;
 
-/// The same as SceneDArray. Different name to show the difference
 template<typename T>
 using SceneFrameDArray = DArray<T, SceneFrameAllocator<T>>;
 
+template<typename T>
+using SceneFrameDArrayAuto = DArrayAuto<T, SceneFrameAllocator<T>>;
+
 /// Scene dictionary
 template<typename T>
 using SceneDictionary = 

+ 1 - 1
include/anki/scene/SceneNode.h

@@ -59,7 +59,7 @@ public:
 
 	SceneAllocator<U8> getSceneAllocator() const;
 
-	SceneAllocator<U8> getSceneFrameAllocator() const;
+	SceneFrameAllocator<U8> getSceneFrameAllocator() const;
 
 	ANKI_USE_RESULT Error addChild(SceneNode* obj)
 	{

+ 4 - 4
include/anki/scene/Visibility.h

@@ -138,13 +138,13 @@ public:
 	}
 
 	ANKI_USE_RESULT Error moveBackRenderable(
-		SceneAllocator<U8> alloc, VisibleNode& x)
+		SceneFrameAllocator<U8> alloc, VisibleNode& x)
 	{
 		return moveBack(alloc, m_renderables, m_renderablesCount, x);
 	}
 
 	ANKI_USE_RESULT Error moveBackLight(
-		SceneAllocator<U8> alloc, VisibleNode& x)
+		SceneFrameAllocator<U8> alloc, VisibleNode& x)
 	{
 		return moveBack(alloc, m_lights, m_lightsCount, x);
 	}
@@ -155,8 +155,8 @@ private:
 	U32 m_renderablesCount = 0;
 	U32 m_lightsCount = 0;
 
-	ANKI_USE_RESULT Error moveBack(
-		SceneAllocator<U8> alloc, Container& c, U32& count, VisibleNode& x);
+	ANKI_USE_RESULT Error moveBack(SceneFrameAllocator<U8> alloc, 
+		Container& c, U32& count, VisibleNode& x);
 };
 
 /// Sort spatial scene nodes on distance

+ 68 - 14
include/anki/util/DArray.h

@@ -8,24 +8,15 @@
 
 #include "anki/util/Allocator.h"
 #include "anki/util/NonCopyable.h"
-#include "anki/util/ScopeDestroyer.h"
 
 namespace anki {
 
-// Forward
-template<typename T, typename TAlloc>
-class DArray;
-
-/// @addtogroup util_private
-/// @{
-template<typename T, typename TAlloc>
-using DArrayScopeDestroyer = ScopeDestroyer<DArray<T, TAlloc>, TAlloc>;
-/// @}
-
 /// @addtogroup util_containers
 /// @{
 
-/// Dynamic array.
+/// Dynamic array with manual destruction. It doesn't hold the allocator and 
+/// that makes it compact. At the same time that requires manual destruction. 
+/// Used in permanent classes.
 template<typename T, typename TAlloc = HeapAllocator<T>>
 class DArray: public NonCopyable
 {
@@ -37,8 +28,6 @@ public:
 	using Reference = Value&;
 	using ConstReference = const Value&;
 
-	using ScopeDestroyer = DArrayScopeDestroyer<T, TAlloc>;
-
 	// STL compatible
 	using iterator = Iterator;
 	using const_iterator = ConstIterator;
@@ -50,6 +39,7 @@ public:
 		m_size(0)
 	{}
 
+	/// Move.
 	DArray(DArray&& b)
 	:	DArray()
 	{
@@ -62,6 +52,7 @@ public:
 			&& "Requires manual destruction");
 	}
 
+	/// Move.
 	DArray& operator=(DArray&& b)
 	{
 		move(b);
@@ -264,6 +255,69 @@ private:
 		b.m_size = 0;
 	}
 };
+
+/// Dynamic array with automatic destruction. It's the same as DArray but it 
+/// holds the allocator in order to perform automatic destruction. Use it for
+/// temp operations and on transient classes.
+template<typename T, typename TAlloc = HeapAllocator<T>>
+class DArrayAuto: public DArray<T, TAlloc>
+{
+public:
+	using Base = DArray<T, TAlloc>;
+	using Value = typename Base::Value;
+	using Allocator = typename Base::Allocator;
+
+	DArrayAuto(Allocator alloc)
+	:	Base(),
+		m_alloc(alloc)
+	{}
+
+	/// Move.
+	DArrayAuto(DArrayAuto&& b)
+	:	DArrayAuto()
+	{
+		move(b);
+	}
+
+	~DArrayAuto()
+	{
+		Base::destroy(m_alloc);
+	}
+
+	/// Move.
+	DArrayAuto& operator=(DArrayAuto&& b)
+	{
+		move(b);
+		return *this;
+	}
+
+	/// Create the array.
+	ANKI_USE_RESULT Error create(PtrSize size)
+	{
+		return Base::create(m_alloc, size);
+	}
+
+	/// Create the array.
+	ANKI_USE_RESULT Error create(PtrSize size, const Value& v)
+	{
+		return Base::create(m_alloc, size, v);
+	}
+
+	/// Grow the array.
+	ANKI_USE_RESULT Error resize(PtrSize size)
+	{
+		return Base::resize(m_alloc, size);
+	}
+
+private:
+	Allocator m_alloc;
+
+	void move(DArrayAuto& b)
+	{
+		Base::move(b);
+		m_alloc = b.m_alloc;
+	}
+};
 /// @}
 
 } // end namespace anki

+ 12 - 12
include/anki/util/Memory.h

@@ -14,10 +14,10 @@ namespace anki {
 /// @{
 
 /// Allocate aligned memory
-void* mallocAligned(PtrSize size, PtrSize alignmentBytes) noexcept;
+void* mallocAligned(PtrSize size, PtrSize alignmentBytes);
 
 /// Free aligned memory
-void freeAligned(void* ptr) noexcept;
+void freeAligned(void* ptr);
 
 /// The function signature of a memory allocation/deallocation. 
 /// See allocAligned function for the explanation of arguments
@@ -35,7 +35,7 @@ using AllocAlignedCallback = void* (*)(void*, void*, PtrSize, PtrSize);
 /// @return On allocation mode it will return the newelly allocated block or
 ///         nullptr on error. On deallocation mode returns nullptr
 void* allocAligned(
-	void* userData, void* ptr, PtrSize size, PtrSize alignment) noexcept;
+	void* userData, void* ptr, PtrSize size, PtrSize alignment);
 
 /// A dummy interface to match the StackMemoryPool and ChainMemoryPool 
 /// interfaces in order to be used by the same allocator template
@@ -75,16 +75,16 @@ public:
 	Error create(AllocAlignedCallback allocCb, void* allocCbUserData);
 
 	/// Check if two memory pools are the same one.
-	Bool operator==(const HeapMemoryPool& b) const noexcept
+	Bool operator==(const HeapMemoryPool& b) const
 	{
 		return m_impl == b.m_impl;
 	}
 
 	/// Allocate memory
-	void* allocate(PtrSize size, PtrSize alignment) noexcept;
+	void* allocate(PtrSize size, PtrSize alignment);
 
 	/// Free memory
-	Bool free(void* ptr) noexcept;
+	Bool free(void* ptr);
 
 	/// Return number of allocations
 	U32 getAllocationsCount() const;
@@ -135,7 +135,7 @@ public:
 	StackMemoryPool& operator=(const StackMemoryPool& other);
 
 	/// Check if two memory pools are the same one.
-	Bool operator==(const StackMemoryPool& b) const noexcept
+	Bool operator==(const StackMemoryPool& b) const
 	{
 		return m_impl == b.m_impl;
 	}
@@ -154,14 +154,14 @@ public:
 	/// @param size The size to allocate
 	/// @param alignmentBytes The alignment of the returned address
 	/// @return The allocated memory or nullptr on failure
-	void* allocate(PtrSize size, PtrSize alignmentBytes) noexcept;
+	void* allocate(PtrSize size, PtrSize alignmentBytes);
 
 	/// Free memory in StackMemoryPool. If the ptr is not the last allocation
 	/// then nothing happens and the method returns false. The operation is
 	/// threadsafe
 	/// @param[in, out] ptr Memory block to deallocate
 	/// @return True if the deallocation actually happened and false otherwise
-	Bool free(void* ptr) noexcept;
+	Bool free(void* ptr);
 
 	/// Reinit the pool. All existing allocated memory will be lost
 	void reset();
@@ -238,7 +238,7 @@ public:
 	ChainMemoryPool& operator=(const ChainMemoryPool& other);
 
 	/// Check if two memory pools are the same one.
-	Bool operator==(const ChainMemoryPool& b) const noexcept
+	Bool operator==(const ChainMemoryPool& b) const
 	{
 		return m_impl == b.m_impl;
 	}
@@ -266,13 +266,13 @@ public:
 	/// @param size The size to allocate
 	/// @param alignmentBytes The alignment of the returned address
 	/// @return The allocated memory or nullptr on failure
-	void* allocate(PtrSize size, PtrSize alignmentBytes) noexcept;
+	void* allocate(PtrSize size, PtrSize alignmentBytes);
 
 	/// Free memory. If the ptr is not the last allocation of the chunk
 	/// then nothing happens and the method returns false
 	/// @param[in, out] ptr Memory block to deallocate
 	/// @return True if the deallocation actually happened and false otherwise
-	Bool free(void* ptr) noexcept;
+	Bool free(void* ptr);
 
 	/// Get the number of users for this pool
 	U32 getUsersCount() const;

+ 12 - 30
src/renderer/Lf.cpp

@@ -192,15 +192,9 @@ Error Lf::run(GlCommandBufferHandle& cmdBuff)
 	VisibilityTestResults& vi = cam.getVisibilityTestResults();
 
 	// Iterate the visible light and get those that have lens flare
-	SceneDArray<Light*> lights;
-	SceneDArray<Light*>::ScopeDestroyer lightsd(
-		&lights, scene.getFrameAllocator());
-	err = lights.create(
-		scene.getFrameAllocator(), m_maxLightsWithFlares, nullptr);
-	if(err)
-	{
-		return err;
-	}
+	SceneFrameDArrayAuto<Light*> lights(scene.getFrameAllocator());
+	err = lights.create(m_maxLightsWithFlares, nullptr);
+	if(err)	return err;
 
 	U lightsCount = 0;
 	auto it = vi.getLightsBegin();
@@ -234,32 +228,20 @@ Error Lf::run(GlCommandBufferHandle& cmdBuff)
 		GlClientBufferHandle flaresCBuff;
 		err = flaresCBuff.create(cmdBuff,
 			sizeof(Flare) * lightsCount * m_maxFlaresPerLight, nullptr);
-		if(err)
-		{
-			return err;
-		}
+		if(err)	return err;
 
 		Flare* flares = (Flare*)flaresCBuff.getBaseAddress();
 		U flaresCount = 0;
 
 		// Contains the number of flares per flare texture
-		SceneFrameDArray<U> groups;
-		SceneFrameDArray<U>::ScopeDestroyer groupsd(
-			&groups, scene.getFrameAllocator());
-		err = groups.create(scene.getFrameAllocator(), lightsCount, 0U);
-		if(err)
-		{
-			return err;
-		}
-
-		SceneFrameDArray<const GlTextureHandle*> texes;
-		SceneFrameDArray<const GlTextureHandle*>::ScopeDestroyer 
-			texesd(&texes, scene.getFrameAllocator());
-		err = texes.create(scene.getFrameAllocator(), lightsCount, nullptr);
-		if(err)
-		{
-			return err;
-		}
+		SceneFrameDArrayAuto<U> groups(scene.getFrameAllocator());
+		err = groups.create(lightsCount, 0U);
+		if(err)	return err;
+
+		SceneFrameDArrayAuto<const GlTextureHandle*> texes(
+			scene.getFrameAllocator());
+		err = texes.create(lightsCount, nullptr);
+		if(err)	return err;
 
 		U groupsCount = 0;
 

+ 9 - 6
src/resource/Material.cpp

@@ -92,8 +92,7 @@ MaterialVariableTemplate<T>* MaterialVariableTemplate<T>::_newInstance(
 	Error err = ErrorCode::NONE;
 	MaterialVariableTemplate<T>* out = nullptr;
 
-	TempResourceDArray<F32> floats;
-	TempResourceDArray<F32>::ScopeDestroyer floatsd(&floats, talloc);
+	TempResourceDArrayAuto<F32> floats(talloc);
 
 	// Get the float values
 	if(in.m_value.getSize() > 0)
@@ -110,7 +109,7 @@ MaterialVariableTemplate<T>* MaterialVariableTemplate<T>::_newInstance(
 			return nullptr;
 		}
 
-		err = floats.create(talloc, floatsNeeded);
+		err = floats.create(floatsNeeded);
 		if(err) return nullptr;
 
 		auto it = in.m_value.getBegin();
@@ -183,12 +182,16 @@ Material::~Material()
 
 	for(auto it : m_vars)
 	{
-		MaterialVariable* mvar = &(*it);
-		mvar->destroy(alloc);
-		alloc.deleteInstance(mvar);
+		if(it)
+		{
+			MaterialVariable* mvar = &(*it);
+			mvar->destroy(alloc);
+			alloc.deleteInstance(mvar);
+		}
 	}
 
 	m_vars.destroy(alloc);
+	m_pplines.destroy(alloc);
 }
 
 //==============================================================================

+ 37 - 32
src/resource/MaterialProgramCreator.cpp

@@ -98,6 +98,14 @@ ANKI_USE_RESULT Error computeShaderVariableDataType(
 	{
 		out = ShaderVariableDataType::MAT4;
 	}
+	else if(str == "sampler2D")
+	{
+		out = ShaderVariableDataType::SAMPLER_2D;
+	}
+	else if(str == "samplerCube")
+	{
+		out = ShaderVariableDataType::SAMPLER_CUBE;
+	}
 	else
 	{
 		ANKI_LOGE("Incorrect variable type %s", &str[0]);
@@ -357,37 +365,45 @@ Error MaterialProgramCreator::parseInputsTag(const XmlElement& programEl)
 		{
 			I64 tmp;
 			ANKI_CHECK(arrSizeEl.getI64(tmp));
+			if(tmp == 0)
+			{
+				ANKI_LOGE("Array size for some reason is zero");
+				return ErrorCode::USER_DATA;
+			}
+
 			inpvar.m_arraySize = tmp;
 		}
 		else
 		{
-			inpvar.m_arraySize = 0;
+			inpvar.m_arraySize = 1;
 		}
 
 		// <instanced>
-		if(inpvar.m_arraySize == 0)
+		XmlElement instancedEl;
+		ANKI_CHECK(
+			inputEl.getChildElementOptional("instanced", instancedEl));
+
+		if(instancedEl)
 		{
-			XmlElement instancedEl;
-			ANKI_CHECK(
-				inputEl.getChildElementOptional("instanced", instancedEl));
+			I64 tmp;
+			ANKI_CHECK(instancedEl.getI64(tmp));
+			inpvar.m_instanced = tmp;
 
-			if(instancedEl)
+			if(inpvar.m_instanced && inpvar.m_arraySize == 1)
 			{
-				I64 tmp;
-				ANKI_CHECK(instancedEl.getI64(tmp));
-				inpvar.m_instanced = tmp;
-			}
-			else
-			{
-				inpvar.m_instanced = 0;
+				inpvar.m_arraySize = ANKI_GL_MAX_INSTANCES;
 			}
+		}
+		else
+		{
+			inpvar.m_instanced = 0;
+		}
 
-			// If one input var is instanced notify the whole program that 
-			// it's instanced
-			if(inpvar.m_instanced)
-			{
-				m_instanced = true;
-			}
+		// If one input var is instanced notify the whole program that 
+		// it's instanced
+		if(inpvar.m_instanced)
+		{
+			m_instanced = true;
 		}
 
 		// Now you have the info to check if duplicate
@@ -433,21 +449,10 @@ Error MaterialProgramCreator::parseInputsTag(const XmlElement& programEl)
 			ANKI_CHECK(inpvar.m_line.sprintf(
 				m_alloc, "%s %s", &inpvar.m_typeStr[0], &inpvar.m_name[0]));
 			
-			U arrSize = 0;
-			if(inpvar.m_instanced)
-			{
-				inpvar.m_arraySize = ANKI_GL_MAX_INSTANCES;
-			}
-
 			if(inpvar.m_arraySize > 1)
-			{
-				arrSize = inpvar.m_arraySize;
-			}
-
-			if(arrSize)
 			{
 				MPString tmp;
-				ANKI_CHECK(tmp.sprintf(m_alloc, "[%uU]", arrSize));
+				ANKI_CHECK(tmp.sprintf(m_alloc, "[%uU]", inpvar.m_arraySize));
 				ANKI_CHECK(inpvar.m_line.append(m_alloc, tmp));
 				tmp.destroy(m_alloc);
 			}
@@ -516,7 +521,7 @@ Error MaterialProgramCreator::parseInputsTag(const XmlElement& programEl)
 				return ErrorCode::USER_DATA;
 			}
 
-			if(inpvar.m_arraySize > 0)
+			if(inpvar.m_arraySize > 1)
 			{
 				ANKI_LOGE("Const arrays currently cannot be handled");
 				return ErrorCode::USER_DATA;

+ 2 - 2
src/resource/Mesh.cpp

@@ -89,8 +89,8 @@ Error Mesh::createBuffers(const MeshLoader& loader,
 	U32 vbosize = vertexsize * m_vertsCount;
 
 	// Create a temp buffer and populate it
-	TempResourceDArray<U8> buff;
-	ANKI_CHECK(buff.create(init.m_tempAlloc, vbosize, 0));
+	TempResourceDArrayAuto<U8> buff(init.m_tempAlloc);
+	ANKI_CHECK(buff.create(vbosize, 0));
 
 	U8* ptra = &buff[0];
 	for(U i = 0; i < m_vertsCount; i++)

+ 1 - 3
src/resource/Model.cpp

@@ -63,9 +63,7 @@ Error ModelPatchBase::createVertexDesc(
 
 		if(!vbo.isCreated())
 		{
-			ANKI_LOGE("Material asks for attribute that the mesh "
-				"does not have: %s", attrib.m_name);
-			return ErrorCode::USER_DATA;
+			continue;
 		}
 		
 		vbo.bindVertexBuffer(vertexJobs, size, type, false, stride,

+ 3 - 4
src/scene/ModelNode.cpp

@@ -283,13 +283,12 @@ Error ModelNode::frameUpdate(F32, F32)
 	Error err = ErrorCode::NONE;
 
 	// Gather the move components of the instances
-	SceneFrameDArray<const MoveComponent*> instanceMoves;
-	SceneFrameDArray<const MoveComponent*>::ScopeDestroyer instanceMovesd(
-		&instanceMoves, getSceneFrameAllocator());
+	SceneFrameDArrayAuto<const MoveComponent*> instanceMoves(
+		getSceneFrameAllocator());
 	U instanceMovesCount = 0;
 	Timestamp instancesTimestamp = 0;
 
-	err = instanceMoves.create(getSceneFrameAllocator(), 64);
+	err = instanceMoves.create(64);
 	if(err)
 	{
 		return err;

+ 3 - 4
src/scene/ParticleEmitter.cpp

@@ -561,13 +561,12 @@ Error ParticleEmitter::doInstancingCalcs()
 	//
 	// Gather the move components of the instances
 	//
-	SceneFrameDArray<MoveComponent*> instanceMoves;
-	SceneFrameDArray<MoveComponent*>::ScopeDestroyer instanceMovesd(
-		&instanceMoves, getSceneFrameAllocator());
+	SceneFrameDArrayAuto<MoveComponent*> instanceMoves(
+		getSceneFrameAllocator());
 	U instanceMovesCount = 0;
 	Timestamp instancesTimestamp = 0;
 
-	err = instanceMoves.create(getSceneFrameAllocator(), 64);
+	err = instanceMoves.create(64);
 	if(err)
 	{
 		return err;

+ 6 - 2
src/scene/SceneGraph.cpp

@@ -111,9 +111,13 @@ Error SceneGraph::create(
 	m_gl = &m_resources->_getGlDevice();
 
 	m_alloc = SceneAllocator<U8>(
-		allocCb, allocCbData, ANKI_SCENE_ALLOCATOR_SIZE);
+		allocCb, allocCbData, 
+		1024 * 10,
+		1024 * 10,
+		ChainMemoryPool::ChunkGrowMethod::FIXED,
+		0);
 	m_frameAlloc = SceneFrameAllocator<U8>(
-		allocCb, allocCbData, ANKI_SCENE_FRAME_ALLOCATOR_SIZE);
+		allocCb, allocCbData, ANKI_SCENE_ALLOCATOR_SIZE);
 
 	err = m_events.create(this);
 

+ 1 - 1
src/scene/SceneNode.cpp

@@ -56,7 +56,7 @@ SceneAllocator<U8> SceneNode::getSceneAllocator() const
 }
 
 //==============================================================================
-SceneAllocator<U8> SceneNode::getSceneFrameAllocator() const
+SceneFrameAllocator<U8> SceneNode::getSceneFrameAllocator() const
 {
 	ANKI_ASSERT(m_scene);
 	return m_scene->getFrameAllocator();

+ 1 - 1
src/scene/Visibility.cpp

@@ -202,7 +202,7 @@ Error VisibilityTestTask::test(SceneNode& testedNode, Bool isLight,
 
 //==============================================================================
 Error VisibilityTestResults::moveBack(
-	SceneAllocator<U8> alloc, Container& c, U32& count, VisibleNode& x)
+	SceneFrameAllocator<U8> alloc, Container& c, U32& count, VisibleNode& x)
 {
 	Error err = ErrorCode::NONE;
 

+ 6 - 6
src/script/Event.cpp

@@ -50,7 +50,7 @@ static const char* classnameSceneAmbientColorEvent = "SceneAmbientColorEvent";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<SceneAmbientColorEvent>()
 {
-	return 671577193;
+	return -2736282921550252951;
 }
 
 template<>
@@ -77,7 +77,7 @@ static const char* classnameEventManager = "EventManager";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<EventManager>()
 {
-	return -1078526863;
+	return -6959305329499243407;
 }
 
 template<>
@@ -98,7 +98,7 @@ static inline int pwrapEventManagernewSceneAmbientColorEvent(lua_State* l)
 	LuaBinder::checkArgsCount(l, 4);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameEventManager, -1078526863, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameEventManager, -6959305329499243407, ud)) return -1;
 	EventManager* self = reinterpret_cast<EventManager*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -109,7 +109,7 @@ static inline int pwrapEventManagernewSceneAmbientColorEvent(lua_State* l)
 	F32 arg1;
 	if(LuaBinder::checkNumber(l, 3, arg1)) return -1;
 	
-	if(LuaBinder::checkUserData(l, 4, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 4, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg2 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg2(*iarg2);
 	
@@ -128,7 +128,7 @@ static inline int pwrapEventManagernewSceneAmbientColorEvent(lua_State* l)
 	luaL_setmetatable(l, "SceneAmbientColorEvent");
 	ud->m_data = reinterpret_cast<void*>(ret);
 	ud->m_gc = false;
-	ud->m_sig = 671577193;
+	ud->m_sig = -2736282921550252951;
 	
 	return 1;
 }
@@ -178,7 +178,7 @@ static inline int pwrapgetEventManager(lua_State* l)
 	luaL_setmetatable(l, "EventManager");
 	ud->m_data = reinterpret_cast<void*>(ret);
 	ud->m_gc = false;
-	ud->m_sig = -1078526863;
+	ud->m_sig = -6959305329499243407;
 	
 	return 1;
 }

+ 118 - 118
src/script/Math.cpp

@@ -20,7 +20,7 @@ static const char* classnameVec2 = "Vec2";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<Vec2>()
 {
-	return 1033927924;
+	return 6804478823655046388;
 }
 
 template<>
@@ -54,7 +54,7 @@ static inline int pwrapVec2Ctor(lua_State* l)
 	ud = reinterpret_cast<UserData*>(voidp);
 	ud->m_data = inst;
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	luaL_setmetatable(l, classnameVec2);
 	
 	return 1;
@@ -80,7 +80,7 @@ static int wrapVec2Dtor(lua_State* l)
 	(void)voidp;
 	
 	LuaBinder::checkArgsCount(l, 1);
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	if(ud->m_gc)
 	{
 		Vec2* inst = reinterpret_cast<Vec2*>(ud->m_data);
@@ -103,7 +103,7 @@ static inline int pwrapVec2getX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -138,7 +138,7 @@ static inline int pwrapVec2getY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -173,7 +173,7 @@ static inline int pwrapVec2setX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -209,7 +209,7 @@ static inline int pwrapVec2setY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -245,7 +245,7 @@ static inline int pwrapVec2setAll(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -284,7 +284,7 @@ static inline int pwrapVec2getAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -323,7 +323,7 @@ static inline int pwrapVec2setAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -362,12 +362,12 @@ static inline int pwrapVec2copy(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -399,12 +399,12 @@ static inline int pwrapVec2__add(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -425,7 +425,7 @@ static inline int pwrapVec2__add(lua_State* l)
 	
 	::new(ud->m_data) Vec2(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	
 	return 1;
 }
@@ -452,12 +452,12 @@ static inline int pwrapVec2__sub(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -478,7 +478,7 @@ static inline int pwrapVec2__sub(lua_State* l)
 	
 	::new(ud->m_data) Vec2(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	
 	return 1;
 }
@@ -505,12 +505,12 @@ static inline int pwrapVec2__mul(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -531,7 +531,7 @@ static inline int pwrapVec2__mul(lua_State* l)
 	
 	::new(ud->m_data) Vec2(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	
 	return 1;
 }
@@ -558,12 +558,12 @@ static inline int pwrapVec2__div(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -584,7 +584,7 @@ static inline int pwrapVec2__div(lua_State* l)
 	
 	::new(ud->m_data) Vec2(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	
 	return 1;
 }
@@ -611,12 +611,12 @@ static inline int pwrapVec2__eq(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -651,7 +651,7 @@ static inline int pwrapVec2getLength(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -686,7 +686,7 @@ static inline int pwrapVec2getNormalized(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -707,7 +707,7 @@ static inline int pwrapVec2getNormalized(lua_State* l)
 	
 	::new(ud->m_data) Vec2(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927924;
+	ud->m_sig = 6804478823655046388;
 	
 	return 1;
 }
@@ -734,7 +734,7 @@ static inline int pwrapVec2normalize(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -766,12 +766,12 @@ static inline int pwrapVec2dot(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec2, 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec2, 6804478823655046388, ud)) return -1;
 	Vec2* self = reinterpret_cast<Vec2*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec2", 1033927924, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
 	Vec2* iarg0 = reinterpret_cast<Vec2*>(ud->m_data);
 	const Vec2& arg0(*iarg0);
 	
@@ -831,7 +831,7 @@ static const char* classnameVec3 = "Vec3";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<Vec3>()
 {
-	return 1033927925;
+	return 6804478823655046389;
 }
 
 template<>
@@ -865,7 +865,7 @@ static inline int pwrapVec3Ctor(lua_State* l)
 	ud = reinterpret_cast<UserData*>(voidp);
 	ud->m_data = inst;
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	luaL_setmetatable(l, classnameVec3);
 	
 	return 1;
@@ -891,7 +891,7 @@ static int wrapVec3Dtor(lua_State* l)
 	(void)voidp;
 	
 	LuaBinder::checkArgsCount(l, 1);
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	if(ud->m_gc)
 	{
 		Vec3* inst = reinterpret_cast<Vec3*>(ud->m_data);
@@ -914,7 +914,7 @@ static inline int pwrapVec3getX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -949,7 +949,7 @@ static inline int pwrapVec3getY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -984,7 +984,7 @@ static inline int pwrapVec3getZ(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1019,7 +1019,7 @@ static inline int pwrapVec3setX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1055,7 +1055,7 @@ static inline int pwrapVec3setY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1091,7 +1091,7 @@ static inline int pwrapVec3setZ(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1127,7 +1127,7 @@ static inline int pwrapVec3setAll(lua_State* l)
 	LuaBinder::checkArgsCount(l, 4);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1169,7 +1169,7 @@ static inline int pwrapVec3getAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1208,7 +1208,7 @@ static inline int pwrapVec3setAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1247,12 +1247,12 @@ static inline int pwrapVec3copy(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1284,12 +1284,12 @@ static inline int pwrapVec3__add(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1310,7 +1310,7 @@ static inline int pwrapVec3__add(lua_State* l)
 	
 	::new(ud->m_data) Vec3(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	
 	return 1;
 }
@@ -1337,12 +1337,12 @@ static inline int pwrapVec3__sub(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1363,7 +1363,7 @@ static inline int pwrapVec3__sub(lua_State* l)
 	
 	::new(ud->m_data) Vec3(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	
 	return 1;
 }
@@ -1390,12 +1390,12 @@ static inline int pwrapVec3__mul(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1416,7 +1416,7 @@ static inline int pwrapVec3__mul(lua_State* l)
 	
 	::new(ud->m_data) Vec3(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	
 	return 1;
 }
@@ -1443,12 +1443,12 @@ static inline int pwrapVec3__div(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1469,7 +1469,7 @@ static inline int pwrapVec3__div(lua_State* l)
 	
 	::new(ud->m_data) Vec3(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	
 	return 1;
 }
@@ -1496,12 +1496,12 @@ static inline int pwrapVec3__eq(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1536,7 +1536,7 @@ static inline int pwrapVec3getLength(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1571,7 +1571,7 @@ static inline int pwrapVec3getNormalized(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1592,7 +1592,7 @@ static inline int pwrapVec3getNormalized(lua_State* l)
 	
 	::new(ud->m_data) Vec3(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927925;
+	ud->m_sig = 6804478823655046389;
 	
 	return 1;
 }
@@ -1619,7 +1619,7 @@ static inline int pwrapVec3normalize(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1651,12 +1651,12 @@ static inline int pwrapVec3dot(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec3, 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec3, 6804478823655046389, ud)) return -1;
 	Vec3* self = reinterpret_cast<Vec3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec3", 1033927925, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec3", 6804478823655046389, ud)) return -1;
 	Vec3* iarg0 = reinterpret_cast<Vec3*>(ud->m_data);
 	const Vec3& arg0(*iarg0);
 	
@@ -1718,7 +1718,7 @@ static const char* classnameVec4 = "Vec4";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<Vec4>()
 {
-	return 1033927922;
+	return 6804478823655046386;
 }
 
 template<>
@@ -1752,7 +1752,7 @@ static inline int pwrapVec4Ctor(lua_State* l)
 	ud = reinterpret_cast<UserData*>(voidp);
 	ud->m_data = inst;
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	luaL_setmetatable(l, classnameVec4);
 	
 	return 1;
@@ -1778,7 +1778,7 @@ static int wrapVec4Dtor(lua_State* l)
 	(void)voidp;
 	
 	LuaBinder::checkArgsCount(l, 1);
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	if(ud->m_gc)
 	{
 		Vec4* inst = reinterpret_cast<Vec4*>(ud->m_data);
@@ -1801,7 +1801,7 @@ static inline int pwrapVec4getX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1836,7 +1836,7 @@ static inline int pwrapVec4getY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1871,7 +1871,7 @@ static inline int pwrapVec4getZ(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1906,7 +1906,7 @@ static inline int pwrapVec4getW(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1941,7 +1941,7 @@ static inline int pwrapVec4setX(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -1977,7 +1977,7 @@ static inline int pwrapVec4setY(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2013,7 +2013,7 @@ static inline int pwrapVec4setZ(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2049,7 +2049,7 @@ static inline int pwrapVec4setW(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2085,7 +2085,7 @@ static inline int pwrapVec4setAll(lua_State* l)
 	LuaBinder::checkArgsCount(l, 5);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2130,7 +2130,7 @@ static inline int pwrapVec4getAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2169,7 +2169,7 @@ static inline int pwrapVec4setAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2208,12 +2208,12 @@ static inline int pwrapVec4copy(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2245,12 +2245,12 @@ static inline int pwrapVec4__add(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2271,7 +2271,7 @@ static inline int pwrapVec4__add(lua_State* l)
 	
 	::new(ud->m_data) Vec4(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	
 	return 1;
 }
@@ -2298,12 +2298,12 @@ static inline int pwrapVec4__sub(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2324,7 +2324,7 @@ static inline int pwrapVec4__sub(lua_State* l)
 	
 	::new(ud->m_data) Vec4(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	
 	return 1;
 }
@@ -2351,12 +2351,12 @@ static inline int pwrapVec4__mul(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2377,7 +2377,7 @@ static inline int pwrapVec4__mul(lua_State* l)
 	
 	::new(ud->m_data) Vec4(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	
 	return 1;
 }
@@ -2404,12 +2404,12 @@ static inline int pwrapVec4__div(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2430,7 +2430,7 @@ static inline int pwrapVec4__div(lua_State* l)
 	
 	::new(ud->m_data) Vec4(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	
 	return 1;
 }
@@ -2457,12 +2457,12 @@ static inline int pwrapVec4__eq(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2497,7 +2497,7 @@ static inline int pwrapVec4getLength(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2532,7 +2532,7 @@ static inline int pwrapVec4getNormalized(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2553,7 +2553,7 @@ static inline int pwrapVec4getNormalized(lua_State* l)
 	
 	::new(ud->m_data) Vec4(std::move(ret));
 	ud->m_gc = true;
-	ud->m_sig = 1033927922;
+	ud->m_sig = 6804478823655046386;
 	
 	return 1;
 }
@@ -2580,7 +2580,7 @@ static inline int pwrapVec4normalize(lua_State* l)
 	LuaBinder::checkArgsCount(l, 1);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2612,12 +2612,12 @@ static inline int pwrapVec4dot(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameVec4, 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameVec4, 6804478823655046386, ud)) return -1;
 	Vec4* self = reinterpret_cast<Vec4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Vec4", 1033927922, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
 	Vec4* iarg0 = reinterpret_cast<Vec4*>(ud->m_data);
 	const Vec4& arg0(*iarg0);
 	
@@ -2681,7 +2681,7 @@ static const char* classnameMat3 = "Mat3";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<Mat3>()
 {
-	return -1957774267;
+	return 6306819796139686981;
 }
 
 template<>
@@ -2715,7 +2715,7 @@ static inline int pwrapMat3Ctor(lua_State* l)
 	ud = reinterpret_cast<UserData*>(voidp);
 	ud->m_data = inst;
 	ud->m_gc = true;
-	ud->m_sig = -1957774267;
+	ud->m_sig = 6306819796139686981;
 	luaL_setmetatable(l, classnameMat3);
 	
 	return 1;
@@ -2741,7 +2741,7 @@ static int wrapMat3Dtor(lua_State* l)
 	(void)voidp;
 	
 	LuaBinder::checkArgsCount(l, 1);
-	if(LuaBinder::checkUserData(l, 1, classnameMat3, -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3, 6306819796139686981, ud)) return -1;
 	if(ud->m_gc)
 	{
 		Mat3* inst = reinterpret_cast<Mat3*>(ud->m_data);
@@ -2764,12 +2764,12 @@ static inline int pwrapMat3copy(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3, -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3, 6306819796139686981, ud)) return -1;
 	Mat3* self = reinterpret_cast<Mat3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Mat3", -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Mat3", 6306819796139686981, ud)) return -1;
 	Mat3* iarg0 = reinterpret_cast<Mat3*>(ud->m_data);
 	const Mat3& arg0(*iarg0);
 	
@@ -2801,7 +2801,7 @@ static inline int pwrapMat3getAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3, -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3, 6306819796139686981, ud)) return -1;
 	Mat3* self = reinterpret_cast<Mat3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2843,7 +2843,7 @@ static inline int pwrapMat3setAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 4);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3, -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3, 6306819796139686981, ud)) return -1;
 	Mat3* self = reinterpret_cast<Mat3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2885,7 +2885,7 @@ static inline int pwrapMat3setAll(lua_State* l)
 	LuaBinder::checkArgsCount(l, 10);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3, -1957774267, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3, 6306819796139686981, ud)) return -1;
 	Mat3* self = reinterpret_cast<Mat3*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -2957,7 +2957,7 @@ static const char* classnameMat3x4 = "Mat3x4";
 template<>
 I64 LuaBinder::getWrappedTypeSignature<Mat3x4>()
 {
-	return -222450941;
+	return -2654194732934255869;
 }
 
 template<>
@@ -2991,7 +2991,7 @@ static inline int pwrapMat3x4Ctor(lua_State* l)
 	ud = reinterpret_cast<UserData*>(voidp);
 	ud->m_data = inst;
 	ud->m_gc = true;
-	ud->m_sig = -222450941;
+	ud->m_sig = -2654194732934255869;
 	luaL_setmetatable(l, classnameMat3x4);
 	
 	return 1;
@@ -3017,7 +3017,7 @@ static int wrapMat3x4Dtor(lua_State* l)
 	(void)voidp;
 	
 	LuaBinder::checkArgsCount(l, 1);
-	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -2654194732934255869, ud)) return -1;
 	if(ud->m_gc)
 	{
 		Mat3x4* inst = reinterpret_cast<Mat3x4*>(ud->m_data);
@@ -3040,12 +3040,12 @@ static inline int pwrapMat3x4copy(lua_State* l)
 	LuaBinder::checkArgsCount(l, 2);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -2654194732934255869, ud)) return -1;
 	Mat3x4* self = reinterpret_cast<Mat3x4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
 	// Pop arguments
-	if(LuaBinder::checkUserData(l, 2, "Mat3x4", -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 2, "Mat3x4", -2654194732934255869, ud)) return -1;
 	Mat3x4* iarg0 = reinterpret_cast<Mat3x4*>(ud->m_data);
 	const Mat3x4& arg0(*iarg0);
 	
@@ -3077,7 +3077,7 @@ static inline int pwrapMat3x4getAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 3);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -2654194732934255869, ud)) return -1;
 	Mat3x4* self = reinterpret_cast<Mat3x4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -3119,7 +3119,7 @@ static inline int pwrapMat3x4setAt(lua_State* l)
 	LuaBinder::checkArgsCount(l, 4);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -2654194732934255869, ud)) return -1;
 	Mat3x4* self = reinterpret_cast<Mat3x4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	
@@ -3161,7 +3161,7 @@ static inline int pwrapMat3x4setAll(lua_State* l)
 	LuaBinder::checkArgsCount(l, 13);
 	
 	// Get "this" as "self"
-	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -222450941, ud)) return -1;
+	if(LuaBinder::checkUserData(l, 1, classnameMat3x4, -2654194732934255869, ud)) return -1;
 	Mat3x4* self = reinterpret_cast<Mat3x4*>(ud->m_data);
 	ANKI_ASSERT(self != nullptr);
 	

+ 16 - 15
src/util/Memory.cpp

@@ -31,6 +31,7 @@ static Signature computeSignature(void* ptr)
 	Signature sig = sig64;
 	sig ^= 0x5bd1e995;
 	sig ^= sig << 24;
+	ANKI_ASSERT(sig != 0);
 	return sig;
 }
 #endif
@@ -40,7 +41,7 @@ static Signature computeSignature(void* ptr)
 //==============================================================================
 
 //==============================================================================
-void* mallocAligned(PtrSize size, PtrSize alignmentBytes) noexcept
+void* mallocAligned(PtrSize size, PtrSize alignmentBytes)
 {
 #if ANKI_POSIX 
 #	if ANKI_OS != ANKI_OS_ANDROID
@@ -95,7 +96,7 @@ void* mallocAligned(PtrSize size, PtrSize alignmentBytes) noexcept
 }
 
 //==============================================================================
-void freeAligned(void* ptr) noexcept
+void freeAligned(void* ptr)
 {
 #if ANKI_POSIX
 	::free(ptr);
@@ -108,7 +109,7 @@ void freeAligned(void* ptr) noexcept
 
 //==============================================================================
 void* allocAligned(
-	void* userData, void* ptr, PtrSize size, PtrSize alignment) noexcept
+	void* userData, void* ptr, PtrSize size, PtrSize alignment)
 {
 	(void)userData;
 	void* out;
@@ -278,14 +279,14 @@ void HeapMemoryPool::clear()
 }
 
 //==============================================================================
-void* HeapMemoryPool::allocate(PtrSize size, PtrSize alignment) noexcept
+void* HeapMemoryPool::allocate(PtrSize size, PtrSize alignment)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	return m_impl->allocate(size, alignment);
 }
 
 //==============================================================================
-Bool HeapMemoryPool::free(void* ptr) noexcept
+Bool HeapMemoryPool::free(void* ptr)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	return m_impl->free(ptr);
@@ -418,7 +419,7 @@ public:
 	}
 
 	/// Allocate
-	void* allocate(PtrSize size, PtrSize alignment) noexcept
+	void* allocate(PtrSize size, PtrSize alignment)
 	{
 		ANKI_ASSERT(m_memory != nullptr);
 		ANKI_ASSERT(alignment <= m_alignmentBytes);
@@ -462,7 +463,7 @@ public:
 	}
 
 	/// Free
-	Bool free(void* ptr) noexcept
+	Bool free(void* ptr)
 	{
 		// ptr shouldn't be null or not aligned. If not aligned it was not 
 		// allocated by this class
@@ -594,7 +595,7 @@ PtrSize StackMemoryPool::getAllocatedSize() const
 }
 
 //==============================================================================
-void* StackMemoryPool::allocate(PtrSize size, PtrSize alignment) noexcept
+void* StackMemoryPool::allocate(PtrSize size, PtrSize alignment)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	void* mem = m_impl->allocate(size, alignment);
@@ -608,7 +609,7 @@ void* StackMemoryPool::allocate(PtrSize size, PtrSize alignment) noexcept
 }
 
 //==============================================================================
-Bool StackMemoryPool::free(void* ptr) noexcept
+Bool StackMemoryPool::free(void* ptr)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	return m_impl->free(ptr);
@@ -814,7 +815,7 @@ public:
 #endif
 
 	/// Create a new chunk
-	Chunk* createNewChunk(PtrSize size) noexcept
+	Chunk* createNewChunk(PtrSize size)
 	{
 		//
 		// Calculate preferred size
@@ -906,7 +907,7 @@ public:
 	}
 
 	/// Allocate from chunk
-	void* allocateFromChunk(Chunk* ch, PtrSize size, PtrSize alignment) noexcept
+	void* allocateFromChunk(Chunk* ch, PtrSize size, PtrSize alignment)
 	{
 		ANKI_ASSERT(ch);
 		ANKI_ASSERT(size <= m_maxSize);
@@ -925,7 +926,7 @@ public:
 	}
 
 	/// Allocate memory
-	void* allocate(PtrSize size, PtrSize alignment) noexcept
+	void* allocate(PtrSize size, PtrSize alignment)
 	{
 		ANKI_ASSERT(size <= m_maxSize);
 
@@ -965,7 +966,7 @@ public:
 	}
 
 	/// Free memory
-	Bool free(void* ptr) noexcept
+	Bool free(void* ptr)
 	{
 		if(ptr == nullptr)
 		{
@@ -1126,14 +1127,14 @@ void ChainMemoryPool::clear()
 }
 
 //==============================================================================
-void* ChainMemoryPool::allocate(PtrSize size, PtrSize alignment) noexcept
+void* ChainMemoryPool::allocate(PtrSize size, PtrSize alignment)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	return m_impl->allocate(size, alignment);
 }
 
 //==============================================================================
-Bool ChainMemoryPool::free(void* ptr) noexcept
+Bool ChainMemoryPool::free(void* ptr)
 {
 	ANKI_ASSERT(m_impl != nullptr);
 	return m_impl->free(ptr);