Browse Source

Math: Move to the new Vec design

Panagiotis Christopoulos Charitos 22 hours ago
parent
commit
320b719f20
100 changed files with 1806 additions and 4676 deletions
  1. 7 7
      AnKi/Collision/Aabb.cpp
  2. 5 5
      AnKi/Collision/Aabb.h
  3. 4 4
      AnKi/Collision/Cone.h
  4. 1 1
      AnKi/Collision/ConvexHullShape.cpp
  5. 4 4
      AnKi/Collision/Functions.h
  6. 4 4
      AnKi/Collision/FunctionsComputeAabb.cpp
  7. 8 8
      AnKi/Collision/FunctionsMisc.cpp
  8. 14 14
      AnKi/Collision/FunctionsTestCollision.cpp
  9. 8 8
      AnKi/Collision/FunctionsTestPlane.cpp
  10. 1 1
      AnKi/Collision/LineSegment.h
  11. 2 2
      AnKi/Collision/Obb.cpp
  12. 1 1
      AnKi/Collision/Obb.h
  13. 2 2
      AnKi/Collision/Plane.cpp
  14. 2 2
      AnKi/Collision/Plane.h
  15. 5 5
      AnKi/Collision/Ray.h
  16. 1 1
      AnKi/Collision/Sphere.cpp
  17. 5 5
      AnKi/Collision/Sphere.h
  18. 30 30
      AnKi/Editor/EditorUi.cpp
  19. 10 10
      AnKi/Editor/ImageViewerUi.cpp
  20. 2 2
      AnKi/Gr/BackendCommon/Functions.cpp
  21. 1 1
      AnKi/Gr/D3D/D3DCommandBuffer.cpp
  22. 2 2
      AnKi/Gr/D3D/D3DShaderProgram.cpp
  23. 4 4
      AnKi/Gr/Vulkan/VkCommandBuffer.cpp
  24. 8 9
      AnKi/Gr/Vulkan/VkGrUpscaler.cpp
  25. 2 2
      AnKi/Gr/Vulkan/VkGraphicsState.cpp
  26. 20 20
      AnKi/Importer/GltfImporter.cpp
  27. 3 4
      AnKi/Importer/GltfImporterAnimation.cpp
  28. 8 8
      AnKi/Importer/GltfImporterMaterial.cpp
  29. 15 15
      AnKi/Importer/GltfImporterMesh.cpp
  30. 28 28
      AnKi/Importer/ImageImporter.cpp
  31. 0 1
      AnKi/Math.h
  32. 25 25
      AnKi/Math/Axisang.h
  33. 0 16
      AnKi/Math/CommonSrc.h
  34. 2 2
      AnKi/Math/Forward.h
  35. 25 82
      AnKi/Math/Functions.h
  36. 112 113
      AnKi/Math/Mat.h
  37. 15 15
      AnKi/Math/Quat.h
  38. 4 4
      AnKi/Math/Simd.h
  39. 34 50
      AnKi/Math/Transform.h
  40. 1028 1973
      AnKi/Math/Vec.h
  41. 0 1821
      AnKi/Math/Vec2.h
  42. 1 1
      AnKi/Physics/Common.h
  43. 4 4
      AnKi/Physics/PhysicsBody.cpp
  44. 2 2
      AnKi/Physics/PhysicsWorld.cpp
  45. 2 2
      AnKi/Renderer/AccelerationStructureBuilder.cpp
  46. 4 4
      AnKi/Renderer/Bloom.cpp
  47. 6 6
      AnKi/Renderer/ClusterBinning.cpp
  48. 7 7
      AnKi/Renderer/Dbg.cpp
  49. 1 1
      AnKi/Renderer/Dbg.h
  50. 4 4
      AnKi/Renderer/DepthDownscale.cpp
  51. 2 2
      AnKi/Renderer/FinalComposite.cpp
  52. 1 1
      AnKi/Renderer/ForwardShading.cpp
  53. 8 8
      AnKi/Renderer/GBuffer.cpp
  54. 1 1
      AnKi/Renderer/GBufferPost.cpp
  55. 3 3
      AnKi/Renderer/HistoryLength.cpp
  56. 2 2
      AnKi/Renderer/IndirectDiffuse.cpp
  57. 76 81
      AnKi/Renderer/IndirectDiffuseClipmaps.cpp
  58. 8 9
      AnKi/Renderer/IndirectDiffuseProbes.cpp
  59. 6 6
      AnKi/Renderer/LensFlare.cpp
  60. 4 4
      AnKi/Renderer/LightShading.cpp
  61. 9 10
      AnKi/Renderer/MotionBlur.cpp
  62. 3 3
      AnKi/Renderer/MotionVectors.cpp
  63. 3 3
      AnKi/Renderer/PrimaryNonRenderableVisibility.cpp
  64. 2 2
      AnKi/Renderer/ProbeReflections.cpp
  65. 16 17
      AnKi/Renderer/Reflections.cpp
  66. 24 24
      AnKi/Renderer/Renderer.cpp
  67. 1 1
      AnKi/Renderer/Renderer.h
  68. 2 2
      AnKi/Renderer/RtMaterialFetchDbg.cpp
  69. 11 11
      AnKi/Renderer/RtShadows.cpp
  70. 9 10
      AnKi/Renderer/ShadowMapping.cpp
  71. 2 2
      AnKi/Renderer/ShadowmapsResolve.cpp
  72. 8 8
      AnKi/Renderer/Sky.cpp
  73. 10 12
      AnKi/Renderer/Ssao.cpp
  74. 3 3
      AnKi/Renderer/TemporalAA.cpp
  75. 4 4
      AnKi/Renderer/TemporalUpscaler.cpp
  76. 3 3
      AnKi/Renderer/Tonemapping.cpp
  77. 1 2
      AnKi/Renderer/UiStage.cpp
  78. 7 7
      AnKi/Renderer/Utils/GpuVisibility.cpp
  79. 1 1
      AnKi/Renderer/Utils/GpuVisibility.h
  80. 11 12
      AnKi/Renderer/Utils/HzbGenerator.cpp
  81. 1 1
      AnKi/Renderer/Utils/MipmapGenerator.cpp
  82. 3 3
      AnKi/Renderer/Utils/TraditionalDeferredShading.cpp
  83. 2 2
      AnKi/Renderer/VolumetricFog.cpp
  84. 3 3
      AnKi/Renderer/VolumetricLightingAccumulation.cpp
  85. 5 5
      AnKi/Renderer/VrsSriGeneration.cpp
  86. 1 1
      AnKi/Resource/ImageLoader.cpp
  87. 1 1
      AnKi/Resource/MeshBinaryLoader.cpp
  88. 1 1
      AnKi/Resource/MeshResource.cpp
  89. 1 1
      AnKi/Scene/Components/BodyComponent.cpp
  90. 4 4
      AnKi/Scene/Components/DecalComponent.cpp
  91. 4 4
      AnKi/Scene/Components/FogDensityComponent.cpp
  92. 15 15
      AnKi/Scene/Components/GlobalIlluminationProbeComponent.cpp
  93. 1 1
      AnKi/Scene/Components/JointComponent.cpp
  94. 1 1
      AnKi/Scene/Components/LensFlareComponent.cpp
  95. 17 15
      AnKi/Scene/Components/LightComponent.cpp
  96. 3 3
      AnKi/Scene/Components/LightComponent.h
  97. 9 9
      AnKi/Scene/Components/MaterialComponent.cpp
  98. 2 2
      AnKi/Scene/Components/ParticleEmitter2Component.cpp
  99. 1 1
      AnKi/Scene/Components/PlayerControllerComponent.cpp
  100. 7 7
      AnKi/Scene/Components/ReflectionProbeComponent.cpp

+ 7 - 7
AnKi/Collision/Aabb.cpp

@@ -10,7 +10,7 @@ namespace anki {
 Aabb Aabb::getTransformed(const Transform& trf) const
 {
 	Mat3x4 absM;
-	for(U i = 0; i < 12; ++i)
+	for(U32 i = 0; i < 12; ++i)
 	{
 		absM[i] = absolute(trf.getRotation()[i]);
 	}
@@ -31,9 +31,9 @@ Aabb Aabb::getTransformed(const Transform& trf) const
 Aabb Aabb::getCompoundShape(const Aabb& b) const
 {
 	Aabb out;
-	out.m_min.w() = out.m_max.w() = 0.0f;
+	out.m_min.w = out.m_max.w = 0.0f;
 
-	for(U i = 0; i < 3; i++)
+	for(U32 i = 0; i < 3; i++)
 	{
 		out.m_min[i] = (m_min[i] < b.m_min[i]) ? m_min[i] : b.m_min[i];
 		out.m_max[i] = (m_max[i] > b.m_max[i]) ? m_max[i] : b.m_max[i];
@@ -61,7 +61,7 @@ void Aabb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize poin
 		ANKI_ASSERT((ptrToNumber(ptr) + sizeof(Vec3) - ptrToNumber(pointBuffer)) <= buffSize);
 		const Vec3& pos = *reinterpret_cast<const Vec3*>(ptr);
 
-		for(U j = 0; j < 3; j++)
+		for(U32 j = 0; j < 3; j++)
 		{
 			if(pos[j] > m_max[j])
 			{
@@ -81,9 +81,9 @@ Vec4 Aabb::computeSupport(const Vec4& dir) const
 {
 	Vec4 ret(0.0f);
 
-	ret.x() = (dir.x() >= 0.0f) ? m_max.x() : m_min.x();
-	ret.y() = (dir.y() >= 0.0f) ? m_max.y() : m_min.y();
-	ret.z() = (dir.z() >= 0.0f) ? m_max.z() : m_min.z();
+	ret.x = (dir.x >= 0.0f) ? m_max.x : m_min.x;
+	ret.y = (dir.y >= 0.0f) ? m_max.y : m_min.y;
+	ret.z = (dir.z >= 0.0f) ? m_max.z : m_min.z;
 
 	return ret;
 }

+ 5 - 5
AnKi/Collision/Aabb.h

@@ -65,7 +65,7 @@ public:
 
 	void setMin(const Vec4& x)
 	{
-		ANKI_ASSERT(x.w() == 0.0f);
+		ANKI_ASSERT(x.w == 0.0f);
 		m_min = x;
 	}
 
@@ -82,7 +82,7 @@ public:
 
 	void setMax(const Vec4& x)
 	{
-		ANKI_ASSERT(x.w() == 0.0f);
+		ANKI_ASSERT(x.w == 0.0f);
 		m_max = x;
 	}
 
@@ -118,9 +118,9 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_min.xyz() < m_max.xyz());
-		ANKI_ASSERT(m_min.w() == 0.0f);
-		ANKI_ASSERT(m_max.w() == 0.0f);
+		ANKI_ASSERT(m_min.xyz < m_max.xyz);
+		ANKI_ASSERT(m_min.w == 0.0f);
+		ANKI_ASSERT(m_max.w == 0.0f);
 	}
 };
 /// @}

+ 4 - 4
AnKi/Collision/Cone.h

@@ -99,9 +99,9 @@ public:
 	{
 		Cone out;
 		out.m_origin = transform.transform(m_origin);
-		out.m_dir = (transform.getRotation() * m_dir.xyz0()).xyz0();
+		out.m_dir = (transform.getRotation() * m_dir.xyz0).xyz0;
 		ANKI_ASSERT(transform.hasUniformScale());
-		out.m_length *= transform.getScale().x();
+		out.m_length *= transform.getScale().x;
 		return out;
 	}
 
@@ -132,8 +132,8 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_origin.w() == 0.0f);
-		ANKI_ASSERT(m_dir.w() == 0.0f);
+		ANKI_ASSERT(m_origin.w == 0.0f);
+		ANKI_ASSERT(m_dir.w == 0.0f);
 		ANKI_ASSERT(m_length > 0.0f);
 		ANKI_ASSERT(m_angle > 0.0f && m_angle < 2.0f * kPi);
 	}

+ 1 - 1
AnKi/Collision/ConvexHullShape.cpp

@@ -35,7 +35,7 @@ Vec4 ConvexHullShape::computeSupport(const Vec4& dir) const
 	F32 m = kMinF32;
 	U index = 0;
 
-	const Vec4 d = (m_trfIdentity) ? dir : (m_invTrf.getRotation() * dir).xyz0();
+	const Vec4 d = (m_trfIdentity) ? dir : (m_invTrf.getRotation() * dir).xyz0;
 
 	const Vec4* points = m_points;
 	const Vec4* end = m_points + m_pointCount;

+ 4 - 4
AnKi/Collision/Functions.h

@@ -41,7 +41,7 @@ F32 testPlane(const Plane& plane, const Ray& ray);
 /// @copydoc testPlane(const Plane&, const Aabb&)
 inline F32 testPlane(const Plane& plane, const Vec4& point)
 {
-	ANKI_ASSERT(isZero(point.w()));
+	ANKI_ASSERT(isZero(point.w));
 	return plane.getNormal().dot(point) - plane.getOffset();
 }
 
@@ -197,10 +197,10 @@ Bool testCollision(const Sphere& sphere, const Ray& ray, Array<Vec4, 2>& interse
 inline F32 testCollisionInside(const Aabb& aabb, const Ray& ray)
 {
 	const Vec4 reciprocal = ray.getDirection().reciprocal();
-	const Vec4 intersectMaxPointPlanes = ((aabb.getMax() - ray.getOrigin()) * reciprocal).xyz0();
-	const Vec4 intersectMinPointPlanes = ((aabb.getMin() - ray.getOrigin()) * reciprocal).xyz0();
+	const Vec4 intersectMaxPointPlanes = ((aabb.getMax() - ray.getOrigin()) * reciprocal).xyz0;
+	const Vec4 intersectMinPointPlanes = ((aabb.getMin() - ray.getOrigin()) * reciprocal).xyz0;
 	const Vec4 largestParams = intersectMaxPointPlanes.max(intersectMinPointPlanes);
-	const F32 distToIntersect = min(min(largestParams.x(), largestParams.y()), largestParams.z());
+	const F32 distToIntersect = min(min(largestParams.x, largestParams.y), largestParams.z);
 	return distToIntersect;
 }
 

+ 4 - 4
AnKi/Collision/FunctionsComputeAabb.cpp

@@ -15,15 +15,15 @@ namespace anki {
 Aabb computeAabb(const Sphere& sphere)
 {
 	Aabb aabb;
-	aabb.setMin((sphere.getCenter() - sphere.getRadius()).xyz0());
-	aabb.setMax((sphere.getCenter() + sphere.getRadius()).xyz0());
+	aabb.setMin((sphere.getCenter() - sphere.getRadius()).xyz0);
+	aabb.setMax((sphere.getCenter() + sphere.getRadius()).xyz0);
 	return aabb;
 }
 
 Aabb computeAabb(const Obb& obb)
 {
 	Mat3x4 absM;
-	for(U i = 0; i < 12; ++i)
+	for(U32 i = 0; i < 12; ++i)
 	{
 		absM[i] = absolute(obb.getRotation()[i]);
 	}
@@ -48,7 +48,7 @@ Aabb computeAabb(const ConvexHullShape& hull)
 		maxa = maxa.max(o);
 	}
 
-	return Aabb(mina.xyz0(), maxa.xyz0());
+	return Aabb(mina.xyz0, maxa.xyz0);
 }
 
 Aabb computeAabb(const LineSegment& ls)

+ 8 - 8
AnKi/Collision/FunctionsMisc.cpp

@@ -17,9 +17,9 @@ void extractClipPlane(const Mat4& mvp, FrustumPlaneType id, Plane& plane)
 	case i: \
 	{ \
 		const Vec4 planeEqationCoefs = mvp.getRow(a) op mvp.getRow(b); \
-		const Vec4 n = planeEqationCoefs.xyz0(); \
+		const Vec4 n = planeEqationCoefs.xyz0; \
 		const F32 len = n.length(); \
-		plane = Plane(n / len, -planeEqationCoefs.w() / len); \
+		plane = Plane(n / len, -planeEqationCoefs.w / len); \
 		break; \
 	}
 
@@ -28,9 +28,9 @@ void extractClipPlane(const Mat4& mvp, FrustumPlaneType id, Plane& plane)
 	case FrustumPlaneType::kNear:
 	{
 		const Vec4 planeEqationCoefs = mvp.getRow(2);
-		const Vec4 n = planeEqationCoefs.xyz0();
+		const Vec4 n = planeEqationCoefs.xyz0;
 		const F32 len = n.length();
-		plane = Plane(n / len, -planeEqationCoefs.w() / len);
+		plane = Plane(n / len, -planeEqationCoefs.w / len);
 		break;
 	}
 		ANKI_CASE(FrustumPlaneType::kFar, 3, -, 2)
@@ -146,7 +146,7 @@ Vec4 computeBoundingSphereRecursive(WeakArray<const Vec3*> pPoints, U32 begin, U
 			return m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13);
 		};
 
-		const F32 denominator = 2.0f * compDet(a.x(), a.y(), a.z(), b.x(), b.y(), b.z(), c.x(), c.y(), c.z());
+		const F32 denominator = 2.0f * compDet(a.x, a.y, a.z, b.x, b.y, b.z, c.x, c.y, c.z);
 
 		Vec3 o = c.dot(c) * a.cross(b);
 		o += b.dot(b) * c.cross(a);
@@ -167,8 +167,8 @@ Vec4 computeBoundingSphereRecursive(WeakArray<const Vec3*> pPoints, U32 begin, U
 
 	for(U32 i = 0; i < p; i++)
 	{
-		const F32 distSq = (sphere.xyz() - *pPoints[begin + i]).lengthSquared();
-		const F32 radiusSq = sphere.w() * sphere.w();
+		const F32 distSq = (sphere.xyz - *pPoints[begin + i]).lengthSquared();
+		const F32 radiusSq = sphere.w * sphere.w;
 
 		if(distSq > radiusSq)
 		{
@@ -213,7 +213,7 @@ Sphere computeBoundingSphere(const Vec3* firstPoint, U32 pointCount, PtrSize str
 
 	const Vec4 sphere = computeBoundingSphereRecursive(pPoints, 0, pPoints.getSize(), 0);
 
-	return Sphere(sphere.xyz(), sphere.w());
+	return Sphere(sphere.xyz, sphere.w);
 }
 
 Aabb computeBoundingAabb(const Vec3* firstPoint, U32 pointCount, PtrSize stride)

+ 14 - 14
AnKi/Collision/FunctionsTestCollision.cpp

@@ -28,8 +28,8 @@ static Bool testCollisionGjk(const T& a, const Y& b)
 Bool testCollision(const Aabb& a, const Aabb& b)
 {
 #if ANKI_SIMD_SSE
-	const __m128 gt0 = _mm_cmpgt_ps(a.getMin().getSimd(), b.getMax().getSimd());
-	const __m128 gt1 = _mm_cmpgt_ps(b.getMin().getSimd(), a.getMax().getSimd());
+	const __m128 gt0 = _mm_cmpgt_ps(a.getMin().m_simd, b.getMax().m_simd);
+	const __m128 gt1 = _mm_cmpgt_ps(b.getMin().m_simd, a.getMax().m_simd);
 
 	const __m128 combined = _mm_or_ps(gt0, gt1);
 
@@ -38,19 +38,19 @@ Bool testCollision(const Aabb& a, const Aabb& b)
 	return res == 0;
 #else
 	// if separated in x direction
-	if(a.getMin().x() > b.getMax().x() || b.getMin().x() > a.getMax().x())
+	if(a.getMin().x > b.getMax().x || b.getMin().x > a.getMax().x)
 	{
 		return false;
 	}
 
 	// if separated in y direction
-	if(a.getMin().y() > b.getMax().y() || b.getMin().y() > a.getMax().y())
+	if(a.getMin().y > b.getMax().y || b.getMin().y > a.getMax().y)
 	{
 		return false;
 	}
 
 	// if separated in z direction
-	if(a.getMin().z() > b.getMax().z() || b.getMin().z() > a.getMax().z())
+	if(a.getMin().z > b.getMax().z || b.getMin().z > a.getMax().z)
 	{
 		return false;
 	}
@@ -66,16 +66,16 @@ Bool testCollision(const Aabb& aabb, const Sphere& s)
 
 	// Find the box's closest point to the sphere
 #if ANKI_SIMD_SSE
-	__m128 gt = _mm_cmpgt_ps(c.getSimd(), aabb.getMax().getSimd());
-	__m128 lt = _mm_cmplt_ps(c.getSimd(), aabb.getMin().getSimd());
+	__m128 gt = _mm_cmpgt_ps(c.m_simd, aabb.getMax().m_simd);
+	__m128 lt = _mm_cmplt_ps(c.m_simd, aabb.getMin().m_simd);
 
-	__m128 m = _mm_or_ps(_mm_and_ps(gt, aabb.getMax().getSimd()), _mm_andnot_ps(gt, c.getSimd()));
-	__m128 n = _mm_or_ps(_mm_and_ps(lt, aabb.getMin().getSimd()), _mm_andnot_ps(lt, m));
+	__m128 m = _mm_or_ps(_mm_and_ps(gt, aabb.getMax().m_simd), _mm_andnot_ps(gt, c.m_simd));
+	__m128 n = _mm_or_ps(_mm_and_ps(lt, aabb.getMin().m_simd), _mm_andnot_ps(lt, m));
 
 	const Vec4 cp(n);
 #else
 	Vec4 cp(c); // Closest Point
-	for(U i = 0; i < 3; i++)
+	for(U32 i = 0; i < 3; i++)
 	{
 		// if the center is greater than the max then the closest point is the max
 		if(c[i] > aabb.getMax()[i])
@@ -116,7 +116,7 @@ Bool testCollision(const Aabb& aabb, const LineSegment& ls)
 	F32 minT = kMaxF32;
 
 	// do tests against three sets of planes
-	for(U i = 0; i < 3; ++i)
+	for(U32 i = 0; i < 3; ++i)
 	{
 		// segment is parallel to plane
 		if(isZero(ls.getDirection()[i]))
@@ -242,10 +242,10 @@ Bool testCollision(const Obb& obb, const LineSegment& ls)
 	const Vec4 diff = obb.getCenter() - ls.getOrigin();
 
 	// for each axis do
-	for(U i = 0; i < 3; ++i)
+	for(U32 i = 0; i < 3; ++i)
 	{
 		// get axis i
-		const Vec4 axis = obb.getRotation().getColumn(i).xyz0();
+		const Vec4 axis = obb.getRotation().getColumn(i).xyz0;
 
 		// project relative vector onto axis
 		const F32 e = axis.dot(diff);
@@ -352,7 +352,7 @@ Bool testCollision(const Plane& plane, const Ray& ray, Vec4& intersection)
 
 Bool testCollision(const Plane& plane, const Vec4& vector, Vec4& intersection)
 {
-	ANKI_ASSERT(vector.w() == 0.0f);
+	ANKI_ASSERT(vector.w == 0.0f);
 	const Vec4 pp = vector.normalize();
 	const F32 dot = pp.dot(plane.getNormal());
 

+ 8 - 8
AnKi/Collision/FunctionsTestPlane.cpp

@@ -10,14 +10,14 @@ namespace anki {
 F32 testPlane(const Plane& plane, const Aabb& aabb)
 {
 #if ANKI_SIMD_SSE
-	__m128 gezero = _mm_cmpge_ps(plane.getNormal().getSimd(), _mm_setzero_ps());
+	__m128 gezero = _mm_cmpge_ps(plane.getNormal().m_simd, _mm_setzero_ps());
 
 	Vec4 diagMin;
-	diagMin.getSimd() = _mm_or_ps(_mm_and_ps(gezero, aabb.getMin().getSimd()), _mm_andnot_ps(gezero, aabb.getMax().getSimd()));
+	diagMin.m_simd = _mm_or_ps(_mm_and_ps(gezero, aabb.getMin().m_simd), _mm_andnot_ps(gezero, aabb.getMax().m_simd));
 #else
 	Vec4 diagMin(0.0f), diagMax(0.0f);
 	// set min/max values for x,y,z direction
-	for(U i = 0; i < 3; i++)
+	for(U32 i = 0; i < 3; i++)
 	{
 		if(plane.getNormal()[i] >= 0.0f)
 		{
@@ -33,7 +33,7 @@ F32 testPlane(const Plane& plane, const Aabb& aabb)
 #endif
 
 	// minimum on positive side of plane, box on positive side
-	ANKI_ASSERT(diagMin.w() == 0.0f);
+	ANKI_ASSERT(diagMin.w == 0.0f);
 	F32 test = testPlane(plane, diagMin);
 	if(test > 0.0f)
 	{
@@ -42,10 +42,10 @@ F32 testPlane(const Plane& plane, const Aabb& aabb)
 
 #if ANKI_SIMD_SSE
 	Vec4 diagMax;
-	diagMax.getSimd() = _mm_or_ps(_mm_and_ps(gezero, aabb.getMax().getSimd()), _mm_andnot_ps(gezero, aabb.getMin().getSimd()));
+	diagMax.m_simd = _mm_or_ps(_mm_and_ps(gezero, aabb.getMax().m_simd), _mm_andnot_ps(gezero, aabb.getMin().m_simd));
 #endif
 
-	ANKI_ASSERT(diagMax.w() == 0.0f);
+	ANKI_ASSERT(diagMax.w == 0.0f);
 	test = testPlane(plane, diagMax);
 	if(test >= 0.0f)
 	{
@@ -87,12 +87,12 @@ F32 testPlane(const Plane& plane, const Obb& obb)
 {
 	Mat3x4 transposedRotation = obb.getRotation();
 	transposedRotation.transposeRotationPart();
-	const Vec4 xNormal = (transposedRotation * plane.getNormal()).xyz0();
+	const Vec4 xNormal = (transposedRotation * plane.getNormal()).xyz0;
 
 	// maximum extent in direction of plane normal
 	const Vec4 rv = obb.getExtend() * xNormal;
 	const Vec4 rvabs = rv.abs();
-	const F32 r = rvabs.x() + rvabs.y() + rvabs.z();
+	const F32 r = rvabs.x + rvabs.y + rvabs.z;
 
 	// signed distance between box center and plane
 	const F32 d = testPlane(plane, obb.getCenter());

+ 1 - 1
AnKi/Collision/LineSegment.h

@@ -90,7 +90,7 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_origin.w() != 0.0f && m_dir.w() != 0.0f);
+		ANKI_ASSERT(m_origin.w != 0.0f && m_dir.w != 0.0f);
 	}
 };
 /// @}

+ 2 - 2
AnKi/Collision/Obb.cpp

@@ -92,8 +92,8 @@ void Obb::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize point
 		ANKI_ASSERT((ptrToNumber(ptr) + sizeof(Vec3) - ptrToNumber(pointBuffer)) <= buffSize);
 		const Vec3* pos = reinterpret_cast<const Vec3*>(ptr);
 
-		max = max.max(pos->xyz0());
-		min = min.min(pos->xyz0());
+		max = max.max(pos->xyz0);
+		min = min.min(pos->xyz0);
 
 		ptr += pointStride;
 	}

+ 1 - 1
AnKi/Collision/Obb.h

@@ -131,7 +131,7 @@ private:
 		ANKI_ASSERT(m_center != Vec4(kMaxF32));
 		ANKI_ASSERT(m_extend != Vec4(kMaxF32));
 		ANKI_ASSERT(m_rotation != Mat3x4(kMaxF32));
-		ANKI_ASSERT(m_center.w() == 0.0f && m_extend.w() == 0.0f);
+		ANKI_ASSERT(m_center.w == 0.0f && m_extend.w == 0.0f);
 	}
 };
 

+ 2 - 2
AnKi/Collision/Plane.cpp

@@ -9,7 +9,7 @@ namespace anki {
 
 void Plane::setFrom3Points(const Vec4& p0, const Vec4& p1, const Vec4& p2)
 {
-	ANKI_ASSERT(p0.w() == 0.0f && p1.w() == 0.0f && p2.w() == 0.0f);
+	ANKI_ASSERT(p0.w == 0.0f && p1.w == 0.0f && p2.w == 0.0f);
 
 	// get plane vectors
 	const Vec4 u = p1 - p0;
@@ -47,7 +47,7 @@ Plane Plane::getTransformed(const Transform& trf) const
 	rot.transposeRotationPart();
 	Vec4 newTrans(rot * trf.getOrigin(), 0.0f);
 	ANKI_ASSERT(trf.hasUniformScale());
-	plane.m_offset = m_offset * trf.getScale().x() + newTrans.dot(m_normal);
+	plane.m_offset = m_offset * trf.getScale().x + newTrans.dot(m_normal);
 
 	return plane;
 }

+ 2 - 2
AnKi/Collision/Plane.h

@@ -88,7 +88,7 @@ public:
 	// Set the plane from a point in plane and a direction
 	void setFromRay(Vec3 rayOrigin, Vec3 rayDir)
 	{
-		m_normal = rayDir.xyz0();
+		m_normal = rayDir.xyz0;
 		m_offset = rayDir.dot(rayOrigin);
 	}
 
@@ -110,7 +110,7 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_normal.w() == 0.0f);
+		ANKI_ASSERT(m_normal.w == 0.0f);
 		ANKI_ASSERT(m_offset != kMaxF32);
 	}
 };

+ 5 - 5
AnKi/Collision/Ray.h

@@ -32,8 +32,8 @@ public:
 	}
 
 	Ray(const Vec3& origin, const Vec3& dir)
-		: m_origin(origin.xyz0())
-		, m_dir(dir.xyz0())
+		: m_origin(origin.xyz0)
+		, m_dir(dir.xyz0)
 	{
 		check();
 	}
@@ -59,7 +59,7 @@ public:
 
 	void setOrigin(const Vec3& origin)
 	{
-		m_origin = origin.xyz0();
+		m_origin = origin.xyz0;
 	}
 
 	[[nodiscard]] const Vec4& getOrigin() const
@@ -75,7 +75,7 @@ public:
 
 	void setDirection(const Vec3& dir)
 	{
-		m_dir = dir.xyz0();
+		m_dir = dir.xyz0;
 	}
 
 	[[nodiscard]] const Vec4& getDirection() const
@@ -108,7 +108,7 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_origin.w() == 0.0f && m_dir.w() == 0.0f && isZero(m_dir.lengthSquared() - 1.0f, kEpsilonf * 100.0f));
+		ANKI_ASSERT(m_origin.w == 0.0f && m_dir.w == 0.0f && isZero(m_dir.lengthSquared() - 1.0f, kEpsilonf * 100.0f));
 	}
 };
 /// @}

+ 1 - 1
AnKi/Collision/Sphere.cpp

@@ -43,7 +43,7 @@ void Sphere::setFromPointCloud(const Vec3* pointBuffer, U pointCount, PtrSize po
 		while(pointCount-- != 0)
 		{
 			ANKI_ASSERT((ptrToNumber(ptr) + sizeof(Vec3) - ptrToNumber(pointBuffer)) <= buffSize);
-			const Vec4 pos = (*reinterpret_cast<const Vec3*>(ptr)).xyz0();
+			const Vec4 pos = (*reinterpret_cast<const Vec3*>(ptr)).xyz0;
 
 			max = max.max(pos);
 			min = min.min(pos);

+ 5 - 5
AnKi/Collision/Sphere.h

@@ -39,7 +39,7 @@ public:
 
 	/// Constructor
 	Sphere(const Vec3& center, F32 radius)
-		: m_center(center.xyz0())
+		: m_center(center.xyz0)
 		, m_radius(radius)
 	{
 		check();
@@ -67,13 +67,13 @@ public:
 
 	void setCenter(const Vec4& x)
 	{
-		ANKI_ASSERT(x.w() == 0.0f);
+		ANKI_ASSERT(x.w == 0.0f);
 		m_center = x;
 	}
 
 	void setCenter(const Vec3& x)
 	{
-		m_center = x.xyz0();
+		m_center = x.xyz0;
 	}
 
 	F32 getRadius() const
@@ -97,7 +97,7 @@ public:
 		Sphere out;
 		out.m_center = transform.transform(m_center);
 		ANKI_ASSERT(transform.hasUniformScale());
-		out.m_radius = m_radius * transform.getScale().x();
+		out.m_radius = m_radius * transform.getScale().x;
 		return out;
 	}
 
@@ -126,7 +126,7 @@ private:
 
 	void check() const
 	{
-		ANKI_ASSERT(m_center.w() == 0.0f);
+		ANKI_ASSERT(m_center.w == 0.0f);
 		ANKI_ASSERT(m_radius > 0.0f);
 	}
 };

+ 30 - 30
AnKi/Editor/EditorUi.cpp

@@ -53,11 +53,11 @@ static F32 projectNdcToRay(Vec2 ndc, Vec3 rayOrigin, Vec3 rayDir)
 	const Frustum& frustum = SceneGraph::getSingleton().getActiveCameraNode().getFirstComponentOfType<CameraComponent>().getFrustum();
 	const Mat4 invMvp = frustum.getViewProjectionMatrix().invert();
 
-	Vec4 v4 = frustum.getViewProjectionMatrix() * rayOrigin.xyz1();
-	const Vec2 rayOriginNdc = v4.xy() / v4.w();
+	Vec4 v4 = frustum.getViewProjectionMatrix() * rayOrigin.xyz1;
+	const Vec2 rayOriginNdc = v4.xy / v4.w;
 
-	v4 = frustum.getViewProjectionMatrix() * (rayOrigin + rayDir).xyz1();
-	const Vec2 rayDirNdc = (v4.xy() / v4.w() - rayOriginNdc).normalize();
+	v4 = frustum.getViewProjectionMatrix() * (rayOrigin + rayDir).xyz1;
+	const Vec2 rayDirNdc = (v4.xy / v4.w - rayOriginNdc).normalize();
 
 	const Vec2 disiredPosNdc = ndc.projectTo(rayOriginNdc, rayDirNdc);
 	const Bool positiveSizeOfAxis = (disiredPosNdc - rayOriginNdc).dot(rayDirNdc) > 0.0f;
@@ -67,8 +67,8 @@ static F32 projectNdcToRay(Vec2 ndc, Vec3 rayOrigin, Vec3 rayDir)
 
 	// Create line 0 which is built from the camera origin and a far point that was unprojected from NDC
 	v4 = invMvp * Vec4(disiredPosNdc, 1.0f, 1.0f);
-	const Vec3 a0 = v4.xyz() / v4.w();
-	const Vec3 b0 = frustum.getWorldTransform().getOrigin().xyz() - a0;
+	const Vec3 a0 = v4.xyz / v4.w;
+	const Vec3 b0 = frustum.getWorldTransform().getOrigin().xyz - a0;
 
 	// Line 1 is built from the ray
 	const Vec3 a1 = rayOrigin;
@@ -98,17 +98,17 @@ static Bool projectNdcToPlane(Vec2 ndc, Plane plane, Vec3& point)
 	const Mat4 invMvp = frustum.getViewProjectionMatrix().invert();
 
 	Vec4 v4 = invMvp * Vec4(ndc, 1.0f, 1.0f);
-	v4 /= v4.w();
+	v4 /= v4.w;
 
-	const Vec3 rayOrigin = frustum.getWorldTransform().getOrigin().xyz();
-	const Vec3 rayDir = (v4.xyz() - rayOrigin).normalize();
+	const Vec3 rayOrigin = frustum.getWorldTransform().getOrigin().xyz;
+	const Vec3 rayDir = (v4.xyz - rayOrigin).normalize();
 
 	Vec4 collisionPoint;
 	const Bool collides = testCollision(plane, Ray(rayOrigin, rayDir), collisionPoint);
 
 	if(collides)
 	{
-		point = collisionPoint.xyz();
+		point = collisionPoint.xyz;
 	}
 
 	return collides;
@@ -257,7 +257,7 @@ void EditorUi::draw(UiCanvas& canvas)
 
 	{
 		const Vec2 viewportSize = ImGui::GetMainViewport()->WorkSize;
-		const Vec2 initialSize = Vec2(viewportSize.y() * 0.75f);
+		const Vec2 initialSize = Vec2(viewportSize.y * 0.75f);
 		const Vec2 initialPos = (viewportSize - initialSize) / 2.0f;
 
 		m_imageViewer.drawWindow(canvas, initialPos, initialSize, 0);
@@ -403,7 +403,7 @@ void EditorUi::mainMenu()
 				const Vec2 textSize = ImGui::CalcTextSize(text);
 
 				const F32 menuBarWidth = ImGui::GetWindowWidth();
-				ImGui::SameLine(menuBarWidth - textSize.x() - ImGui::GetStyle().FramePadding.x * 2.0f - kMargin);
+				ImGui::SameLine(menuBarWidth - textSize.x - ImGui::GetStyle().FramePadding.x * 2.0f - kMargin);
 
 				ImGui::PushStyleColor(ImGuiCol_ButtonHovered, Vec4(1.0f, 0.0f, 0.0f, 1.0f));
 
@@ -538,7 +538,7 @@ void EditorUi::sceneHierarchyWindow()
 		const Vec2 viewportSize = ImGui::GetMainViewport()->WorkSize;
 		const Vec2 viewportPos = ImGui::GetMainViewport()->WorkPos;
 		ImGui::SetNextWindowPos(viewportPos, ImGuiCond_FirstUseEver);
-		ImGui::SetNextWindowSize(Vec2(400.0f, viewportSize.y() - kConsoleHeight), ImGuiCond_FirstUseEver);
+		ImGui::SetNextWindowSize(Vec2(400.0f, viewportSize.y - kConsoleHeight), ImGuiCond_FirstUseEver);
 	}
 
 	if(ImGui::Begin("Scene Hierarchy", &m_showSceneHierarcyWindow, ImGuiWindowFlags_NoCollapse))
@@ -580,8 +580,8 @@ void EditorUi::sceneNodePropertiesWindow()
 		const Vec2 viewportSize = ImGui::GetMainViewport()->WorkSize;
 		const Vec2 viewportPos = ImGui::GetMainViewport()->WorkPos;
 		const F32 initialWidth = 500.0f;
-		ImGui::SetNextWindowPos(Vec2(viewportSize.x() - initialWidth, viewportPos.y()), ImGuiCond_FirstUseEver);
-		ImGui::SetNextWindowSize(Vec2(initialWidth, viewportSize.y() - kConsoleHeight), ImGuiCond_FirstUseEver);
+		ImGui::SetNextWindowPos(Vec2(viewportSize.x - initialWidth, viewportPos.y), ImGuiCond_FirstUseEver);
+		ImGui::SetNextWindowSize(Vec2(initialWidth, viewportSize.y - kConsoleHeight), ImGuiCond_FirstUseEver);
 	}
 
 	if(ImGui::Begin("SceneNode Props", &m_showSceneNodePropsWindow, ImGuiWindowFlags_NoCollapse) && m_sceneHierarchyWindow.m_selectedNode)
@@ -616,7 +616,7 @@ void EditorUi::sceneNodePropertiesWindow()
 		{
 			dummyButton(id++);
 
-			F32 localOrigin[3] = {node.getLocalOrigin().x(), node.getLocalOrigin().y(), node.getLocalOrigin().z()};
+			F32 localOrigin[3] = {node.getLocalOrigin().x, node.getLocalOrigin().y, node.getLocalOrigin().z};
 			if(ImGui::DragFloat3(ICON_MDI_AXIS_ARROW " Origin", localOrigin, 0.025f, -1000000.0f, 1000000.0f))
 			{
 				node.setLocalOrigin(Vec3(&localOrigin[0]));
@@ -634,7 +634,7 @@ void EditorUi::sceneNodePropertiesWindow()
 			ImGui::PopID();
 			ImGui::SameLine();
 
-			F32 localScale[3] = {node.getLocalScale().x(), node.getLocalScale().y(), node.getLocalScale().z()};
+			F32 localScale[3] = {node.getLocalScale().x, node.getLocalScale().y, node.getLocalScale().z};
 			if(ImGui::DragFloat3(ICON_MDI_ARROW_EXPAND_ALL " Scale", localScale, 0.0025f, 0.01f, 1000000.0f))
 			{
 				if(!state.m_uniformScale)
@@ -645,11 +645,11 @@ void EditorUi::sceneNodePropertiesWindow()
 				{
 					// The component that have changed wins
 					F32 scale = scale = localScale[2];
-					if(localScale[0] != node.getLocalScale().x())
+					if(localScale[0] != node.getLocalScale().x)
 					{
 						scale = localScale[0];
 					}
-					else if(localScale[1] != node.getLocalScale().y())
+					else if(localScale[1] != node.getLocalScale().y)
 					{
 						scale = localScale[1];
 					}
@@ -1286,7 +1286,7 @@ void EditorUi::cVarsWindow()
 	if(ImGui::GetFrameCount() > 1)
 	{
 		// Viewport is one frame delay so do that when frame >1
-		const Vec2 initialSize = Vec2(900.0f, m_canvas->getSizef().y() * 0.8f);
+		const Vec2 initialSize = Vec2(900.0f, m_canvas->getSizef().y * 0.8f);
 		ImGui::SetNextWindowSize(initialSize, ImGuiCond_FirstUseEver);
 		ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Once, Vec2(0.5f));
 	}
@@ -1407,7 +1407,7 @@ void EditorUi::debugRtsWindow()
 	if(ImGui::GetFrameCount() > 1)
 	{
 		// Viewport is one frame delay so do that when frame >1
-		const Vec2 initialSize = Vec2(450.0f, m_canvas->getSizef().y() * 0.4f);
+		const Vec2 initialSize = Vec2(450.0f, m_canvas->getSizef().y * 0.4f);
 		ImGui::SetNextWindowSize(initialSize, ImGuiCond_FirstUseEver);
 		ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Once, Vec2(0.5f));
 	}
@@ -1457,8 +1457,8 @@ void EditorUi::consoleWindow()
 		// Viewport is one frame delay so do that when frame >1
 		const Vec2 viewportSize = ImGui::GetMainViewport()->WorkSize;
 		const Vec2 viewportPos = ImGui::GetMainViewport()->WorkPos;
-		const Vec2 initialSize = Vec2(viewportSize.x() / 2.0f, kConsoleHeight);
-		const Vec2 initialPos = Vec2(0.0f, viewportPos.y() + viewportSize.y() - initialSize.y());
+		const Vec2 initialSize = Vec2(viewportSize.x / 2.0f, kConsoleHeight);
+		const Vec2 initialPos = Vec2(0.0f, viewportPos.y + viewportSize.y - initialSize.y);
 		ImGui::SetNextWindowSize(initialSize, ImGuiCond_FirstUseEver);
 		ImGui::SetNextWindowPos(initialPos, ImGuiCond_FirstUseEver);
 	}
@@ -1509,7 +1509,7 @@ void EditorUi::consoleWindow()
 							constexpr Array<Vec3, U(LoggerMessageType::kCount)> colors = {Vec3(0.074f, 0.631f, 0.054f), Vec3(0.074f, 0.354f, 0.631f),
 																						  Vec3(1.0f, 0.0f, 0.0f), Vec3(0.756f, 0.611f, 0.0f),
 																						  Vec3(1.0f, 0.0f, 0.0f)};
-							ImGui::PushStyleColor(ImGuiCol_Text, colors[logEntry.first].xyz1());
+							ImGui::PushStyleColor(ImGuiCol_Text, Vec4(colors[logEntry.first].xyz1));
 							ImGui::TextUnformatted(logEntry.second.cstr());
 							ImGui::PopStyleColor();
 						}
@@ -1593,8 +1593,8 @@ void EditorUi::assetsWindow()
 		// Viewport is one frame delay so do that when frame >1
 		const Vec2 viewportSize = ImGui::GetMainViewport()->WorkSize;
 		const Vec2 viewportPos = ImGui::GetMainViewport()->WorkPos;
-		const Vec2 initialSize = Vec2(viewportSize.x() / 2.0f, kConsoleHeight);
-		const Vec2 initialPos = Vec2(viewportSize.x() / 2.0f, viewportPos.y() + viewportSize.y() - initialSize.y());
+		const Vec2 initialSize = Vec2(viewportSize.x / 2.0f, kConsoleHeight);
+		const Vec2 initialPos = Vec2(viewportSize.x / 2.0f, viewportPos.y + viewportSize.y - initialSize.y);
 		ImGui::SetNextWindowSize(initialSize, ImGuiCond_FirstUseEver);
 		ImGui::SetNextWindowPos(initialPos, ImGuiCond_FirstUseEver);
 	}
@@ -1930,7 +1930,7 @@ void EditorUi::objectPicking()
 			// Clicked a gizmo
 
 			const Transform& nodeTrf = m_sceneHierarchyWindow.m_selectedNode->getLocalTransform();
-			const Vec3 nodeOrigin = nodeTrf.getOrigin().xyz();
+			const Vec3 nodeOrigin = nodeTrf.getOrigin().xyz;
 			Array<Vec3, 3> rotationAxis;
 			rotationAxis[0] = nodeTrf.getRotation().getXAxis();
 			rotationAxis[1] = nodeTrf.getRotation().getYAxis();
@@ -2007,7 +2007,7 @@ void EditorUi::objectPicking()
 			const U32 axis = m_objectPicking.m_translationAxisSelected;
 			const F32 moveDistance = projectNdcToRay(Input::getSingleton().getMousePositionNdc(), m_objectPicking.m_pivotPoint, rotationAxis[axis]);
 
-			const Vec3 oldPosition = nodeTrf.getOrigin().xyz();
+			const Vec3 oldPosition = nodeTrf.getOrigin().xyz;
 			Vec3 newPosition = oldPosition + rotationAxis[axis] * moveDistance;
 
 			// Snap position
@@ -2035,7 +2035,7 @@ void EditorUi::objectPicking()
 				newAxisScale = round(newAxisScale / m_toolbox.m_scaleTranslationSnapping) * m_toolbox.m_scaleTranslationSnapping;
 			}
 
-			Vec3 scale = nodeTrf.getScale().xyz();
+			Vec3 scale = nodeTrf.getScale().xyz;
 			scale[axis] = max(newAxisScale, m_toolbox.m_scaleTranslationSnapping);
 			m_sceneHierarchyWindow.m_selectedNode->setLocalScale(scale);
 
@@ -2046,7 +2046,7 @@ void EditorUi::objectPicking()
 		else if(m_objectPicking.m_rotationAxisSelected < 3)
 		{
 			const U32 axis = m_objectPicking.m_rotationAxisSelected;
-			const Vec3 nodeOrigin = nodeTrf.getOrigin().xyz();
+			const Vec3 nodeOrigin = nodeTrf.getOrigin().xyz;
 
 			// Compute the new pivot point
 			Plane axisPlane;

+ 10 - 10
AnKi/Editor/ImageViewerUi.cpp

@@ -178,7 +178,7 @@ void ImageViewerUi::drawWindow(UiCanvas& canvas, Vec2 initialPos, Vec2 initialSi
 			{
 				const Vec4 avgColor = (m_image) ? m_image->getAverageColor() : Vec4(0.0f);
 
-				ImGui::Text("Average Color %.2f %.2f %.2f %.2f", avgColor.x(), avgColor.y(), avgColor.z(), avgColor.w());
+				ImGui::Text("Average Color %.2f %.2f %.2f %.2f", avgColor.x, avgColor.y, avgColor.z, avgColor.w);
 				ImGui::SameLine();
 
 				ImGui::ColorButton("Average Color", avgColor);
@@ -211,10 +211,10 @@ void ImageViewerUi::drawWindow(UiCanvas& canvas, Vec2 initialPos, Vec2 initialSi
 					Vec4 m_colorScale;
 					Vec4 m_depth;
 				} pc;
-				pc.m_colorScale.x() = F32(m_colorChannel[0]) / m_maxColorValue;
-				pc.m_colorScale.y() = F32(m_colorChannel[1]) / m_maxColorValue;
-				pc.m_colorScale.z() = F32(m_colorChannel[2]) / m_maxColorValue;
-				pc.m_colorScale.w() = F32(m_colorChannel[3]);
+				pc.m_colorScale.x = F32(m_colorChannel[0]) / m_maxColorValue;
+				pc.m_colorScale.y = F32(m_colorChannel[1]) / m_maxColorValue;
+				pc.m_colorScale.z = F32(m_colorChannel[2]) / m_maxColorValue;
+				pc.m_colorScale.w = F32(m_colorChannel[3]);
 
 				pc.m_depth = Vec4((m_depth + 0.5f) / F32(tex.getDepth()));
 
@@ -247,7 +247,7 @@ void ImageViewerUi::drawWindow(UiCanvas& canvas, Vec2 initialPos, Vec2 initialSi
 						{
 							auto toWindow = [&](Vec2 in) {
 								in = in * 0.5f + 0.5f;
-								in.y() = 1.0f - in.y();
+								in.y = 1.0f - in.y;
 								in *= canvas.getSizef();
 								return in;
 							};
@@ -255,14 +255,14 @@ void ImageViewerUi::drawWindow(UiCanvas& canvas, Vec2 initialPos, Vec2 initialSi
 							const Vec2 delta =
 								toWindow(Input::getSingleton().getMousePositionNdc()) - toWindow(Input::getSingleton().getMousePreviousPositionNdc());
 
-							if(delta.x() != 0.0f)
+							if(delta.x != 0.0f)
 							{
-								ImGui::SetScrollX(ImGui::GetScrollX() - delta.x());
+								ImGui::SetScrollX(ImGui::GetScrollX() - delta.x);
 							}
 
-							if(delta.y() != 0.0f)
+							if(delta.y != 0.0f)
 							{
-								ImGui::SetScrollY(ImGui::GetScrollY() - delta.y());
+								ImGui::SetScrollY(ImGui::GetScrollY() - delta.y);
 							}
 						}
 					}

+ 2 - 2
AnKi/Gr/BackendCommon/Functions.cpp

@@ -60,11 +60,11 @@ static void writeShaderBlockMemoryMatrix(const ShaderVariableBlockInfo& varBlkIn
 	ANKI_ASSERT(varBlkInfo.m_matrixStride >= static_cast<I16>(sizeof(Vec)));
 
 	U8* buff = static_cast<U8*>(buffBegin) + varBlkInfo.m_offset;
-	for(U i = 0; i < elementsCount; i++)
+	for(U32 i = 0; i < elementsCount; i++)
 	{
 		U8* subbuff = buff;
 		const T& matrix = static_cast<const T*>(elements)[i];
-		for(U j = 0; j < sizeof(T) / sizeof(Vec); j++)
+		for(U32 j = 0; j < sizeof(T) / sizeof(Vec); j++)
 		{
 			ANKI_ASSERT((subbuff + sizeof(Vec)) <= static_cast<const U8*>(buffEnd));
 

+ 1 - 1
AnKi/Gr/D3D/D3DCommandBuffer.cpp

@@ -1004,7 +1004,7 @@ void CommandBuffer::pushDebugMarker(CString name, Vec3 color)
 	if(self.m_debugMarkersEnabled)
 	{
 		const U8Vec3 coloru(color * 255.0f);
-		const U32 val = PIX_COLOR(coloru.x(), coloru.y(), coloru.z());
+		const U32 val = PIX_COLOR(coloru.x, coloru.y, coloru.z);
 
 		PIXBeginEvent(self.m_cmdList, val, "%s", name.cstr());
 	}

+ 2 - 2
AnKi/Gr/D3D/D3DShaderProgram.cpp

@@ -204,8 +204,8 @@ Error ShaderProgramImpl::init(const ShaderProgramInitInfo& inf)
 			CD3DX12_BROADCASTING_LAUNCH_NODE_OVERRIDES* spec = wgSubObj->CreateBroadcastingLaunchNodeOverrides(nodeNames[i].getBegin());
 
 			ANKI_ASSERT(specialization.m_maxNodeDispatchGrid > UVec3(0u));
-			spec->MaxDispatchGrid(specialization.m_maxNodeDispatchGrid.x(), specialization.m_maxNodeDispatchGrid.y(),
-								  specialization.m_maxNodeDispatchGrid.z());
+			spec->MaxDispatchGrid(specialization.m_maxNodeDispatchGrid.x, specialization.m_maxNodeDispatchGrid.y,
+								  specialization.m_maxNodeDispatchGrid.z);
 		}
 
 		// Create state obj

+ 4 - 4
AnKi/Gr/Vulkan/VkCommandBuffer.cpp

@@ -924,11 +924,11 @@ void CommandBuffer::upscale(GrUpscaler* upscaler, const TextureView& inColor, co
 	vkDlssEvalParams.pInDepth = &depthResVk;
 	vkDlssEvalParams.pInMotionVectors = &mvResVk;
 	vkDlssEvalParams.pInExposureTexture = &exposureResVk;
-	vkDlssEvalParams.InJitterOffsetX = jitterOffset.x();
-	vkDlssEvalParams.InJitterOffsetY = jitterOffset.y();
+	vkDlssEvalParams.InJitterOffsetX = jitterOffset.x;
+	vkDlssEvalParams.InJitterOffsetY = jitterOffset.y;
 	vkDlssEvalParams.InReset = resetAccumulation;
-	vkDlssEvalParams.InMVScaleX = motionVectorsScale.x();
-	vkDlssEvalParams.InMVScaleY = motionVectorsScale.y();
+	vkDlssEvalParams.InMVScaleX = motionVectorsScale.x;
+	vkDlssEvalParams.InMVScaleY = motionVectorsScale.y;
 	vkDlssEvalParams.InColorSubrectBase = renderingOffset;
 	vkDlssEvalParams.InDepthSubrectBase = renderingOffset;
 	vkDlssEvalParams.InTranslucencySubrectBase = renderingOffset;

+ 8 - 9
AnKi/Gr/Vulkan/VkGrUpscaler.cpp

@@ -124,21 +124,20 @@ Error GrUpscalerImpl::createDlssFeature(const UVec2& srcRes, const UVec2& dstRes
 {
 	NVSDK_NGX_PerfQuality_Value nvQuality = getDlssQualityModeToNVQualityMode(quality);
 	F32 sharpness; // Deprecared in newer DLSS
-	ANKI_NGX_CHECK(
-		NGX_DLSS_GET_OPTIMAL_SETTINGS(m_ngxParameters, dstRes.x(), dstRes.y(), nvQuality, &m_recommendedSettings.m_optimalRenderSize.x(),
-									  &m_recommendedSettings.m_optimalRenderSize.y(), &m_recommendedSettings.m_dynamicMaximumRenderSize.x(),
-									  &m_recommendedSettings.m_dynamicMaximumRenderSize.y(), &m_recommendedSettings.m_dynamicMinimumRenderSize.x(),
-									  &m_recommendedSettings.m_dynamicMinimumRenderSize.y(), &sharpness));
+	ANKI_NGX_CHECK(NGX_DLSS_GET_OPTIMAL_SETTINGS(
+		m_ngxParameters, dstRes.x, dstRes.y, nvQuality, &m_recommendedSettings.m_optimalRenderSize.x, &m_recommendedSettings.m_optimalRenderSize.y,
+		&m_recommendedSettings.m_dynamicMaximumRenderSize.x, &m_recommendedSettings.m_dynamicMaximumRenderSize.y,
+		&m_recommendedSettings.m_dynamicMinimumRenderSize.x, &m_recommendedSettings.m_dynamicMinimumRenderSize.y, &sharpness));
 
 	// Next create features	(See NVSDK_NGX_DLSS_Feature_Flags in nvsdk_ngx_defs.h)
 	const I32 dlssCreateFeatureFlags = NVSDK_NGX_DLSS_Feature_Flags_MVLowRes | NVSDK_NGX_DLSS_Feature_Flags_IsHDR; // TODO
 
 	NVSDK_NGX_DLSS_Create_Params dlssCreateParams;
 	memset(&dlssCreateParams, 0, sizeof(dlssCreateParams));
-	dlssCreateParams.Feature.InWidth = srcRes.x();
-	dlssCreateParams.Feature.InHeight = srcRes.y();
-	dlssCreateParams.Feature.InTargetWidth = dstRes.x();
-	dlssCreateParams.Feature.InTargetHeight = dstRes.y();
+	dlssCreateParams.Feature.InWidth = srcRes.x;
+	dlssCreateParams.Feature.InHeight = srcRes.y;
+	dlssCreateParams.Feature.InTargetWidth = dstRes.x;
+	dlssCreateParams.Feature.InTargetHeight = dstRes.y;
 	dlssCreateParams.Feature.InPerfQualityValue = nvQuality;
 	dlssCreateParams.InFeatureCreateFlags = dlssCreateFeatureFlags;
 

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

@@ -132,14 +132,14 @@ void GraphicsPipelineFactory::flushState(GraphicsStateTracker& state, VkCommandB
 	{
 		ANKI_ASSERT(dynState.m_viewport[2] != 0 && dynState.m_viewport[3] != 0);
 		dynState.m_viewportDirty = false;
-		const VkViewport vp = computeViewport(dynState.m_viewport.getBegin(), state.m_rtsSize.x(), state.m_rtsSize.y());
+		const VkViewport vp = computeViewport(dynState.m_viewport.getBegin(), state.m_rtsSize.x, state.m_rtsSize.y);
 		vkCmdSetViewport(cmdb, 0, 1, &vp);
 	}
 
 	if(dynState.m_scissorDirty)
 	{
 		dynState.m_scissorDirty = false;
-		const VkRect2D rect = computeScissor(dynState.m_scissor.getBegin(), state.m_rtsSize.x(), state.m_rtsSize.y());
+		const VkRect2D rect = computeScissor(dynState.m_scissor.getBegin(), state.m_rtsSize.x, state.m_rtsSize.y);
 		vkCmdSetScissor(cmdb, 0, 1, &rect);
 	}
 

+ 20 - 20
AnKi/Importer/GltfImporter.cpp

@@ -25,7 +25,7 @@ static F32 computeLightRadius(const Vec3 color)
 {
 	// Based on the attenuation equation: att = 1 - fragLightDist^2 / lightRadius^2
 	const F32 minAtt = 0.01f;
-	const F32 maxIntensity = max(max(color.x(), color.y()), color.z());
+	const F32 maxIntensity = max(max(color.x, color.y), color.z);
 	return sqrt(maxIntensity / minAtt);
 }
 
@@ -34,9 +34,9 @@ static Error getUniformScale(const Mat4& m, F32& out)
 {
 	const F32 SCALE_THRESHOLD = 0.01f; // 1 cm
 
-	Vec3 xAxis = m.getColumn(0).xyz();
-	Vec3 yAxis = m.getColumn(1).xyz();
-	Vec3 zAxis = m.getColumn(2).xyz();
+	Vec3 xAxis = m.getColumn(0).xyz;
+	Vec3 yAxis = m.getColumn(1).xyz;
+	Vec3 zAxis = m.getColumn(2).xyz;
 
 	const F32 scale = xAxis.getLength();
 	if(absolute(scale - yAxis.getLength()) > SCALE_THRESHOLD || absolute(scale - zAxis.getLength()) > SCALE_THRESHOLD)
@@ -52,9 +52,9 @@ static Error getUniformScale(const Mat4& m, F32& out)
 
 static void removeScale(Mat4& m)
 {
-	Vec3 xAxis = m.getColumn(0).xyz();
-	Vec3 yAxis = m.getColumn(1).xyz();
-	Vec3 zAxis = m.getColumn(2).xyz();
+	Vec3 xAxis = m.getColumn(0).xyz;
+	Vec3 yAxis = m.getColumn(1).xyz;
+	Vec3 zAxis = m.getColumn(2).xyz;
 
 	xAxis = xAxis.normalize();
 	yAxis = yAxis.normalize();
@@ -71,15 +71,15 @@ static void getNodeTransform(const cgltf_node& node, Vec3& tsl, Mat3& rot, Vec3&
 	{
 		Mat4 trf = Mat4(node.matrix);
 
-		Vec3 xAxis = trf.getColumn(0).xyz();
-		Vec3 yAxis = trf.getColumn(1).xyz();
-		Vec3 zAxis = trf.getColumn(2).xyz();
+		Vec3 xAxis = trf.getColumn(0).xyz;
+		Vec3 yAxis = trf.getColumn(1).xyz;
+		Vec3 zAxis = trf.getColumn(2).xyz;
 
 		scale = Vec3(xAxis.length(), yAxis.length(), zAxis.length());
 
 		removeScale(trf);
 		rot = trf.getRotationPart();
-		tsl = trf.getTranslationPart().xyz();
+		tsl = trf.getTranslationPart().xyz;
 	}
 	else
 	{
@@ -122,7 +122,7 @@ static Error getNodeTransform(const cgltf_node& node, Transform& trf)
 	Vec3 scale;
 	getNodeTransform(node, tsl, rot, scale);
 
-	trf.setOrigin(tsl.xyz0());
+	trf.setOrigin(tsl.xyz0);
 	trf.setRotation(Mat3x4(Vec3(0.0f), rot));
 	trf.setScale(scale);
 
@@ -690,7 +690,7 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 			if(extraFound)
 			{
 				ANKI_CHECK(
-					m_sceneFile.writeTextf("comp:setSolidColor(Vec3.new(%f, %f, %f))\n", extraValueVec3.x(), extraValueVec3.y(), extraValueVec3.z()));
+					m_sceneFile.writeTextf("comp:setSolidColor(Vec3.new(%f, %f, %f))\n", extraValueVec3.x, extraValueVec3.y, extraValueVec3.z));
 			}
 
 			ANKI_CHECK(getExtra(extras, "skybox_image", extraValueStr, extraFound));
@@ -703,7 +703,7 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 			if(extraFound)
 			{
 				ANKI_CHECK(
-					m_sceneFile.writeTextf("comp:setImageScale(Vec3.new(%f, %f, %f))\n", extraValueVec3.x(), extraValueVec3.y(), extraValueVec3.z()));
+					m_sceneFile.writeTextf("comp:setImageScale(Vec3.new(%f, %f, %f))\n", extraValueVec3.x, extraValueVec3.y, extraValueVec3.z));
 			}
 
 			ANKI_CHECK(getExtra(extras, "fog_min_density", extraValuef, extraFound));
@@ -733,8 +733,8 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 			ANKI_CHECK(getExtra(extras, "fog_diffuse_color", extraValueVec3, extraFound));
 			if(extraFound)
 			{
-				ANKI_CHECK(m_sceneFile.writeTextf("comp:setFogDiffuseColor(Vec3.new(%f, %f, %f))\n", extraValueVec3.x(), extraValueVec3.y(),
-												  extraValueVec3.z()));
+				ANKI_CHECK(
+					m_sceneFile.writeTextf("comp:setFogDiffuseColor(Vec3.new(%f, %f, %f))\n", extraValueVec3.x, extraValueVec3.y, extraValueVec3.z));
 			}
 
 			ANKI_CHECK(getExtra(extras, "skybox_generated", extraValueBool, extraFound));
@@ -891,7 +891,7 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 		Mat3 rot;
 		Vec3 scale;
 		getNodeTransform(node, tsl, rot, scale);
-		nodeTrf = Transform(tsl.xyz0(), Mat3x4(Vec3(0.0f), rot), scale.xyz0());
+		nodeTrf = Transform(tsl.xyz0, Mat3x4(Vec3(0.0f), rot), scale.xyz0);
 	}
 	for(cgltf_node* const* c = node.children; c < node.children + node.children_count; ++c)
 	{
@@ -904,7 +904,7 @@ Error GltfImporter::visitNode(const cgltf_node& node, const Transform& parentTrf
 Error GltfImporter::writeTransform(const Transform& trf)
 {
 	ANKI_CHECK(m_sceneFile.writeText("trf = Transform.new()\n"));
-	ANKI_CHECK(m_sceneFile.writeTextf("trf:setOrigin(Vec3.new(%f, %f, %f))\n", trf.getOrigin().x(), trf.getOrigin().y(), trf.getOrigin().z()));
+	ANKI_CHECK(m_sceneFile.writeTextf("trf:setOrigin(Vec3.new(%f, %f, %f))\n", trf.getOrigin().x, trf.getOrigin().y, trf.getOrigin().z));
 
 	ANKI_CHECK(m_sceneFile.writeText("rot = Mat3.new()\n"));
 	ANKI_CHECK(m_sceneFile.writeText("rot:setAll("));
@@ -914,7 +914,7 @@ Error GltfImporter::writeTransform(const Transform& trf)
 	}
 	ANKI_CHECK(m_sceneFile.writeText("trf:setRotation(rot)\n"));
 
-	ANKI_CHECK(m_sceneFile.writeTextf("trf:setScale(Vec3.new(%f, %f, %f))\n", trf.getScale().x(), trf.getScale().y(), trf.getScale().z()));
+	ANKI_CHECK(m_sceneFile.writeTextf("trf:setScale(Vec3.new(%f, %f, %f))\n", trf.getScale().x, trf.getScale().y, trf.getScale().z));
 
 	ANKI_CHECK(m_sceneFile.writeText("node:setLocalTransform(trf)\n"));
 
@@ -1021,7 +1021,7 @@ Error GltfImporter::writeLight(const cgltf_node& node, const ImporterHashMap<CSt
 	Vec3 color(light.color[0], light.color[1], light.color[2]);
 	color *= light.intensity;
 	color *= m_lightIntensityScale;
-	ANKI_CHECK(m_sceneFile.writeTextf("lcomp:setDiffuseColor(Vec4.new(%f, %f, %f, 1))\n", color.x(), color.y(), color.z()));
+	ANKI_CHECK(m_sceneFile.writeTextf("lcomp:setDiffuseColor(Vec4.new(%f, %f, %f, 1))\n", color.x, color.y, color.z));
 
 	auto shadow = extras.find("shadow");
 	if(shadow != extras.getEnd())

+ 3 - 4
AnKi/Importer/GltfImporterAnimation.cpp

@@ -184,7 +184,7 @@ Error GltfImporter::writeAnimation(const cgltf_animation& anim)
 			{
 				GltfAnimKey<Vec3> key;
 				key.m_time = keys[i];
-				key.m_value = Vec3(positions[i].x(), positions[i].y(), positions[i].z());
+				key.m_value = Vec3(positions[i].x, positions[i].y, positions[i].z);
 
 				tempChannels[channelCount].m_positions.emplaceBack(key);
 			}
@@ -238,7 +238,7 @@ Error GltfImporter::writeAnimation(const cgltf_animation& anim)
 
 				if(!scaleErrorReported && (absolute(scale[0] - scale[1]) > scaleEpsilon || absolute(scale[0] - scale[2]) > scaleEpsilon))
 				{
-					ANKI_IMPORTER_LOGW("Expecting uniform scale (%f %f %f)", scales[i].x(), scales[i].y(), scales[i].z());
+					ANKI_IMPORTER_LOGW("Expecting uniform scale (%f %f %f)", scales[i].x, scales[i].y, scales[i].z);
 					scaleErrorReported = true;
 				}
 
@@ -317,8 +317,7 @@ Error GltfImporter::writeAnimation(const cgltf_animation& anim)
 			ANKI_CHECK(file.writeText("\t\t\t<positionKeys>\n"));
 			for(const GltfAnimKey<Vec3>& key : channel.m_positions)
 			{
-				ANKI_CHECK(
-					file.writeTextf("\t\t\t\t<key time=\"%f\">%f %f %f</key>\n", key.m_time, key.m_value.x(), key.m_value.y(), key.m_value.z()));
+				ANKI_CHECK(file.writeTextf("\t\t\t\t<key time=\"%f\">%f %f %f</key>\n", key.m_time, key.m_value.x, key.m_value.y, key.m_value.z));
 			}
 			ANKI_CHECK(file.writeText("\t\t\t</positionKeys>\n"));
 		}

+ 8 - 8
AnKi/Importer/GltfImporterMaterial.cpp

@@ -185,7 +185,7 @@ Error GltfImporter::writeMaterialInternal(const cgltf_material& mtl, Bool writeR
 		Vec4 constantColor;
 		ANKI_CHECK(findConstantColorsInImage(fname, constantColor));
 
-		const Bool constantAlpha = constantColor.w() >= 0.0f;
+		const Bool constantAlpha = constantColor.w >= 0.0f;
 		xml.replaceAll("%alphaTestMutator%", (constantAlpha) ? "0" : "1");
 
 		if(m_importTextures)
@@ -222,11 +222,11 @@ Error GltfImporter::writeMaterialInternal(const cgltf_material& mtl, Bool writeR
 			}
 
 			auto token = tokens.getBegin();
-			ANKI_CHECK(token->toNumber(specular.x()));
+			ANKI_CHECK(token->toNumber(specular.x));
 			++token;
-			ANKI_CHECK(token->toNumber(specular.y()));
+			ANKI_CHECK(token->toNumber(specular.y));
 			++token;
-			ANKI_CHECK(token->toNumber(specular.z()));
+			ANKI_CHECK(token->toNumber(specular.z));
 		}
 		else
 		{
@@ -234,7 +234,7 @@ Error GltfImporter::writeMaterialInternal(const cgltf_material& mtl, Bool writeR
 		}
 
 		xml.replaceAll("%spec%",
-					   ImporterString().sprintf("<input name=\"m_specularScale\" value=\"%f %f %f\"/>", specular.x(), specular.y(), specular.z()));
+					   ImporterString().sprintf("<input name=\"m_specularScale\" value=\"%f %f %f\"/>", specular.x, specular.y, specular.z));
 
 		xml.replaceAll("%specTexMutator%", "0");
 	}
@@ -272,8 +272,8 @@ Error GltfImporter::writeMaterialInternal(const cgltf_material& mtl, Bool writeR
 
 		Vec4 constantColor;
 		ANKI_CHECK(findConstantColorsInImage(fname, constantColor));
-		constantRoughness = constantColor.y();
-		constantMetaliness = constantColor.z();
+		constantRoughness = constantColor.y;
+		constantMetaliness = constantColor.z;
 	}
 
 	// Roughness/metallic
@@ -320,7 +320,7 @@ Error GltfImporter::writeMaterialInternal(const cgltf_material& mtl, Bool writeR
 	{
 		Vec4 constantColor;
 		ANKI_CHECK(findConstantColorsInImage(getTextureUri(mtl.normal_texture).cstr(), constantColor));
-		if(constantColor.xyz() == -1.0f)
+		if(constantColor.xyz == -1.0f)
 		{
 			ImporterString uri;
 			uri.sprintf("%s%s", m_texrpath.cstr(), getTextureUri(mtl.normal_texture).cstr());

+ 15 - 15
AnKi/Importer/GltfImporterMesh.cpp

@@ -189,7 +189,7 @@ static void optimizeSubmesh(SubMesh& submesh)
 		ImporterDynamicArray<U32> newIdxArray;
 		newIdxArray.resize(submesh.m_indices.getSize(), 0);
 
-		meshopt_optimizeOverdraw(&newIdxArray[0], &submesh.m_indices[0], submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x(),
+		meshopt_optimizeOverdraw(&newIdxArray[0], &submesh.m_indices[0], submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x,
 								 submesh.m_verts.getSize(), vertSize, 1.05f);
 
 		submesh.m_indices = std::move(newIdxArray);
@@ -228,7 +228,7 @@ static void decimateSubmesh(F32 factor, SubMesh& submesh)
 	// Decimate
 	ImporterDynamicArray<U32> newIndices;
 	newIndices.resize(submesh.m_indices.getSize());
-	newIndices.resize(U32(meshopt_simplify(&newIndices[0], &submesh.m_indices[0], submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x(),
+	newIndices.resize(U32(meshopt_simplify(&newIndices[0], &submesh.m_indices[0], submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x,
 										   submesh.m_verts.getSize(), sizeof(TempVertex), targetIndexCount, 1e-2f)));
 
 	// Re-pack
@@ -317,13 +317,13 @@ static Bool isConvex(const ImporterList<SubMesh>& submeshes)
 			}
 
 			// Check that all positions are behind the plane
-			const Plane plane(v0.xyz0(), v1.xyz0(), v2.xyz0());
+			const Plane plane(v0.xyz0, v1.xyz0, v2.xyz0);
 
 			for(const SubMesh& submeshB : submeshes)
 			{
 				for(const TempVertex& vertB : submeshB.m_verts)
 				{
-					const F32 test = testPlane(plane, vertB.m_position.xyz0());
+					const F32 test = testPlane(plane, vertB.m_position.xyz0);
 					if(test > kEpsilonf)
 					{
 						convex = false;
@@ -365,7 +365,7 @@ static void generateMeshlets(SubMesh& submesh)
 	constexpr F32 coneWeight = 0.0f;
 	const U32 meshletCount =
 		U32(meshopt_buildMeshlets(meshlets.getBegin(), indicesToVertexBuffer.getBegin(), localIndices.getBegin(), submesh.m_indices.getBegin(),
-								  submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x(), submesh.m_verts.getSize(), sizeof(TempVertex),
+								  submesh.m_indices.getSize(), &submesh.m_verts[0].m_position.x, submesh.m_verts.getSize(), sizeof(TempVertex),
 								  kMaxVerticesPerMeshlet, kMaxPrimitivesPerMeshlet, coneWeight));
 
 	// Trim the arrays
@@ -436,7 +436,7 @@ static void generateMeshlets(SubMesh& submesh)
 		// Compute bounds
 		const meshopt_Bounds bounds =
 			meshopt_computeMeshletBounds(&indicesToVertexBuffer[inMeshlet.vertex_offset], &localIndices[inMeshlet.triangle_offset],
-										 inMeshlet.triangle_count, &submesh.m_verts[0].m_position.x(), submesh.m_verts.getSize(), sizeof(TempVertex));
+										 inMeshlet.triangle_count, &submesh.m_verts[0].m_position.x, submesh.m_verts.getSize(), sizeof(TempVertex));
 		outMeshlet.m_coneApex = Vec3(&bounds.cone_apex[0]);
 		outMeshlet.m_coneDir = Vec3(&bounds.cone_axis[0]);
 		outMeshlet.m_coneAngle = acos(bounds.cone_cutoff) * 2.0f;
@@ -614,7 +614,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 		aabbMax = aabbMax.max(submesh.m_aabbMax);
 
 		const Sphere s = computeBoundingSphere(&submesh.m_verts[0].m_position, submesh.m_verts.getSize(), sizeof(submesh.m_verts[0]));
-		submesh.m_sphereCenter = s.getCenter().xyz();
+		submesh.m_sphereCenter = s.getCenter().xyz;
 		submesh.m_sphereRadius = max(kEpsilonf * 10.0f, s.getRadius());
 
 		// Fix normals
@@ -726,7 +726,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 	header.m_boundingVolume.m_aabbMin = aabbMin;
 	header.m_boundingVolume.m_aabbMax = aabbMax;
 	const Sphere s = computeBoundingSphere(&allPositions[0], allPositions.getSize(), sizeof(allPositions[0]));
-	header.m_boundingVolume.m_sphereCenter = s.getCenter().xyz();
+	header.m_boundingVolume.m_sphereCenter = s.getCenter().xyz;
 	header.m_boundingVolume.m_sphereRadius = s.getRadius();
 
 	// Compute the pos scale and transform. The scale is uniform because it's applied to the model matrix of the object
@@ -738,7 +738,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 	posScale = (posScale < 1.0f) ? 1.0f : (1.0f / posScale);
 	const Vec3 posTranslation = -aabbMin;
 
-	writeVertexAttribAndBufferInfoToHeader(VertexStreamId::kPosition, header, Vec4(1.0f / posScale), (-posTranslation).xyz1());
+	writeVertexAttribAndBufferInfoToHeader(VertexStreamId::kPosition, header, Vec4(1.0f / posScale), (-posTranslation).xyz1);
 	writeVertexAttribAndBufferInfoToHeader(VertexStreamId::kNormal, header);
 	writeVertexAttribAndBufferInfoToHeader(VertexStreamId::kUv, header);
 	if(hasBoneWeights)
@@ -819,7 +819,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 				localPos = localPos.clamp(0.0f, 1.0f);
 				localPos *= F32(kMaxU16);
 				localPos = localPos.round();
-				positions[v] = U16Vec4(localPos.xyz0());
+				positions[v] = U16Vec4(localPos.xyz0);
 			}
 
 			ANKI_CHECK(file.write(&positions[0], positions.getSizeInBytes()));
@@ -832,7 +832,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 			normals.resize(submesh.m_verts.getSize());
 			for(U32 v = 0; v < submesh.m_verts.getSize(); ++v)
 			{
-				normals[v] = packSnorm4x8(submesh.m_verts[v].m_normal.xyz0());
+				normals[v] = submesh.m_verts[v].m_normal.xyz0.packSnorm4x8();
 			}
 
 			ANKI_CHECK(file.write(&normals[0], normals.getSizeInBytes()));
@@ -873,7 +873,7 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 				boneWeights.resize(submesh.m_verts.getSize());
 				for(U32 v = 0; v < submesh.m_verts.getSize(); ++v)
 				{
-					boneWeights[v] = packSnorm4x8(submesh.m_verts[v].m_boneWeights);
+					boneWeights[v] = submesh.m_verts[v].m_boneWeights.packSnorm4x8();
 				}
 
 				ANKI_CHECK(file.write(&boneWeights[0], boneWeights.getSizeInBytes()));
@@ -901,10 +901,10 @@ Error GltfImporter::writeMeshInternal(const cgltf_mesh& mesh) const
 				out.m_vertexCount = in.m_vertexCount;
 				vertCount2 += in.m_vertexCount;
 
-				out.m_boundingVolume.m_sphereCenter = in.m_sphere.getCenter().xyz();
+				out.m_boundingVolume.m_sphereCenter = in.m_sphere.getCenter().xyz;
 				out.m_boundingVolume.m_sphereRadius = in.m_sphere.getRadius();
-				out.m_boundingVolume.m_aabbMin = in.m_aabb.getMin().xyz();
-				out.m_boundingVolume.m_aabbMax = in.m_aabb.getMax().xyz();
+				out.m_boundingVolume.m_aabbMin = in.m_aabb.getMin().xyz;
+				out.m_boundingVolume.m_aabbMax = in.m_aabb.getMax().xyz;
 
 				out.m_coneApex = in.m_coneApex;
 				out.m_coneDirection = in.m_coneDir;

+ 28 - 28
AnKi/Importer/ImageImporter.cpp

@@ -294,9 +294,9 @@ static Error resizeImage(CString inImageFilename, U32 outWidth, U32 outHeight, C
 static Vec3 linearToSRgb(Vec3 p)
 {
 	Vec3 cutoff;
-	cutoff.x() = (p.x() < 0.0031308f) ? 1.0f : 0.0f;
-	cutoff.y() = (p.y() < 0.0031308f) ? 1.0f : 0.0f;
-	cutoff.z() = (p.z() < 0.0031308f) ? 1.0f : 0.0f;
+	cutoff.x = (p.x < 0.0031308f) ? 1.0f : 0.0f;
+	cutoff.y = (p.y < 0.0031308f) ? 1.0f : 0.0f;
+	cutoff.z = (p.z < 0.0031308f) ? 1.0f : 0.0f;
 
 	const Vec3 higher = 1.055f * p.pow(1.0f / 2.4f) - 0.055f;
 	const Vec3 lower = p * 12.92f;
@@ -308,9 +308,9 @@ static Vec3 linearToSRgb(Vec3 p)
 static Vec3 sRgbToLinear(Vec3 p)
 {
 	Vec3 cutoff;
-	cutoff.x() = (p.x() < 0.04045f) ? 1.0f : 0.0f;
-	cutoff.y() = (p.y() < 0.04045f) ? 1.0f : 0.0f;
-	cutoff.z() = (p.z() < 0.04045f) ? 1.0f : 0.0f;
+	cutoff.x = (p.x < 0.04045f) ? 1.0f : 0.0f;
+	cutoff.y = (p.y < 0.04045f) ? 1.0f : 0.0f;
+	cutoff.z = (p.z < 0.04045f) ? 1.0f : 0.0f;
 
 	const Vec3 higher = ((p + 0.055f) / 1.055f).pow(2.4f);
 	const Vec3 lower = p / 12.92f;
@@ -328,31 +328,31 @@ static void linearToSRgbBatch(WeakArray<TVec> pixels, TFunc func)
 		Vec3 p;
 		if(std::is_same<S, U8>::value)
 		{
-			p.x() = F32(pixel.x()) / 255.0f;
-			p.y() = F32(pixel.y()) / 255.0f;
-			p.z() = F32(pixel.z()) / 255.0f;
+			p.x = F32(pixel.x) / 255.0f;
+			p.y = F32(pixel.y) / 255.0f;
+			p.z = F32(pixel.z) / 255.0f;
 		}
 		else
 		{
 			ANKI_ASSERT((std::is_same<S, F32>::value));
-			p.x() = F32(pixel.x());
-			p.y() = F32(pixel.y());
-			p.z() = F32(pixel.z());
+			p.x = F32(pixel.x);
+			p.y = F32(pixel.y);
+			p.z = F32(pixel.z);
 		}
 
 		p = func(p);
 
 		if(std::is_same<S, U8>::value)
 		{
-			pixel.x() = S(p.x() * 255.0f);
-			pixel.y() = S(p.y() * 255.0f);
-			pixel.z() = S(p.z() * 255.0f);
+			pixel.x = S(p.x * 255.0f);
+			pixel.y = S(p.y * 255.0f);
+			pixel.z = S(p.z * 255.0f);
 		}
 		else
 		{
-			pixel.x() = S(p.x());
-			pixel.y() = S(p.y());
-			pixel.z() = S(p.z());
+			pixel.x = S(p.x);
+			pixel.y = S(p.y);
+			pixel.z = S(p.z);
 		}
 	}
 }
@@ -391,7 +391,7 @@ static Vec4 computeAverageColor(WeakArray<TVec> pixels)
 		average += v * weight;
 	}
 
-	return (componentCount == 3) ? average.xyz1() : average;
+	return (componentCount == 3) ? average.xyz1 : average;
 }
 
 static void applyScaleAndBias(WeakArray<Vec3> pixels, Vec3 scale, Vec3 bias)
@@ -712,7 +712,7 @@ static Error compressAstc(CString tempDirectory, CString astcencFilename, ConstW
 	[[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));
-	ANKI_ASSERT(outPixels.getSizeInBytes() == blockBytes * (inWidth / blockSize.x()) * (inHeight / blockSize.y()));
+	ANKI_ASSERT(outPixels.getSizeInBytes() == blockBytes * (inWidth / blockSize.x) * (inHeight / blockSize.y));
 
 	// Create a BMP image to feed to the astcebc
 	ImporterString tmpFilename;
@@ -741,7 +741,7 @@ static Error compressAstc(CString tempDirectory, CString astcencFilename, ConstW
 	ImporterString astcFilename;
 	astcFilename.sprintf("%s/AnKiImageImporter_%u.astc", tempDirectory.cstr(), g_tempFileIndex.fetchAdd(1));
 	ImporterString blockStr;
-	blockStr.sprintf("%ux%u", blockSize.x(), blockSize.y());
+	blockStr.sprintf("%ux%u", blockSize.x, blockSize.y);
 	Process proc;
 	Array<CString, 5> args;
 	U32 argCount = 0;
@@ -797,7 +797,7 @@ static Error compressAstc(CString tempDirectory, CString astcencFilename, ConstW
 	const U32 blockx = max<U32>(header.m_blockX, 1u);
 	const U32 blocky = max<U32>(header.m_blockY, 1u);
 	const U32 blockz = max<U32>(header.m_blockZ, 1u);
-	if(blockx != blockSize.x() || blocky != blockSize.y() || blockz != 1)
+	if(blockx != blockSize.x || blocky != blockSize.y || blockz != 1)
 	{
 		ANKI_IMPORTER_LOGE("astcenc-avx2 with wrong block size");
 		return Error::kFunctionFailed;
@@ -842,9 +842,9 @@ static Error storeAnkiImage(const ImageImporterConfig& config, const ImageImport
 	header.m_compressionMask = config.m_compressions;
 	header.m_isNormal = false;
 	header.m_mipmapCount = U8(ctx.m_mipmaps.getSize());
-	header.m_astcBlockSizeX = config.m_astcBlockSize.x();
-	header.m_astcBlockSizeY = config.m_astcBlockSize.y();
-	header.m_averageColor = {ctx.m_averageColor.x(), ctx.m_averageColor.y(), ctx.m_averageColor.z(), ctx.m_averageColor.w()};
+	header.m_astcBlockSizeX = config.m_astcBlockSize.x;
+	header.m_astcBlockSizeY = config.m_astcBlockSize.y;
+	header.m_averageColor = {ctx.m_averageColor.x, ctx.m_averageColor.y, ctx.m_averageColor.z, ctx.m_averageColor.w};
 	ANKI_CHECK(outFile.write(&header, sizeof(header)));
 
 	// Write RAW
@@ -917,8 +917,8 @@ static Error importImageInternal(const ImageImporterConfig& configOriginal)
 	config.m_minMipmapDimension = max(config.m_minMipmapDimension, 4u);
 	if(!!(config.m_compressions & ImageBinaryDataCompression::kAstc))
 	{
-		config.m_minMipmapDimension = max(config.m_minMipmapDimension, config.m_astcBlockSize.x());
-		config.m_minMipmapDimension = max(config.m_minMipmapDimension, config.m_astcBlockSize.y());
+		config.m_minMipmapDimension = max(config.m_minMipmapDimension, config.m_astcBlockSize.x);
+		config.m_minMipmapDimension = max(config.m_minMipmapDimension, config.m_astcBlockSize.y);
 	}
 
 	// Checks
@@ -1109,7 +1109,7 @@ static Error importImageInternal(const ImageImporterConfig& configOriginal)
 					const U32 width = ctx.m_width >> mip;
 					const U32 height = ctx.m_height >> mip;
 					const PtrSize blockSize = 16;
-					const PtrSize astcImageSize = blockSize * (width / config.m_astcBlockSize.x()) * (height / config.m_astcBlockSize.y());
+					const PtrSize astcImageSize = blockSize * (width / config.m_astcBlockSize.x) * (height / config.m_astcBlockSize.y);
 
 					surface.m_astcPixels.resize(astcImageSize);
 

+ 0 - 1
AnKi/Math.h

@@ -6,7 +6,6 @@
 #pragma once
 
 #include <AnKi/Math/Vec.h>
-#include <AnKi/Math/Vec2.h>
 #include <AnKi/Math/Mat.h>
 #include <AnKi/Math/Quat.h>
 #include <AnKi/Math/Euler.h>

+ 25 - 25
AnKi/Math/Axisang.h

@@ -37,12 +37,12 @@ public:
 
 	explicit TAxisang(const TQuat<T>& q)
 	{
-		m_ang = T(2) * acos<T>(q.w());
-		T length = sqrt<T>(T(1) - q.w() * q.w());
+		m_ang = T(2) * acos<T>(q.w);
+		T length = sqrt<T>(T(1) - q.w * q.w);
 		if(!isZero<T>(length))
 		{
 			length = T(1) / length;
-			m_axis = TVec<T, 3>(q.x() * length, q.y() * length, q.z() * length);
+			m_axis = TVec<T, 3>(q.x * length, q.y * length, q.z * length);
 		}
 		else
 		{
@@ -63,38 +63,38 @@ public:
 			}
 
 			m_ang = kPi;
-			m_axis.x() = (m3(0, 0) + T(1)) / T(2);
-			if(m_axis.x() > T(0))
+			m_axis.x = (m3(0, 0) + T(1)) / T(2);
+			if(m_axis.x > T(0))
 			{
-				m_axis.x() = sqrt(m_axis.x());
+				m_axis.x = sqrt(m_axis.x);
 			}
 			else
 			{
-				m_axis.x() = T(0);
+				m_axis.x = T(0);
 			}
-			m_axis.y() = (m3(1, 1) + T(1)) / T(2);
-			if(m_axis.y() > T(0))
+			m_axis.y = (m3(1, 1) + T(1)) / T(2);
+			if(m_axis.y > T(0))
 			{
-				m_axis.y() = sqrt(m_axis.y());
+				m_axis.y = sqrt(m_axis.y);
 			}
 			else
 			{
-				m_axis.y() = T(0);
+				m_axis.y = T(0);
 			}
 
-			m_axis.z() = (m3(2, 2) + T(1)) / T(2);
-			if(m_axis.z() > T(0))
+			m_axis.z = (m3(2, 2) + T(1)) / T(2);
+			if(m_axis.z > T(0))
 			{
-				m_axis.z() = sqrt(m_axis.z());
+				m_axis.z = sqrt(m_axis.z);
 			}
 			else
 			{
-				m_axis.z() = T(0);
+				m_axis.z = T(0);
 			}
 
-			const Bool xZero = isZero<T>(m_axis.x());
-			const Bool yZero = isZero<T>(m_axis.y());
-			const Bool zZero = isZero<T>(m_axis.z());
+			const Bool xZero = isZero<T>(m_axis.x);
+			const Bool yZero = isZero<T>(m_axis.y);
+			const Bool zZero = isZero<T>(m_axis.z);
 			const Bool xyPositive = (m3(0, 1) > T(0));
 			const Bool xzPositive = (m3(0, 2) > T(0));
 			const Bool yzPositive = (m3(1, 2) > T(0));
@@ -102,21 +102,21 @@ public:
 			{
 				if(!yzPositive)
 				{
-					m_axis.y() = -m_axis.y();
+					m_axis.y = -m_axis.y;
 				}
 			}
 			else if(yZero && !zZero)
 			{
 				if(!xzPositive)
 				{
-					m_axis.z() = -m_axis.z();
+					m_axis.z = -m_axis.z;
 				}
 			}
 			else if(zZero)
 			{
 				if(!xyPositive)
 				{
-					m_axis.x() = -m_axis.x();
+					m_axis.x = -m_axis.x;
 				}
 			}
 
@@ -132,9 +132,9 @@ public:
 		}
 
 		m_ang = acos<T>((m3(0, 0) + m3(1, 1) + m3(2, 2) - T(1)) / T(2));
-		m_axis.x() = (m3(2, 1) - m3(1, 2)) / s;
-		m_axis.y() = (m3(0, 2) - m3(2, 0)) / s;
-		m_axis.z() = (m3(1, 0) - m3(0, 1)) / s;
+		m_axis.x = (m3(2, 1) - m3(1, 2)) / s;
+		m_axis.y = (m3(0, 2) - m3(2, 0)) / s;
+		m_axis.z = (m3(1, 0) - m3(0, 1)) / s;
 	}
 	/// @}
 
@@ -185,7 +185,7 @@ public:
 	/// @{
 	String toString() const requires(std::is_floating_point<T>::value)
 	{
-		return String().sprintf("%f %f %f | %f", m_axis.x(), m_axis.y(), m_axis.z(), m_ang);
+		return String().sprintf("%f %f %f | %f", m_axis.x, m_axis.y, m_axis.z, m_ang);
 	}
 	/// @}
 

+ 0 - 16
AnKi/Math/CommonSrc.h

@@ -1,16 +0,0 @@
-// Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-#include <AnKi/Math/Vec2.h>
-#include <AnKi/Math/Vec3.h>
-#include <AnKi/Math/Vec4.h>
-#include <AnKi/Math/Quat.h>
-#include <AnKi/Math/Axisang.h>
-#include <AnKi/Math/Euler.h>
-#include <AnKi/Math/Mat3.h>
-#include <AnKi/Math/Mat4.h>
-#include <AnKi/Math/Mat3x4.h>
-#include <AnKi/Math/Transform.h>
-#include <AnKi/Math/Functions.h>

+ 2 - 2
AnKi/Math/Forward.h

@@ -11,9 +11,9 @@ namespace anki {
 
 class F16;
 
-template<typename T, U N>
+template<typename T, U32 N>
 class TVec;
-template<typename T, U J, U I>
+template<typename T, U32 J, U32 I>
 class TMat;
 template<typename T>
 class TQuat;

+ 25 - 82
AnKi/Math/Functions.h

@@ -10,13 +10,10 @@
 
 namespace anki {
 
-/// @addtogroup math
-/// @{
-
-/// Just PI.
+// Just PI.
 constexpr F32 kPi = 3.14159265358979323846f;
 
-/// Floating point epsilon.
+// Floating point epsilon.
 constexpr F32 kEpsilonf = 1.0e-6f;
 
 template<typename T>
@@ -95,35 +92,35 @@ inline T mod(const T x, const T y)
 	return x - y * std::floor(x / y);
 }
 
-/// Like GLSL's mix.
+// Like GLSL's mix.
 template<typename T, typename Y>
 inline T mix(T x, T y, Y factor)
 {
 	return x * (T(1) - factor) + y * factor;
 }
 
-/// Like GLSL's modf
+// Like GLSL's modf
 template<typename T>
 inline T modf(T x, T& intPart)
 {
 	return std::modf(x, &intPart);
 }
 
-/// The same as abs/fabs. For ints.
+// The same as abs/fabs. For ints.
 template<typename T>
 inline constexpr T absolute(const T f) requires(std::is_integral<T>::value&& std::is_signed<T>::value)
 {
 	return (f < T(0)) ? -f : f;
 }
 
-/// The same as abs/fabs. For floats.
+// The same as abs/fabs. For floats.
 template<typename T>
 inline constexpr T absolute(const T f) requires(std::is_floating_point<T>::value&& std::is_same_v<T, double>)
 {
 	return fabs(f);
 }
 
-/// The same as abs/fabs. For floats.
+// The same as abs/fabs. For floats.
 template<typename T>
 inline constexpr T absolute(const T f) requires(std::is_floating_point<T>::value&& std::is_same_v<T, float>)
 {
@@ -172,14 +169,14 @@ inline constexpr T saturate(T v)
 	return clamp<T>(v, T(0), T(1));
 }
 
-/// Returns 1 or -1 based on the sign
+// Returns 1 or -1 based on the sign
 template<typename T>
 inline constexpr T sign(T v)
 {
 	return (v > T(0)) ? T(1) : T(-1);
 }
 
-/// Same as smoothstep in glsl
+// Same as smoothstep in glsl
 template<typename T>
 inline constexpr T smoothstep(T edge0, T edge1, T value)
 {
@@ -187,20 +184,20 @@ inline constexpr T smoothstep(T edge0, T edge1, T value)
 	return value * value * (T(3) - T(2) * value);
 }
 
-/// Linear interpolation between values
-/// @param[in] from Starting value
-/// @param[in] to Ending value
-/// @param[in] u The percentage from the from "from" value. Values from [0.0, 1.0]
+// Linear interpolation between values
+// from: Starting value
+// to: Ending value
+// u: The percentage from the from "from" value. Values from [0.0, 1.0]
 template<typename T>
 inline constexpr T linearInterpolate(const T& from, const T& to, F32 u)
 {
 	return from * T(1.0f - u) + to * T(u);
 }
 
-/// Cosine interpolation
-/// @param[in] from Starting value
-/// @param[in] to Ending value
-/// @param[in] u The percentage from the from "from" value. Values from [0.0, 1.0]
+// Cosine interpolation
+// from: Starting value
+// to: Ending value
+// u: The percentage from the from "from" value. Values from [0.0, 1.0]
 template<typename T>
 inline T cosInterpolate(const T& from, const T& to, F32 u)
 {
@@ -208,12 +205,12 @@ inline T cosInterpolate(const T& from, const T& to, F32 u)
 	return from * T(1.0f - u2) + to * T(u2);
 }
 
-/// Cubic interpolation
-/// @param[in] a Point a
-/// @param[in] b Point b
-/// @param[in] c Point c
-/// @param[in] d Point d
-/// @param[in] u The percentage from the from b point to d point. Value from [0.0, 1.0]
+// Cubic interpolation
+// a: Point a
+// b: Point b
+// c: Point c
+// d: Point d
+// u: The percentage from the from b point to d point. Value from [0.0, 1.0]
 template<typename T>
 inline constexpr T cubicInterpolate(const T& a, const T& b, const T& c, const T& d, F32 u)
 {
@@ -226,7 +223,7 @@ inline constexpr T cubicInterpolate(const T& a, const T& b, const T& c, const T&
 	return (a0 * u * u2 + a1 * u2 + a2 * u + a3);
 }
 
-/// Pack 4 color components to R10G10B10A2 SNORM format.
+// Pack 4 color components to R10G10B10A2 SNORM format.
 inline U32 packColorToR10G10B10A2SNorm(F32 r, F32 g, F32 b, F32 a)
 {
 	union SignedR10G10B10A10
@@ -259,7 +256,7 @@ inline U32 packColorToR10G10B10A2SNorm(F32 r, F32 g, F32 b, F32 a)
 	return out.m_packed;
 }
 
-/// Compute the abs triangle area.
+// Compute the abs triangle area.
 template<typename TVec>
 inline F32 computeTriangleArea(const TVec& a, const TVec& b, const TVec& c)
 {
@@ -268,59 +265,5 @@ inline F32 computeTriangleArea(const TVec& a, const TVec& b, const TVec& c)
 	const F32 area = ab.cross(ac).length() / 2.0f;
 	return absolute(area);
 }
-/// @}
-
-} // end namespace anki
-
-// Now lay out functions that include other math headers
-
-#include <AnKi/Math/Vec.h>
-
-namespace anki {
-
-template<typename T>
-TVec<T, 3> sphericalToCartesian(T polar, T azimuth)
-{
-	TVec<T, 3> out;
-	out.x() = cos(polar) * sin(azimuth);
-	out.y() = cos(polar) * cos(azimuth);
-	out.z() = sin(polar);
-	return out;
-}
-
-template<typename T>
-inline U32 packUnorm4x8(TVec<T, 4> value)
-{
-	ANKI_ASSERT((value <= TVec<T, 4>(T(1)) && value >= TVec<T, 4>(T(0))));
-	const TVec<T, 4> packed(value * T(255));
-	return packed.x() | (U32(packed.y()) << 8u) | (U32(packed.z()) << 16u) | (U32(packed.w()) << 24u);
-}
-
-// Reverse of packUnorm4x8
-template<typename T>
-inline TVec<T, 4> unpackUnorm4x8(const U32 value)
-{
-	const TVec<T, 4> packed(value & 0xFF, (value >> 8u) & 0xFF, (value >> 16u) & 0xff, value >> 24u);
-	return packed / T(255);
-}
-
-template<typename TVec4>
-inline U32 packSnorm4x8(const TVec4& v)
-{
-	union
-	{
-		I8 in[4];
-		U32 out;
-	} u;
-
-	const TVec4 result = (v.clamp(-1.0f, 1.0f) * 127.0f).round();
-
-	u.in[0] = I8(result[0]);
-	u.in[1] = I8(result[1]);
-	u.in[2] = I8(result[2]);
-	u.in[3] = I8(result[3]);
-
-	return u.out;
-}
 
 } // end namespace anki

+ 112 - 113
AnKi/Math/Mat.h

@@ -17,7 +17,7 @@ namespace anki {
 /// @tparam T The scalar type. Eg float.
 /// @tparam kTRowCount The number of rows.
 /// @tparam kTColumnCount The number of columns.
-template<typename T, U kTRowCount, U kTColumnCount>
+template<typename T, U32 kTRowCount, U32 kTColumnCount>
 class alignas(MathSimd<T, kTColumnCount>::kAlignment) TMat
 {
 public:
@@ -36,9 +36,9 @@ public:
 	using RowVec = TVec<T, kTColumnCount>;
 	using ColumnVec = TVec<T, kTRowCount>;
 
-	static constexpr U kRowCount = kTRowCount; ///< Number of rows
-	static constexpr U kColumnCount = kTColumnCount; ///< Number of columns
-	static constexpr U kSize = kTRowCount * kTColumnCount; ///< Number of total elements
+	static constexpr U32 kRowCount = kTRowCount; ///< Number of rows
+	static constexpr U32 kColumnCount = kTColumnCount; ///< Number of columns
+	static constexpr U32 kSize = kTRowCount * kTColumnCount; ///< Number of total elements
 
 	static constexpr Bool kIsSquare = kTColumnCount == kTRowCount;
 	static constexpr Bool kHasSimd = kTColumnCount == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
@@ -55,7 +55,7 @@ public:
 	/// Copy.
 	constexpr TMat(const TMat& b)
 	{
-		for(U i = 0; i < kRowCount; i++)
+		for(U32 i = 0; i < kRowCount; i++)
 		{
 			m_rows[i] = b.m_rows[i];
 		}
@@ -63,7 +63,7 @@ public:
 
 	explicit constexpr TMat(const T f)
 	{
-		for(U i = 0; i < kRowCount; i++)
+		for(U32 i = 0; i < kRowCount; i++)
 		{
 			m_rows[i] = RowVec(f);
 		}
@@ -71,7 +71,7 @@ public:
 
 	explicit constexpr TMat(const T arr[])
 	{
-		for(U i = 0; i < N; i++)
+		for(U32 i = 0; i < N; i++)
 		{
 			m_arr1[i] = arr[i];
 		}
@@ -157,20 +157,20 @@ public:
 		T t = T(1) - c;
 
 		const TVec<T, 3>& axis = axisang.getAxis();
-		m(0, 0) = c + axis.x() * axis.x() * t;
-		m(1, 1) = c + axis.y() * axis.y() * t;
-		m(2, 2) = c + axis.z() * axis.z() * t;
+		m(0, 0) = c + axis.x * axis.x * t;
+		m(1, 1) = c + axis.y * axis.y * t;
+		m(2, 2) = c + axis.z * axis.z * t;
 
-		T tmp1 = axis.x() * axis.y() * t;
-		T tmp2 = axis.z() * s;
+		T tmp1 = axis.x * axis.y * t;
+		T tmp2 = axis.z * s;
 		m(1, 0) = tmp1 + tmp2;
 		m(0, 1) = tmp1 - tmp2;
-		tmp1 = axis.x() * axis.z() * t;
-		tmp2 = axis.y() * s;
+		tmp1 = axis.x * axis.z * t;
+		tmp2 = axis.y * s;
 		m(2, 0) = tmp1 - tmp2;
 		m(0, 2) = tmp1 + tmp2;
-		tmp1 = axis.y() * axis.z() * t;
-		tmp2 = axis.x() * s;
+		tmp1 = axis.y * axis.z * t;
+		tmp2 = axis.x * s;
 		m(2, 1) = tmp1 + tmp2;
 		m(1, 2) = tmp1 - tmp2;
 	}
@@ -207,9 +207,9 @@ public:
 		}
 		else
 		{
-			const auto a = rotation.getColumn(0) * scale.x();
-			const auto b = rotation.getColumn(1) * scale.y();
-			const auto c = rotation.getColumn(2) * scale.z();
+			const auto a = rotation.getColumn(0) * scale.x;
+			const auto b = rotation.getColumn(1) * scale.y;
+			const auto c = rotation.getColumn(2) * scale.z;
 			TMat<T, 3, 3> rot;
 			rot.setColumns(a, b, c);
 			setRotationPart(rot);
@@ -223,7 +223,7 @@ public:
 	}
 
 	explicit constexpr TMat(const TTransform<T>& t) requires(kSize == 16)
-		: TMat(t.getOrigin().xyz(), t.getRotation().getRotationPart(), t.getScale().xyz())
+		: TMat(t.getOrigin().xyz, t.getRotation().getRotationPart(), t.getScale().xyz)
 	{
 	}
 
@@ -272,9 +272,9 @@ public:
 		}
 		else
 		{
-			const auto a = rotation.getColumn(0) * scale.x();
-			const auto b = rotation.getColumn(1) * scale.y();
-			const auto c = rotation.getColumn(2) * scale.z();
+			const auto a = rotation.getColumn(0) * scale.x;
+			const auto b = rotation.getColumn(1) * scale.y;
+			const auto c = rotation.getColumn(2) * scale.z;
 			setColumns(a, b, c);
 		}
 
@@ -297,29 +297,29 @@ public:
 	}
 
 	explicit constexpr TMat(const TTransform<T>& t) requires(kSize == 12)
-		: TMat(t.getOrigin().xyz(), t.getRotation().getRotationPart(), t.getScale().xyz())
+		: TMat(t.getOrigin().xyz, t.getRotation().getRotationPart(), t.getScale().xyz)
 	{
 	}
 	/// @}
 
 	/// @name Accessors
 	/// @{
-	T& operator()(const U j, const U i)
+	T& operator()(const U32 j, const U32 i)
 	{
 		return m_arr2[j][i];
 	}
 
-	[[nodiscard]] T operator()(const U j, const U i) const
+	[[nodiscard]] T operator()(const U32 j, const U32 i) const
 	{
 		return m_arr2[j][i];
 	}
 
-	T& operator[](const U n)
+	T& operator[](const U32 n)
 	{
 		return m_arr1[n];
 	}
 
-	[[nodiscard]] T operator[](const U n) const
+	[[nodiscard]] T operator[](const U32 n) const
 	{
 		return m_arr1[n];
 	}
@@ -331,7 +331,7 @@ public:
 	/// Copy.
 	TMat& operator=(const TMat& b)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] = b.m_rows[i];
 		}
@@ -341,7 +341,7 @@ public:
 	[[nodiscard]] TMat operator+(const TMat& b) const
 	{
 		TMat c;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			c.m_rows[i] = m_rows[i] + b.m_rows[i];
 		}
@@ -350,7 +350,7 @@ public:
 
 	TMat& operator+=(const TMat& b)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] += b.m_rows[i];
 		}
@@ -360,7 +360,7 @@ public:
 	[[nodiscard]] TMat operator-(const TMat& b) const
 	{
 		TMat c;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			c.m_rows[i] = m_rows[i] - b.m_rows[i];
 		}
@@ -369,7 +369,7 @@ public:
 
 	TMat& operator-=(const TMat& b)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] -= b.m_rows[i];
 		}
@@ -380,12 +380,12 @@ public:
 	{
 		TMat out;
 		const TMat& a = *this;
-		for(U j = 0; j < kTRowCount; j++)
+		for(U32 j = 0; j < kTRowCount; j++)
 		{
-			for(U i = 0; i < kTColumnCount; i++)
+			for(U32 i = 0; i < kTColumnCount; i++)
 			{
 				out(j, i) = T(0);
-				for(U k = 0; k < kTColumnCount; k++)
+				for(U32 k = 0; k < kTColumnCount; k++)
 				{
 					out(j, i) += a(j, k) * b(k, i);
 				}
@@ -399,7 +399,7 @@ public:
 	{
 		TMat out;
 		const auto& m = *this;
-		for(U i = 0; i < 4; i++)
+		for(U32 i = 0; i < 4; i++)
 		{
 #	if ANKI_SIMD_SSE
 			__m128 t1, t2;
@@ -442,7 +442,7 @@ public:
 
 	[[nodiscard]] Bool operator==(const TMat& b) const
 	{
-		for(U i = 0; i < N; i++)
+		for(U32 i = 0; i < N; i++)
 		{
 			if(!isZero<T>(m_arr1[i] - b.m_arr1[i]))
 			{
@@ -454,7 +454,7 @@ public:
 
 	[[nodiscard]] Bool operator!=(const TMat& b) const
 	{
-		for(U i = 0; i < N; i++)
+		for(U32 i = 0; i < N; i++)
 		{
 			if(!isZero<T>(m_arr1[i] - b.m_arr1[i]))
 			{
@@ -470,7 +470,7 @@ public:
 	[[nodiscard]] TMat operator+(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] + f;
 		}
@@ -479,7 +479,7 @@ public:
 
 	TMat& operator+=(const T f)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] += f;
 		}
@@ -489,7 +489,7 @@ public:
 	[[nodiscard]] TMat operator-(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] - f;
 		}
@@ -498,7 +498,7 @@ public:
 
 	TMat& operator-=(const T f)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] -= f;
 		}
@@ -508,7 +508,7 @@ public:
 	[[nodiscard]] TMat operator*(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] * f;
 		}
@@ -517,7 +517,7 @@ public:
 
 	TMat& operator*=(const T f)
 	{
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] *= f;
 		}
@@ -528,7 +528,7 @@ public:
 	{
 		ANKI_ASSERT(f != T(0));
 		TMat out;
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] / f;
 		}
@@ -538,7 +538,7 @@ public:
 	TMat& operator/=(const T f)
 	{
 		ANKI_ASSERT(f != T(0));
-		for(U i = 0; i < kRowCount; ++i)
+		for(U32 i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] /= f;
 		}
@@ -552,10 +552,10 @@ public:
 	{
 		const TMat& m = *this;
 		ColumnVec out;
-		for(U j = 0; j < kTRowCount; j++)
+		for(U32 j = 0; j < kTRowCount; j++)
 		{
 			T sum = T(0);
-			for(U i = 0; i < kTColumnCount; i++)
+			for(U32 i = 0; i < kTColumnCount; i++)
 			{
 				sum += m(j, i) * v[i];
 			}
@@ -567,10 +567,10 @@ public:
 #if ANKI_SIMD_SSE
 	[[nodiscard]] ColumnVec operator*(const RowVec& v) const requires(kIs4x4Simd)
 	{
-		__m128 a = _mm_mul_ps(m_simd[0], v.getSimd());
-		__m128 b = _mm_mul_ps(m_simd[1], v.getSimd());
-		__m128 c = _mm_mul_ps(m_simd[2], v.getSimd());
-		__m128 d = _mm_mul_ps(m_simd[3], v.getSimd());
+		__m128 a = _mm_mul_ps(m_simd[0], v.m_simd);
+		__m128 b = _mm_mul_ps(m_simd[1], v.m_simd);
+		__m128 c = _mm_mul_ps(m_simd[2], v.m_simd);
+		__m128 d = _mm_mul_ps(m_simd[3], v.m_simd);
 
 		a = _mm_hadd_ps(a, b);
 		c = _mm_hadd_ps(c, d);
@@ -580,9 +580,9 @@ public:
 
 	[[nodiscard]] ColumnVec operator*(const RowVec& v) const requires(kIs3x4Simd)
 	{
-		__m128 a = _mm_mul_ps(m_simd[0], v.getSimd());
-		__m128 b = _mm_mul_ps(m_simd[1], v.getSimd());
-		__m128 c = _mm_mul_ps(m_simd[2], v.getSimd());
+		__m128 a = _mm_mul_ps(m_simd[0], v.m_simd);
+		__m128 b = _mm_mul_ps(m_simd[1], v.m_simd);
+		__m128 c = _mm_mul_ps(m_simd[2], v.m_simd);
 
 		a = _mm_hadd_ps(a, b);
 		const RowVec d(_mm_hadd_ps(a, c));
@@ -594,7 +594,7 @@ public:
 	[[nodiscard]] ColumnVec operator*(const RowVec& v) const requires(kHasSimd)
 	{
 		ColumnVec out;
-		for(U i = 0; i < kTRowCount; i++)
+		for(U32 i = 0; i < kTRowCount; i++)
 		{
 			out[i] = RowVec(m_simd[i]).dot(v);
 		}
@@ -605,7 +605,7 @@ public:
 
 	/// @name Other
 	/// @{
-	void setRow(const U j, const RowVec& v)
+	void setRow(const U32 j, const RowVec& v)
 	{
 		m_rows[j] = v;
 	}
@@ -623,7 +623,7 @@ public:
 		setRow(3, d);
 	}
 
-	const RowVec& getRow(const U j) const
+	const RowVec& getRow(const U32 j) const
 	{
 		return m_rows[j];
 	}
@@ -641,9 +641,9 @@ public:
 		d = getRow(3);
 	}
 
-	void setColumn(const U i, const ColumnVec& v)
+	void setColumn(const U32 i, const ColumnVec& v)
 	{
-		for(U j = 0; j < kTRowCount; j++)
+		for(U32 j = 0; j < kTRowCount; j++)
 		{
 			m_arr2[j][i] = v[j];
 		}
@@ -662,10 +662,10 @@ public:
 		setColumn(3, d);
 	}
 
-	[[nodiscard]] ColumnVec getColumn(const U i) const
+	[[nodiscard]] ColumnVec getColumn(const U32 i) const
 	{
 		ColumnVec out;
-		for(U j = 0; j < kTRowCount; j++)
+		for(U32 j = 0; j < kTRowCount; j++)
 		{
 			out[j] = m_arr2[j][i];
 		}
@@ -855,9 +855,9 @@ public:
 	void setRotationPart(const TMat<T, 3, 3>& m3)
 	{
 		TMat& m = *this;
-		for(U j = 0; j < 3; j++)
+		for(U32 j = 0; j < 3; j++)
 		{
-			for(U i = 0; i < 3; i++)
+			for(U32 i = 0; i < 3; i++)
 			{
 				m(j, i) = m3(j, i);
 			}
@@ -883,9 +883,9 @@ public:
 	void setTranslationPart(const TVec<T, 3>& v)
 	{
 		auto c = getColumn(3);
-		c.x() = v.x();
-		c.y() = v.y();
-		c.z() = v.z();
+		c.x = v.x;
+		c.y = v.y;
+		c.z = v.z;
 		setColumn(3, c);
 	}
 
@@ -936,9 +936,9 @@ public:
 	[[nodiscard]] TMat transpose() const requires(kIsSquare && !kHasSimd)
 	{
 		TMat out;
-		for(U j = 0; j < kTRowCount; j++)
+		for(U32 j = 0; j < kTRowCount; j++)
 		{
-			for(U i = 0; i < kTColumnCount; i++)
+			for(U32 i = 0; i < kTColumnCount; i++)
 			{
 				out.m_arr2[i][j] = m_arr2[j][i];
 			}
@@ -975,9 +975,9 @@ public:
 
 	void transposeRotationPart()
 	{
-		for(U j = 0; j < 3; j++)
+		for(U32 j = 0; j < 3; j++)
 		{
-			for(U i = j + 1; i < 3; i++)
+			for(U32 i = j + 1; i < 3; i++)
 			{
 				const T tmp = m_arr2[j][i];
 				m_arr2[j][i] = m_arr2[i][j];
@@ -1176,7 +1176,7 @@ public:
 		TMat c;
 		const auto& a = *this;
 #	if ANKI_SIMD_SSE
-		for(U i = 0; i < 3; i++)
+		for(U32 i = 0; i < 3; i++)
 		{
 			__m128 t1, t2;
 
@@ -1188,12 +1188,12 @@ public:
 			t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[2], t1), t2);
 
 			TVec<T, 4> v4(T(0), T(0), T(0), a(i, 3));
-			t2 = _mm_add_ps(v4.getSimd(), t2);
+			t2 = _mm_add_ps(v4.m_simd, t2);
 
 			c.m_simd[i] = t2;
 		}
 #	else
-		for(U i = 0; i < 3; i++)
+		for(U32 i = 0; i < 3; i++)
 		{
 			float32x4_t t1, t2;
 
@@ -1205,7 +1205,7 @@ public:
 			t2 = vaddq_f32(vmulq_f32(b.m_simd[2], t1), t2);
 
 			TVec<T, 4> v4(T(0), T(0), T(0), a(i, 3));
-			t2 = vaddq_f32(v4.getSimd(), t2);
+			t2 = vaddq_f32(v4.m_simd, t2);
 
 			c.m_simd[i] = t2;
 		}
@@ -1311,7 +1311,7 @@ public:
 	/// Given the parameters that construct a projection matrix extract 4 values that can be used to unproject a point from NDC to view space.
 	/// @code
 	/// Vec4 unprojParams = calculatePerspectiveUnprojectionParams(...);
-	/// F32 z = unprojParams.z() / (unprojParams.w() + depth);
+	/// F32 z = unprojParams.z / (unprojParams.w + depth);
 	/// Vec2 xy = ndc.xy() * unprojParams.xy() * z;
 	/// Vec3 posViewSpace(xy, z);
 	/// @endcode
@@ -1332,15 +1332,15 @@ public:
 		// Pv.z = A / (depth + B)
 		// where A = -m23 and B = m22
 		// so we save the A and B in the projection params vector
-		out.z() = -m23;
-		out.w() = m22;
+		out.z = -m23;
+		out.w = m22;
 
 		// Using the same logic the Pv.x = x' * w / m00
 		// so Pv.x = x' * Pv.z * (-1 / m00)
-		out.x() = -T(T(1)) / m00;
+		out.x = -T(T(1)) / m00;
 
 		// Same for y
-		out.y() = -T(T(1)) / m11;
+		out.y = -T(T(1)) / m11;
 
 		return out;
 	}
@@ -1350,10 +1350,10 @@ public:
 	{
 		TVec<T, 4> out;
 		const auto& m = *this;
-		out.z() = -m(2, 3);
-		out.w() = m(2, 2);
-		out.x() = -T(T(1)) / m(0, 0);
-		out.y() = -T(T(1)) / m(1, 1);
+		out.z = -m(2, 3);
+		out.w = m(2, 2);
+		out.x = -T(T(1)) / m(0, 0);
+		out.y = -T(T(1)) / m(1, 1);
 		return out;
 	}
 
@@ -1364,11 +1364,11 @@ public:
 		const TVec<T, 3> invScale = T(1) / scale;
 
 		TMat<T, 3, 3> rot;
-		rot.setRows(getRow(0).xyz() * invScale, getRow(1).xyz() * invScale, getRow(2).xyz() * invScale);
+		rot.setRows(getRow(0).xyz * invScale, getRow(1).xyz * invScale, getRow(2).xyz * invScale);
 
 		const TMat<T, 3, 3> invRot = rot.transpose();
 
-		const TVec<T, 3> invTsl = -(invRot * (getTranslationPart().xyz() * invScale));
+		const TVec<T, 3> invTsl = -(invRot * (getTranslationPart().xyz * invScale));
 
 		return TMat(invTsl, invRot, invScale);
 	}
@@ -1377,34 +1377,33 @@ public:
 	[[nodiscard]] TVec<T, 3> transform(const TVec<T, 3>& v) const requires(kSize == 16)
 	{
 		const auto& m = *this;
-		return TVec<T, 3>(m(0, 0) * v.x() + m(0, 1) * v.y() + m(0, 2) * v.z() + m(0, 3),
-						  m(1, 0) * v.x() + m(1, 1) * v.y() + m(1, 2) * v.z() + m(1, 3),
-						  m(2, 0) * v.x() + m(2, 1) * v.y() + m(2, 2) * v.z() + m(2, 3));
+		return TVec<T, 3>(m(0, 0) * v.x + m(0, 1) * v.y + m(0, 2) * v.z + m(0, 3), m(1, 0) * v.x + m(1, 1) * v.y + m(1, 2) * v.z + m(1, 3),
+						  m(2, 0) * v.x + m(2, 1) * v.y + m(2, 2) * v.z + m(2, 3));
 	}
 
 	/// Create a new transform matrix position at eye and looking at refPoint.
-	template<U kVecDimensions>
+	template<U32 kVecDimensions>
 	[[nodiscard]] static TMat lookAt(const TVec<T, kVecDimensions>& eye, const TVec<T, kVecDimensions>& refPoint,
 									 const TVec<T, kVecDimensions>& up) requires(kTRowCount == 3 && kTColumnCount == 4 && kVecDimensions >= 3)
 	{
-		const TVec<T, 3> vdir = (refPoint.xyz() - eye.xyz()).normalize();
-		const TVec<T, 3> vup = (up.xyz() - vdir * up.xyz().dot(vdir)).normalize();
+		const TVec<T, 3> vdir = (refPoint.xyz - eye.xyz).normalize();
+		const TVec<T, 3> vup = (up.xyz - vdir * up.xyz.dot(vdir)).normalize();
 		const TVec<T, 3> vside = vdir.cross(vup);
 		TMat out;
-		out.setColumns(vside, vup, -vdir, eye.xyz());
+		out.setColumns(vside, vup, -vdir, eye.xyz);
 		return out;
 	}
 
 	/// Create a new transform matrix position at eye and looking at refPoint.
-	template<U kVecDimensions>
+	template<U32 kVecDimensions>
 	[[nodiscard]] static TMat lookAt(const TVec<T, kVecDimensions>& eye, const TVec<T, kVecDimensions>& refPoint,
 									 const TVec<T, kVecDimensions>& up) requires(kTRowCount == 4 && kTColumnCount == 4 && kVecDimensions >= 3)
 	{
-		const TVec<T, 4> vdir = (refPoint.xyz0() - eye.xyz0()).normalize();
-		const TVec<T, 4> vup = (up.xyz0() - vdir * up.xyz0().dot(vdir)).normalize();
+		const TVec<T, 4> vdir = (refPoint.xyz0 - eye.xyz0).normalize();
+		const TVec<T, 4> vup = (up.xyz0 - vdir * up.xyz0.dot(vdir)).normalize();
 		const TVec<T, 4> vside = vdir.cross(vup);
 		TMat out;
-		out.setColumns(vside, vup, -vdir, eye.xyz1());
+		out.setColumns(vside, vup, -vdir, eye.xyz1);
 		return out;
 	}
 
@@ -1412,12 +1411,12 @@ public:
 	[[nodiscard]] static TMat rotationFromDirection(const TVec<T, 3>& zAxis) requires(kSize == 9)
 	{
 		const TVec<T, 3> z = zAxis;
-		const T sign = (z.z() >= T(0)) ? T(1) : -T(1);
-		const T a = -T(1) / (sign + z.z());
-		const T b = z.x() * z.y() * a;
+		const T sign = (z.z >= T(0)) ? T(1) : -T(1);
+		const T a = -T(1) / (sign + z.z);
+		const T b = z.x * z.y * a;
 
-		const TVec<T, 3> x = TVec<T, 3>(T(1) + sign * a * pow(z.x(), T(2)), sign * b, -sign * z.x());
-		const TVec<T, 3> y = TVec<T, 3>(b, sign + a * pow(z.y(), T(2)), -z.y());
+		const TVec<T, 3> x = TVec<T, 3>(T(1) + sign * a * pow(z.x, T(2)), sign * b, -sign * z.x);
+		const TVec<T, 3> y = TVec<T, 3>(b, sign + a * pow(z.y, T(2)), -z.y);
 
 		TMat out;
 		out.setColumns(x, y, z);
@@ -1432,7 +1431,7 @@ public:
 	// If we assume this is a transformation matrix then extract the scale
 	[[nodiscard]] TVec<T, 3> extractScale() const
 	{
-		return TVec<T, 3>(getColumn(0).xyz().length(), getColumn(1).xyz().length(), getColumn(2).xyz().length());
+		return TVec<T, 3>(getColumn(0).xyz.length(), getColumn(1).xyz.length(), getColumn(2).xyz.length());
 	}
 
 	static TMat getZero()
@@ -1473,9 +1472,9 @@ public:
 	[[nodiscard]] String toString() const requires(std::is_floating_point<T>::value)
 	{
 		String str;
-		for(U j = 0; j < kTRowCount; ++j)
+		for(U32 j = 0; j < kTRowCount; ++j)
 		{
-			for(U i = 0; i < kTColumnCount; ++i)
+			for(U32 i = 0; i < kTColumnCount; ++i)
 			{
 				CString fmt;
 				if(i == kTColumnCount - 1 && j == kTRowCount - 1)
@@ -1498,7 +1497,7 @@ public:
 	/// @}
 
 protected:
-	static constexpr U N = kTColumnCount * kTRowCount;
+	static constexpr U32 N = kTColumnCount * kTRowCount;
 
 	/// @name Data members
 	/// @{
@@ -1515,18 +1514,18 @@ protected:
 };
 
 /// @memberof TMat
-template<typename T, U kTRowCount, U kTColumnCount>
+template<typename T, U32 kTRowCount, U32 kTColumnCount>
 TMat<T, kTRowCount, kTColumnCount> operator+(const T f, const TMat<T, kTRowCount, kTColumnCount>& m)
 {
 	return m + f;
 }
 
 /// @memberof TMat
-template<typename T, U kTRowCount, U kTColumnCount>
+template<typename T, U32 kTRowCount, U32 kTColumnCount>
 TMat<T, kTRowCount, kTColumnCount> operator-(const T f, const TMat<T, kTRowCount, kTColumnCount>& m)
 {
 	TMat<T, kTRowCount, kTColumnCount> out;
-	for(U i = 0; i < kTRowCount * kTColumnCount; i++)
+	for(U32 i = 0; i < kTRowCount * kTColumnCount; i++)
 	{
 		out[i] = f - m[i];
 	}
@@ -1534,18 +1533,18 @@ TMat<T, kTRowCount, kTColumnCount> operator-(const T f, const TMat<T, kTRowCount
 }
 
 /// @memberof TMat
-template<typename T, U kTRowCount, U kTColumnCount>
+template<typename T, U32 kTRowCount, U32 kTColumnCount>
 TMat<T, kTRowCount, kTColumnCount> operator*(const T f, const TMat<T, kTRowCount, kTColumnCount>& m)
 {
 	return m * f;
 }
 
 /// @memberof TMat
-template<typename T, U kTRowCount, U kTColumnCount>
+template<typename T, U32 kTRowCount, U32 kTColumnCount>
 TMat<T, kTRowCount, kTColumnCount> operator/(const T f, const TMat<T, 3, 3>& m3)
 {
 	TMat<T, kTRowCount, kTColumnCount> out;
-	for(U i = 0; i < kTRowCount * kTColumnCount; i++)
+	for(U32 i = 0; i < kTRowCount * kTColumnCount; i++)
 	{
 		ANKI_ASSERT(m3[i] != T(0));
 		out[i] = f / m3[i];

+ 15 - 15
AnKi/Math/Quat.h

@@ -244,15 +244,15 @@ public:
 		{
 			// Non-SIMD version
 
-			const T lx = m_vec.x();
-			const T ly = m_vec.y();
-			const T lz = m_vec.z();
-			const T lw = m_vec.w();
+			const T lx = m_vec.x;
+			const T ly = m_vec.y;
+			const T lz = m_vec.z;
+			const T lw = m_vec.w;
 
-			const T rx = b.m_vec.x();
-			const T ry = b.m_vec.y();
-			const T rz = b.m_vec.z();
-			const T rw = b.m_vec.w();
+			const T rx = b.m_vec.x;
+			const T ry = b.m_vec.y;
+			const T rz = b.m_vec.z;
+			const T rw = b.m_vec.w;
 
 			const T x = lw * rx + lx * rw + ly * rz - lz * ry;
 			const T y = lw * ry - lx * rz + ly * rw + lz * rx;
@@ -286,7 +286,7 @@ public:
 	{
 		// Rotating a vector by a quaternion is done by: p' = q * p * q^-1 (q^-1 = conjugated(q) for a unit quaternion)
 		ANKI_ASSERT(isZero<T>(T(1) - m_vec.getLength()));
-		return TVec<T, 3>((*this * TQuat(TVec<T, 4>(inValue, T(0))) * conjugated()).m_vec.xyz());
+		return TVec<T, 3>((*this * TQuat(TVec<T, 4>(inValue, T(0))) * conjugated()).m_vec.xyz);
 	}
 
 	// Other //
@@ -300,19 +300,19 @@ public:
 	static TQuat fromPointToPoint(const TVec<T, 3>& from, const TVec<T, 3>& to)
 	{
 		const TVec<T, 3> axis(from.cross(to));
-		TVec<T, 4> quat = TVec4<T, 4>(axis.x(), axis.y(), axis.z(), from.dot(to));
+		TVec<T, 4> quat = TVec4<T, 4>(axis.x, axis.y, axis.z, from.dot(to));
 		quat = quat.normalize();
-		quat.w() += T(1);
+		quat.w += T(1);
 
-		if(quat.w() <= T(0.0001))
+		if(quat.w <= T(0.0001))
 		{
-			if(from.z() * from.z() > from.x() * from.x())
+			if(from.z * from.z > from.x * from.x)
 			{
-				quat = TVec<T, 4>(T(0), from.z(), -from.y(), T(0));
+				quat = TVec<T, 4>(T(0), from.z, -from.y, T(0));
 			}
 			else
 			{
-				quat = TVec<T, 4>(from.y(), -from.x(), T(0), T(0));
+				quat = TVec<T, 4>(from.y, -from.x, T(0), T(0));
 			}
 		}
 

+ 4 - 4
AnKi/Math/Simd.h

@@ -18,12 +18,12 @@
 namespace anki {
 
 /// Template class that holds SIMD info for the math classes.
-template<typename T, U N>
+template<typename T, U32 N>
 class MathSimd
 {
 public:
 	using Type = T[N];
-	static constexpr U kAlignment = alignof(T);
+	static constexpr U32 kAlignment = alignof(T);
 };
 
 #if ANKI_SIMD_SSE
@@ -33,7 +33,7 @@ class MathSimd<F32, 4>
 {
 public:
 	using Type = __m128;
-	static constexpr U kAlignment = 16;
+	static constexpr U32 kAlignment = 16;
 };
 #elif ANKI_SIMD_NEON
 // Specialize for F32
@@ -42,7 +42,7 @@ class MathSimd<F32, 4>
 {
 public:
 	using Type = float32x4_t;
-	static constexpr U kAlignment = 16;
+	static constexpr U32 kAlignment = 16;
 };
 #endif
 

+ 34 - 50
AnKi/Math/Transform.h

@@ -9,16 +9,13 @@
 
 namespace anki {
 
-/// @addtogroup math
-/// @{
-
-/// Transformation
+// Transformation
 template<typename T>
 class TTransform
 {
 public:
-	/// @name Constructors
-	/// @{
+	// Constructors //
+
 	constexpr TTransform()
 		: m_origin(T(0))
 		, m_rotation(TMat<T, 3, 4>::getIdentity())
@@ -36,14 +33,14 @@ public:
 
 	explicit TTransform(const TMat<T, 4, 4>& m4)
 	{
-		m_scale = m4.extractScale().xyz0();
+		m_scale = m4.extractScale().xyz0;
 
-		const TVec<T, 3> s0 = m4.getColumn(0).xyz();
-		const TVec<T, 3> s1 = m4.getColumn(1).xyz();
-		const TVec<T, 3> s2 = m4.getColumn(2).xyz();
-		m_rotation.setColumns(s0 / m_scale.x(), s1 / m_scale.y(), s2 / m_scale.z(), TVec<T, 3>(T(0)));
+		const TVec<T, 3> s0 = m4.getColumn(0).xyz;
+		const TVec<T, 3> s1 = m4.getColumn(1).xyz;
+		const TVec<T, 3> s2 = m4.getColumn(2).xyz;
+		m_rotation.setColumns(s0 / m_scale.x, s1 / m_scale.y, s2 / m_scale.z, TVec<T, 3>(T(0)));
 
-		m_origin = m4.getTranslationPart().xyz0();
+		m_origin = m4.getTranslationPart().xyz0;
 		check();
 	}
 
@@ -56,14 +53,12 @@ public:
 	}
 
 	TTransform(const TVec<T, 3>& origin, const TMat<T, 3, 3>& rotation, const TVec<T, 3>& scale)
-		: TTransform(origin.xyz0(), TMat<T, 3, 4>(TVec<T, 3>(T(0)), rotation), scale.xyz0())
+		: TTransform(origin.xyz0, TMat<T, 3, 4>(TVec<T, 3>(T(0)), rotation), scale.xyz0)
 	{
 		check();
 	}
-	/// @}
 
-	/// @name Accessors
-	/// @{
+	// Accessors //
 	[[nodiscard]] const TVec<T, 4>& getOrigin() const
 	{
 		return m_origin;
@@ -77,7 +72,7 @@ public:
 
 	void setOrigin(const TVec<T, 3>& o)
 	{
-		m_origin = o.xyz0();
+		m_origin = o.xyz0;
 	}
 
 	[[nodiscard]] const TMat<T, 3, 4>& getRotation() const
@@ -109,13 +104,11 @@ public:
 
 	void setScale(const TVec<T, 3>& s)
 	{
-		m_scale = s.xyz0();
+		m_scale = s.xyz0;
 		check();
 	}
-	/// @}
 
-	/// @name Operators with same type
-	/// @{
+	// Operators with same type //
 	TTransform& operator=(const TTransform& b)
 	{
 		m_origin = b.m_origin;
@@ -134,10 +127,9 @@ public:
 	{
 		return !operator==(b);
 	}
-	/// @}
 
-	/// @name Other
-	/// @{
+	// Other //
+
 	void setIdentity()
 	{
 		(*this) = getIdentity();
@@ -148,7 +140,7 @@ public:
 		return TTransform();
 	}
 
-	/// @copybrief combineTTransformations
+	// See combineTTransformations
 	[[nodiscard]] TTransform combineTransformations(const TTransform& b) const
 	{
 		check();
@@ -163,26 +155,26 @@ public:
 		return out;
 	}
 
-	/// Get the inverse transformation. Its faster that inverting a Mat4
+	// Get the inverse transformation. Its faster that inverting a Mat4
 	[[nodiscard]] TTransform invert() const
 	{
 		TTransform o;
 		o.m_rotation = m_rotation;
 		o.m_rotation.transposeRotationPart();
-		o.m_scale = TVec<T, 4>(T(1), T(1), T(1), T(0)) / m_scale.xyz1();
-		o.m_origin = -(o.m_rotation * (o.m_scale * m_origin)).xyz0();
+		o.m_scale = TVec<T, 4>(T(1), T(1), T(1), T(0)) / m_scale.xyz1;
+		o.m_origin = -(o.m_rotation * (o.m_scale * m_origin)).xyz0;
 		o.check();
 		return o;
 	}
 
-	/// Transform a TVec3
+	// Transform a TVec3
 	[[nodiscard]] TVec<T, 3> transform(const TVec<T, 3>& b) const
 	{
 		check();
-		return (m_rotation.getRotationPart() * (b * m_scale.xyz())) + m_origin.xyz();
+		return (m_rotation.getRotationPart() * (b * m_scale.xyz)) + m_origin.xyz;
 	}
 
-	/// Transform a TVec4. SIMD optimized
+	// Transform a TVec4. SIMD optimized
 	[[nodiscard]] TVec<T, 4> transform(const TVec<T, 4>& b) const
 	{
 		check();
@@ -190,17 +182,17 @@ public:
 		return out;
 	}
 
-	template<U kVecComponentCount>
+	template<U32 kVecComponentCount>
 	[[nodiscard]] TTransform lookAt(const TVec<T, kVecComponentCount>& refPoint, const TVec<T, kVecComponentCount>& up) const
 	{
-		const TVec<T, 4> j = up.xyz0();
-		const TVec<T, 4> vdir = (refPoint.xyz0() - m_origin).normalize();
+		const TVec<T, 4> j = up.xyz0;
+		const TVec<T, 4> vdir = (refPoint.xyz0 - m_origin).normalize();
 		const TVec<T, 4> vup = (j - vdir * j.dot(vdir)).normalize();
 		const TVec<T, 4> vside = vdir.cross(vup);
 		TTransform out;
 		out.m_origin = m_origin;
 		out.m_scale = m_scale;
-		out.m_rotation.setColumns(vside.xyz(), vup.xyz(), (-vdir).xyz());
+		out.m_rotation.setColumns(vside.xyz, vup.xyz, (-vdir).xyz);
 		return out;
 	}
 
@@ -215,7 +207,7 @@ public:
 		str += b;
 		str += "\n";
 
-		b = String().sprintf("scale: %f %f %f", m_scale.x(), m_scale.y(), m_scale.z());
+		b = String().sprintf("scale: %f %f %f", m_scale.x, m_scale.y, m_scale.z);
 		str += b;
 
 		return str;
@@ -223,32 +215,24 @@ public:
 
 	[[nodiscard]] Bool hasUniformScale() const
 	{
-		return m_scale.x() == m_scale.y() && m_scale.x() == m_scale.z();
+		return m_scale.x == m_scale.y && m_scale.x == m_scale.z;
 	}
-	/// @}
 
 private:
-	/// @name Data
-	/// @{
-	TVec<T, 4> m_origin; ///< The rotation
-	TMat<T, 3, 4> m_rotation; ///< The translation
-	TVec<T, 4> m_scale; ///< The scaling
-	/// @}
+	TVec<T, 4> m_origin; // The rotation
+	TMat<T, 3, 4> m_rotation; // The translation
+	TVec<T, 4> m_scale; // The scaling
 
 	void check() const
 	{
-		ANKI_ASSERT(m_origin.w() == T(0));
+		ANKI_ASSERT(m_origin.w == T(0));
 		using TT = TVec<T, 3>;
 		[[maybe_unused]] TT t; // Shut up the compiler regarding TT
-		ANKI_ASSERT(m_scale.w() == T(0) && m_scale.xyz() > TT(T(0)));
+		ANKI_ASSERT(m_scale.w == T(0) && m_scale.xyz > T(0));
 	}
 };
 
-/// F32 transformation
 using Transform = TTransform<F32>;
-
-/// F64 transformation
 using DTransform = TTransform<F64>;
-/// @}
 
 } // end namespace anki

File diff suppressed because it is too large
+ 1028 - 1973
AnKi/Math/Vec.h


+ 0 - 1821
AnKi/Math/Vec2.h

@@ -1,1821 +0,0 @@
-// Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
-// All rights reserved.
-// Code licensed under the BSD License.
-// http://www.anki3d.org/LICENSE
-
-#pragma once
-
-#include <AnKi/Math/Common.h>
-#include <AnKi/Util/F16.h>
-
-namespace anki {
-namespace v2 {
-
-template<typename T, U32 kComponentCount>
-class TVec;
-
-template<typename T, U32 kComponentCount, U32... kIndices>
-class TVecSwizzledData
-{
-public:
-	static constexpr U32 kIndexCount = sizeof...(kIndices);
-
-	using SwizzledVec = TVec<T, kIndexCount>;
-	using MainVec = TVec<T, kComponentCount>;
-
-	// For doing something like this: v4.xw = Vec2(1.0f)
-	MainVec& operator=(SwizzledVec in) requires(kComponentCount >= kIndexCount)
-	{
-		const U32 indices[] = {kIndices...};
-		for(U32 i = 0; i < kIndexCount; ++i)
-		{
-			m_arr[indices[i]] = in.m_arr[i];
-		}
-		return *reinterpret_cast<MainVec*>(this);
-	}
-
-	// For doing something like this: v2 = v4.xw
-	operator SwizzledVec() const
-	{
-		SwizzledVec vec;
-		const U32 indices[] = {kIndices...};
-		for(U32 i = 0; i < kIndexCount; ++i)
-		{
-			vec.m_arr[i] = m_arr[indices[i]];
-		}
-		return vec;
-	}
-
-private:
-	T m_arr[kComponentCount];
-};
-
-// Note: kSpecialConst is not of type T because some compilers don't like floats as template constants
-template<typename T, U32 kComponentCount, U32 kSpecialConst>
-class TVec4SpecialData
-{
-public:
-	using OutVec = TVec<T, 4>;
-
-	operator OutVec() const
-	{
-		OutVec vec;
-		for(U32 i = 0; i < kComponentCount; ++i)
-		{
-			vec.m_arr[i] = m_arr[i];
-		}
-		vec.m_arr[3] = T(kSpecialConst);
-		return vec;
-	}
-
-private:
-	T m_arr[kComponentCount];
-};
-
-template<typename T, U32 kComponentCount>
-class TVecSimdData
-{
-public:
-	T m_simd[kComponentCount];
-};
-
-template<typename T>
-class TVecSimdData<T, 4>
-{
-public:
-#if ANKI_SIMD_SSE
-	__m128 m_simd;
-#elif ANKI_SIMD_NEON
-	float32x4_t m_simd;
-#else
-	T m_simd[4];
-#endif
-};
-
-// Skip some warnings cause we really nead anonymous structs inside unions
-#if ANKI_COMPILER_MSVC
-#	pragma warning(push)
-#	pragma warning(disable : 4201)
-#elif ANKI_COMPILER_GCC_COMPATIBLE
-#	pragma GCC diagnostic push
-#	pragma GCC diagnostic ignored "-Wgnu-anonymous-struct"
-#	pragma GCC diagnostic ignored "-Wnested-anon-types"
-#endif
-
-template<typename T, U32 kComponentCount>
-class TVecData;
-
-// Data specializations
-
-template<typename T>
-class TVecData<T, 2>
-{
-public:
-	using Simd = Array<T, 2>;
-
-	union
-	{
-		struct
-		{
-			T x;
-			T y;
-		};
-
-		T m_carr[2];
-		Array<T, 2> m_arr;
-		Simd m_simd;
-
-		TVecSwizzledData<T, 2, 0, 0> xx;
-		TVecSwizzledData<T, 2, 0, 1> xy;
-		TVecSwizzledData<T, 2, 1, 0> yx;
-		TVecSwizzledData<T, 2, 1, 1> yy;
-		TVecSwizzledData<T, 2, 0, 0, 0> xxx;
-		TVecSwizzledData<T, 2, 0, 0, 1> xxy;
-		TVecSwizzledData<T, 2, 0, 1, 0> xyx;
-		TVecSwizzledData<T, 2, 0, 1, 1> xyy;
-		TVecSwizzledData<T, 2, 1, 0, 0> yxx;
-		TVecSwizzledData<T, 2, 1, 0, 1> yxy;
-		TVecSwizzledData<T, 2, 1, 1, 0> yyx;
-		TVecSwizzledData<T, 2, 1, 1, 1> yyy;
-		TVecSwizzledData<T, 2, 0, 0, 0, 0> xxxx;
-		TVecSwizzledData<T, 2, 0, 0, 0, 1> xxxy;
-		TVecSwizzledData<T, 2, 0, 0, 1, 0> xxyx;
-		TVecSwizzledData<T, 2, 0, 0, 1, 1> xxyy;
-		TVecSwizzledData<T, 2, 0, 1, 0, 0> xyxx;
-		TVecSwizzledData<T, 2, 0, 1, 0, 1> xyxy;
-		TVecSwizzledData<T, 2, 0, 1, 1, 0> xyyx;
-		TVecSwizzledData<T, 2, 0, 1, 1, 1> xyyy;
-		TVecSwizzledData<T, 2, 1, 0, 0, 0> yxxx;
-		TVecSwizzledData<T, 2, 1, 0, 0, 1> yxxy;
-		TVecSwizzledData<T, 2, 1, 0, 1, 0> yxyx;
-		TVecSwizzledData<T, 2, 1, 0, 1, 1> yxyy;
-		TVecSwizzledData<T, 2, 1, 1, 0, 0> yyxx;
-		TVecSwizzledData<T, 2, 1, 1, 0, 1> yyxy;
-		TVecSwizzledData<T, 2, 1, 1, 1, 0> yyyx;
-		TVecSwizzledData<T, 2, 1, 1, 1, 1> yyyy;
-	};
-};
-
-template<typename T>
-class TVecData<T, 3>
-{
-public:
-	using Simd = Array<T, 3>;
-
-	union
-	{
-		struct
-		{
-			T x;
-			T y;
-			T z;
-		};
-
-		T m_carr[3];
-		Array<T, 3> m_arr;
-		Simd m_simd;
-
-		TVec4SpecialData<T, 3, 0> xyz0;
-		TVec4SpecialData<T, 3, 1> xyz1;
-
-		TVecSwizzledData<T, 3, 0, 0> xx;
-		TVecSwizzledData<T, 3, 0, 1> xy;
-		TVecSwizzledData<T, 3, 0, 2> xz;
-		TVecSwizzledData<T, 3, 1, 0> yx;
-		TVecSwizzledData<T, 3, 1, 1> yy;
-		TVecSwizzledData<T, 3, 1, 2> yz;
-		TVecSwizzledData<T, 3, 2, 0> zx;
-		TVecSwizzledData<T, 3, 2, 1> zy;
-		TVecSwizzledData<T, 3, 2, 2> zz;
-		TVecSwizzledData<T, 3, 0, 0, 0> xxx;
-		TVecSwizzledData<T, 3, 0, 0, 1> xxy;
-		TVecSwizzledData<T, 3, 0, 0, 2> xxz;
-		TVecSwizzledData<T, 3, 0, 1, 0> xyx;
-		TVecSwizzledData<T, 3, 0, 1, 1> xyy;
-		TVecSwizzledData<T, 3, 0, 1, 2> xyz;
-		TVecSwizzledData<T, 3, 0, 2, 0> xzx;
-		TVecSwizzledData<T, 3, 0, 2, 1> xzy;
-		TVecSwizzledData<T, 3, 0, 2, 2> xzz;
-		TVecSwizzledData<T, 3, 1, 0, 0> yxx;
-		TVecSwizzledData<T, 3, 1, 0, 1> yxy;
-		TVecSwizzledData<T, 3, 1, 0, 2> yxz;
-		TVecSwizzledData<T, 3, 1, 1, 0> yyx;
-		TVecSwizzledData<T, 3, 1, 1, 1> yyy;
-		TVecSwizzledData<T, 3, 1, 1, 2> yyz;
-		TVecSwizzledData<T, 3, 1, 2, 0> yzx;
-		TVecSwizzledData<T, 3, 1, 2, 1> yzy;
-		TVecSwizzledData<T, 3, 1, 2, 2> yzz;
-		TVecSwizzledData<T, 3, 2, 0, 0> zxx;
-		TVecSwizzledData<T, 3, 2, 0, 1> zxy;
-		TVecSwizzledData<T, 3, 2, 0, 2> zxz;
-		TVecSwizzledData<T, 3, 2, 1, 0> zyx;
-		TVecSwizzledData<T, 3, 2, 1, 1> zyy;
-		TVecSwizzledData<T, 3, 2, 1, 2> zyz;
-		TVecSwizzledData<T, 3, 2, 2, 0> zzx;
-		TVecSwizzledData<T, 3, 2, 2, 1> zzy;
-		TVecSwizzledData<T, 3, 2, 2, 2> zzz;
-		TVecSwizzledData<T, 3, 0, 0, 0, 0> xxxx;
-		TVecSwizzledData<T, 3, 0, 0, 0, 1> xxxy;
-		TVecSwizzledData<T, 3, 0, 0, 0, 2> xxxz;
-		TVecSwizzledData<T, 3, 0, 0, 1, 0> xxyx;
-		TVecSwizzledData<T, 3, 0, 0, 1, 1> xxyy;
-		TVecSwizzledData<T, 3, 0, 0, 1, 2> xxyz;
-		TVecSwizzledData<T, 3, 0, 0, 2, 0> xxzx;
-		TVecSwizzledData<T, 3, 0, 0, 2, 1> xxzy;
-		TVecSwizzledData<T, 3, 0, 0, 2, 2> xxzz;
-		TVecSwizzledData<T, 3, 0, 1, 0, 0> xyxx;
-		TVecSwizzledData<T, 3, 0, 1, 0, 1> xyxy;
-		TVecSwizzledData<T, 3, 0, 1, 0, 2> xyxz;
-		TVecSwizzledData<T, 3, 0, 1, 1, 0> xyyx;
-		TVecSwizzledData<T, 3, 0, 1, 1, 1> xyyy;
-		TVecSwizzledData<T, 3, 0, 1, 1, 2> xyyz;
-		TVecSwizzledData<T, 3, 0, 1, 2, 0> xyzx;
-		TVecSwizzledData<T, 3, 0, 1, 2, 1> xyzy;
-		TVecSwizzledData<T, 3, 0, 1, 2, 2> xyzz;
-		TVecSwizzledData<T, 3, 0, 2, 0, 0> xzxx;
-		TVecSwizzledData<T, 3, 0, 2, 0, 1> xzxy;
-		TVecSwizzledData<T, 3, 0, 2, 0, 2> xzxz;
-		TVecSwizzledData<T, 3, 0, 2, 1, 0> xzyx;
-		TVecSwizzledData<T, 3, 0, 2, 1, 1> xzyy;
-		TVecSwizzledData<T, 3, 0, 2, 1, 2> xzyz;
-		TVecSwizzledData<T, 3, 0, 2, 2, 0> xzzx;
-		TVecSwizzledData<T, 3, 0, 2, 2, 1> xzzy;
-		TVecSwizzledData<T, 3, 0, 2, 2, 2> xzzz;
-		TVecSwizzledData<T, 3, 1, 0, 0, 0> yxxx;
-		TVecSwizzledData<T, 3, 1, 0, 0, 1> yxxy;
-		TVecSwizzledData<T, 3, 1, 0, 0, 2> yxxz;
-		TVecSwizzledData<T, 3, 1, 0, 1, 0> yxyx;
-		TVecSwizzledData<T, 3, 1, 0, 1, 1> yxyy;
-		TVecSwizzledData<T, 3, 1, 0, 1, 2> yxyz;
-		TVecSwizzledData<T, 3, 1, 0, 2, 0> yxzx;
-		TVecSwizzledData<T, 3, 1, 0, 2, 1> yxzy;
-		TVecSwizzledData<T, 3, 1, 0, 2, 2> yxzz;
-		TVecSwizzledData<T, 3, 1, 1, 0, 0> yyxx;
-		TVecSwizzledData<T, 3, 1, 1, 0, 1> yyxy;
-		TVecSwizzledData<T, 3, 1, 1, 0, 2> yyxz;
-		TVecSwizzledData<T, 3, 1, 1, 1, 0> yyyx;
-		TVecSwizzledData<T, 3, 1, 1, 1, 1> yyyy;
-		TVecSwizzledData<T, 3, 1, 1, 1, 2> yyyz;
-		TVecSwizzledData<T, 3, 1, 1, 2, 0> yyzx;
-		TVecSwizzledData<T, 3, 1, 1, 2, 1> yyzy;
-		TVecSwizzledData<T, 3, 1, 1, 2, 2> yyzz;
-		TVecSwizzledData<T, 3, 1, 2, 0, 0> yzxx;
-		TVecSwizzledData<T, 3, 1, 2, 0, 1> yzxy;
-		TVecSwizzledData<T, 3, 1, 2, 0, 2> yzxz;
-		TVecSwizzledData<T, 3, 1, 2, 1, 0> yzyx;
-		TVecSwizzledData<T, 3, 1, 2, 1, 1> yzyy;
-		TVecSwizzledData<T, 3, 1, 2, 1, 2> yzyz;
-		TVecSwizzledData<T, 3, 1, 2, 2, 0> yzzx;
-		TVecSwizzledData<T, 3, 1, 2, 2, 1> yzzy;
-		TVecSwizzledData<T, 3, 1, 2, 2, 2> yzzz;
-		TVecSwizzledData<T, 3, 2, 0, 0, 0> zxxx;
-		TVecSwizzledData<T, 3, 2, 0, 0, 1> zxxy;
-		TVecSwizzledData<T, 3, 2, 0, 0, 2> zxxz;
-		TVecSwizzledData<T, 3, 2, 0, 1, 0> zxyx;
-		TVecSwizzledData<T, 3, 2, 0, 1, 1> zxyy;
-		TVecSwizzledData<T, 3, 2, 0, 1, 2> zxyz;
-		TVecSwizzledData<T, 3, 2, 0, 2, 0> zxzx;
-		TVecSwizzledData<T, 3, 2, 0, 2, 1> zxzy;
-		TVecSwizzledData<T, 3, 2, 0, 2, 2> zxzz;
-		TVecSwizzledData<T, 3, 2, 1, 0, 0> zyxx;
-		TVecSwizzledData<T, 3, 2, 1, 0, 1> zyxy;
-		TVecSwizzledData<T, 3, 2, 1, 0, 2> zyxz;
-		TVecSwizzledData<T, 3, 2, 1, 1, 0> zyyx;
-		TVecSwizzledData<T, 3, 2, 1, 1, 1> zyyy;
-		TVecSwizzledData<T, 3, 2, 1, 1, 2> zyyz;
-		TVecSwizzledData<T, 3, 2, 1, 2, 0> zyzx;
-		TVecSwizzledData<T, 3, 2, 1, 2, 1> zyzy;
-		TVecSwizzledData<T, 3, 2, 1, 2, 2> zyzz;
-		TVecSwizzledData<T, 3, 2, 2, 0, 0> zzxx;
-		TVecSwizzledData<T, 3, 2, 2, 0, 1> zzxy;
-		TVecSwizzledData<T, 3, 2, 2, 0, 2> zzxz;
-		TVecSwizzledData<T, 3, 2, 2, 1, 0> zzyx;
-		TVecSwizzledData<T, 3, 2, 2, 1, 1> zzyy;
-		TVecSwizzledData<T, 3, 2, 2, 1, 2> zzyz;
-		TVecSwizzledData<T, 3, 2, 2, 2, 0> zzzx;
-		TVecSwizzledData<T, 3, 2, 2, 2, 1> zzzy;
-		TVecSwizzledData<T, 3, 2, 2, 2, 2> zzzz;
-	};
-};
-
-template<typename T>
-class TVecData<T, 4>
-{
-public:
-#if ANKI_SIMD_SSE
-	using Simd = __m128;
-#elif ANKI_SIMD_NEON
-	using Simd = float32x4_t;
-#endif
-
-	union
-	{
-		struct
-		{
-			T x;
-			T y;
-			T z;
-			T w;
-		};
-
-		T m_carr[4];
-		Array<T, 4> m_arr;
-		Simd m_simd;
-
-		TVec4SpecialData<T, 4, 0> xyz0;
-		TVec4SpecialData<T, 4, 1> xyz1;
-
-		TVecSwizzledData<T, 4, 0, 0> xx;
-		TVecSwizzledData<T, 4, 0, 1> xy;
-		TVecSwizzledData<T, 4, 0, 2> xz;
-		TVecSwizzledData<T, 4, 0, 3> xw;
-		TVecSwizzledData<T, 4, 1, 0> yx;
-		TVecSwizzledData<T, 4, 1, 1> yy;
-		TVecSwizzledData<T, 4, 1, 2> yz;
-		TVecSwizzledData<T, 4, 1, 3> yw;
-		TVecSwizzledData<T, 4, 2, 0> zx;
-		TVecSwizzledData<T, 4, 2, 1> zy;
-		TVecSwizzledData<T, 4, 2, 2> zz;
-		TVecSwizzledData<T, 4, 2, 3> zw;
-		TVecSwizzledData<T, 4, 3, 0> wx;
-		TVecSwizzledData<T, 4, 3, 1> wy;
-		TVecSwizzledData<T, 4, 3, 2> wz;
-		TVecSwizzledData<T, 4, 3, 3> ww;
-		TVecSwizzledData<T, 4, 0, 0, 0> xxx;
-		TVecSwizzledData<T, 4, 0, 0, 1> xxy;
-		TVecSwizzledData<T, 4, 0, 0, 2> xxz;
-		TVecSwizzledData<T, 4, 0, 0, 3> xxw;
-		TVecSwizzledData<T, 4, 0, 1, 0> xyx;
-		TVecSwizzledData<T, 4, 0, 1, 1> xyy;
-		TVecSwizzledData<T, 4, 0, 1, 2> xyz;
-		TVecSwizzledData<T, 4, 0, 1, 3> xyw;
-		TVecSwizzledData<T, 4, 0, 2, 0> xzx;
-		TVecSwizzledData<T, 4, 0, 2, 1> xzy;
-		TVecSwizzledData<T, 4, 0, 2, 2> xzz;
-		TVecSwizzledData<T, 4, 0, 2, 3> xzw;
-		TVecSwizzledData<T, 4, 0, 3, 0> xwx;
-		TVecSwizzledData<T, 4, 0, 3, 1> xwy;
-		TVecSwizzledData<T, 4, 0, 3, 2> xwz;
-		TVecSwizzledData<T, 4, 0, 3, 3> xww;
-		TVecSwizzledData<T, 4, 1, 0, 0> yxx;
-		TVecSwizzledData<T, 4, 1, 0, 1> yxy;
-		TVecSwizzledData<T, 4, 1, 0, 2> yxz;
-		TVecSwizzledData<T, 4, 1, 0, 3> yxw;
-		TVecSwizzledData<T, 4, 1, 1, 0> yyx;
-		TVecSwizzledData<T, 4, 1, 1, 1> yyy;
-		TVecSwizzledData<T, 4, 1, 1, 2> yyz;
-		TVecSwizzledData<T, 4, 1, 1, 3> yyw;
-		TVecSwizzledData<T, 4, 1, 2, 0> yzx;
-		TVecSwizzledData<T, 4, 1, 2, 1> yzy;
-		TVecSwizzledData<T, 4, 1, 2, 2> yzz;
-		TVecSwizzledData<T, 4, 1, 2, 3> yzw;
-		TVecSwizzledData<T, 4, 1, 3, 0> ywx;
-		TVecSwizzledData<T, 4, 1, 3, 1> ywy;
-		TVecSwizzledData<T, 4, 1, 3, 2> ywz;
-		TVecSwizzledData<T, 4, 1, 3, 3> yww;
-		TVecSwizzledData<T, 4, 2, 0, 0> zxx;
-		TVecSwizzledData<T, 4, 2, 0, 1> zxy;
-		TVecSwizzledData<T, 4, 2, 0, 2> zxz;
-		TVecSwizzledData<T, 4, 2, 0, 3> zxw;
-		TVecSwizzledData<T, 4, 2, 1, 0> zyx;
-		TVecSwizzledData<T, 4, 2, 1, 1> zyy;
-		TVecSwizzledData<T, 4, 2, 1, 2> zyz;
-		TVecSwizzledData<T, 4, 2, 1, 3> zyw;
-		TVecSwizzledData<T, 4, 2, 2, 0> zzx;
-		TVecSwizzledData<T, 4, 2, 2, 1> zzy;
-		TVecSwizzledData<T, 4, 2, 2, 2> zzz;
-		TVecSwizzledData<T, 4, 2, 2, 3> zzw;
-		TVecSwizzledData<T, 4, 2, 3, 0> zwx;
-		TVecSwizzledData<T, 4, 2, 3, 1> zwy;
-		TVecSwizzledData<T, 4, 2, 3, 2> zwz;
-		TVecSwizzledData<T, 4, 2, 3, 3> zww;
-		TVecSwizzledData<T, 4, 3, 0, 0> wxx;
-		TVecSwizzledData<T, 4, 3, 0, 1> wxy;
-		TVecSwizzledData<T, 4, 3, 0, 2> wxz;
-		TVecSwizzledData<T, 4, 3, 0, 3> wxw;
-		TVecSwizzledData<T, 4, 3, 1, 0> wyx;
-		TVecSwizzledData<T, 4, 3, 1, 1> wyy;
-		TVecSwizzledData<T, 4, 3, 1, 2> wyz;
-		TVecSwizzledData<T, 4, 3, 1, 3> wyw;
-		TVecSwizzledData<T, 4, 3, 2, 0> wzx;
-		TVecSwizzledData<T, 4, 3, 2, 1> wzy;
-		TVecSwizzledData<T, 4, 3, 2, 2> wzz;
-		TVecSwizzledData<T, 4, 3, 2, 3> wzw;
-		TVecSwizzledData<T, 4, 3, 3, 0> wwx;
-		TVecSwizzledData<T, 4, 3, 3, 1> wwy;
-		TVecSwizzledData<T, 4, 3, 3, 2> wwz;
-		TVecSwizzledData<T, 4, 3, 3, 3> www;
-		TVecSwizzledData<T, 4, 0, 0, 0, 0> xxxx;
-		TVecSwizzledData<T, 4, 0, 0, 0, 1> xxxy;
-		TVecSwizzledData<T, 4, 0, 0, 0, 2> xxxz;
-		TVecSwizzledData<T, 4, 0, 0, 0, 3> xxxw;
-		TVecSwizzledData<T, 4, 0, 0, 1, 0> xxyx;
-		TVecSwizzledData<T, 4, 0, 0, 1, 1> xxyy;
-		TVecSwizzledData<T, 4, 0, 0, 1, 2> xxyz;
-		TVecSwizzledData<T, 4, 0, 0, 1, 3> xxyw;
-		TVecSwizzledData<T, 4, 0, 0, 2, 0> xxzx;
-		TVecSwizzledData<T, 4, 0, 0, 2, 1> xxzy;
-		TVecSwizzledData<T, 4, 0, 0, 2, 2> xxzz;
-		TVecSwizzledData<T, 4, 0, 0, 2, 3> xxzw;
-		TVecSwizzledData<T, 4, 0, 0, 3, 0> xxwx;
-		TVecSwizzledData<T, 4, 0, 0, 3, 1> xxwy;
-		TVecSwizzledData<T, 4, 0, 0, 3, 2> xxwz;
-		TVecSwizzledData<T, 4, 0, 0, 3, 3> xxww;
-		TVecSwizzledData<T, 4, 0, 1, 0, 0> xyxx;
-		TVecSwizzledData<T, 4, 0, 1, 0, 1> xyxy;
-		TVecSwizzledData<T, 4, 0, 1, 0, 2> xyxz;
-		TVecSwizzledData<T, 4, 0, 1, 0, 3> xyxw;
-		TVecSwizzledData<T, 4, 0, 1, 1, 0> xyyx;
-		TVecSwizzledData<T, 4, 0, 1, 1, 1> xyyy;
-		TVecSwizzledData<T, 4, 0, 1, 1, 2> xyyz;
-		TVecSwizzledData<T, 4, 0, 1, 1, 3> xyyw;
-		TVecSwizzledData<T, 4, 0, 1, 2, 0> xyzx;
-		TVecSwizzledData<T, 4, 0, 1, 2, 1> xyzy;
-		TVecSwizzledData<T, 4, 0, 1, 2, 2> xyzz;
-		TVecSwizzledData<T, 4, 0, 1, 2, 3> xyzw;
-		TVecSwizzledData<T, 4, 0, 1, 3, 0> xywx;
-		TVecSwizzledData<T, 4, 0, 1, 3, 1> xywy;
-		TVecSwizzledData<T, 4, 0, 1, 3, 2> xywz;
-		TVecSwizzledData<T, 4, 0, 1, 3, 3> xyww;
-		TVecSwizzledData<T, 4, 0, 2, 0, 0> xzxx;
-		TVecSwizzledData<T, 4, 0, 2, 0, 1> xzxy;
-		TVecSwizzledData<T, 4, 0, 2, 0, 2> xzxz;
-		TVecSwizzledData<T, 4, 0, 2, 0, 3> xzxw;
-		TVecSwizzledData<T, 4, 0, 2, 1, 0> xzyx;
-		TVecSwizzledData<T, 4, 0, 2, 1, 1> xzyy;
-		TVecSwizzledData<T, 4, 0, 2, 1, 2> xzyz;
-		TVecSwizzledData<T, 4, 0, 2, 1, 3> xzyw;
-		TVecSwizzledData<T, 4, 0, 2, 2, 0> xzzx;
-		TVecSwizzledData<T, 4, 0, 2, 2, 1> xzzy;
-		TVecSwizzledData<T, 4, 0, 2, 2, 2> xzzz;
-		TVecSwizzledData<T, 4, 0, 2, 2, 3> xzzw;
-		TVecSwizzledData<T, 4, 0, 2, 3, 0> xzwx;
-		TVecSwizzledData<T, 4, 0, 2, 3, 1> xzwy;
-		TVecSwizzledData<T, 4, 0, 2, 3, 2> xzwz;
-		TVecSwizzledData<T, 4, 0, 2, 3, 3> xzww;
-		TVecSwizzledData<T, 4, 0, 3, 0, 0> xwxx;
-		TVecSwizzledData<T, 4, 0, 3, 0, 1> xwxy;
-		TVecSwizzledData<T, 4, 0, 3, 0, 2> xwxz;
-		TVecSwizzledData<T, 4, 0, 3, 0, 3> xwxw;
-		TVecSwizzledData<T, 4, 0, 3, 1, 0> xwyx;
-		TVecSwizzledData<T, 4, 0, 3, 1, 1> xwyy;
-		TVecSwizzledData<T, 4, 0, 3, 1, 2> xwyz;
-		TVecSwizzledData<T, 4, 0, 3, 1, 3> xwyw;
-		TVecSwizzledData<T, 4, 0, 3, 2, 0> xwzx;
-		TVecSwizzledData<T, 4, 0, 3, 2, 1> xwzy;
-		TVecSwizzledData<T, 4, 0, 3, 2, 2> xwzz;
-		TVecSwizzledData<T, 4, 0, 3, 2, 3> xwzw;
-		TVecSwizzledData<T, 4, 0, 3, 3, 0> xwwx;
-		TVecSwizzledData<T, 4, 0, 3, 3, 1> xwwy;
-		TVecSwizzledData<T, 4, 0, 3, 3, 2> xwwz;
-		TVecSwizzledData<T, 4, 0, 3, 3, 3> xwww;
-		TVecSwizzledData<T, 4, 1, 0, 0, 0> yxxx;
-		TVecSwizzledData<T, 4, 1, 0, 0, 1> yxxy;
-		TVecSwizzledData<T, 4, 1, 0, 0, 2> yxxz;
-		TVecSwizzledData<T, 4, 1, 0, 0, 3> yxxw;
-		TVecSwizzledData<T, 4, 1, 0, 1, 0> yxyx;
-		TVecSwizzledData<T, 4, 1, 0, 1, 1> yxyy;
-		TVecSwizzledData<T, 4, 1, 0, 1, 2> yxyz;
-		TVecSwizzledData<T, 4, 1, 0, 1, 3> yxyw;
-		TVecSwizzledData<T, 4, 1, 0, 2, 0> yxzx;
-		TVecSwizzledData<T, 4, 1, 0, 2, 1> yxzy;
-		TVecSwizzledData<T, 4, 1, 0, 2, 2> yxzz;
-		TVecSwizzledData<T, 4, 1, 0, 2, 3> yxzw;
-		TVecSwizzledData<T, 4, 1, 0, 3, 0> yxwx;
-		TVecSwizzledData<T, 4, 1, 0, 3, 1> yxwy;
-		TVecSwizzledData<T, 4, 1, 0, 3, 2> yxwz;
-		TVecSwizzledData<T, 4, 1, 0, 3, 3> yxww;
-		TVecSwizzledData<T, 4, 1, 1, 0, 0> yyxx;
-		TVecSwizzledData<T, 4, 1, 1, 0, 1> yyxy;
-		TVecSwizzledData<T, 4, 1, 1, 0, 2> yyxz;
-		TVecSwizzledData<T, 4, 1, 1, 0, 3> yyxw;
-		TVecSwizzledData<T, 4, 1, 1, 1, 0> yyyx;
-		TVecSwizzledData<T, 4, 1, 1, 1, 1> yyyy;
-		TVecSwizzledData<T, 4, 1, 1, 1, 2> yyyz;
-		TVecSwizzledData<T, 4, 1, 1, 1, 3> yyyw;
-		TVecSwizzledData<T, 4, 1, 1, 2, 0> yyzx;
-		TVecSwizzledData<T, 4, 1, 1, 2, 1> yyzy;
-		TVecSwizzledData<T, 4, 1, 1, 2, 2> yyzz;
-		TVecSwizzledData<T, 4, 1, 1, 2, 3> yyzw;
-		TVecSwizzledData<T, 4, 1, 1, 3, 0> yywx;
-		TVecSwizzledData<T, 4, 1, 1, 3, 1> yywy;
-		TVecSwizzledData<T, 4, 1, 1, 3, 2> yywz;
-		TVecSwizzledData<T, 4, 1, 1, 3, 3> yyww;
-		TVecSwizzledData<T, 4, 1, 2, 0, 0> yzxx;
-		TVecSwizzledData<T, 4, 1, 2, 0, 1> yzxy;
-		TVecSwizzledData<T, 4, 1, 2, 0, 2> yzxz;
-		TVecSwizzledData<T, 4, 1, 2, 0, 3> yzxw;
-		TVecSwizzledData<T, 4, 1, 2, 1, 0> yzyx;
-		TVecSwizzledData<T, 4, 1, 2, 1, 1> yzyy;
-		TVecSwizzledData<T, 4, 1, 2, 1, 2> yzyz;
-		TVecSwizzledData<T, 4, 1, 2, 1, 3> yzyw;
-		TVecSwizzledData<T, 4, 1, 2, 2, 0> yzzx;
-		TVecSwizzledData<T, 4, 1, 2, 2, 1> yzzy;
-		TVecSwizzledData<T, 4, 1, 2, 2, 2> yzzz;
-		TVecSwizzledData<T, 4, 1, 2, 2, 3> yzzw;
-		TVecSwizzledData<T, 4, 1, 2, 3, 0> yzwx;
-		TVecSwizzledData<T, 4, 1, 2, 3, 1> yzwy;
-		TVecSwizzledData<T, 4, 1, 2, 3, 2> yzwz;
-		TVecSwizzledData<T, 4, 1, 2, 3, 3> yzww;
-		TVecSwizzledData<T, 4, 1, 3, 0, 0> ywxx;
-		TVecSwizzledData<T, 4, 1, 3, 0, 1> ywxy;
-		TVecSwizzledData<T, 4, 1, 3, 0, 2> ywxz;
-		TVecSwizzledData<T, 4, 1, 3, 0, 3> ywxw;
-		TVecSwizzledData<T, 4, 1, 3, 1, 0> ywyx;
-		TVecSwizzledData<T, 4, 1, 3, 1, 1> ywyy;
-		TVecSwizzledData<T, 4, 1, 3, 1, 2> ywyz;
-		TVecSwizzledData<T, 4, 1, 3, 1, 3> ywyw;
-		TVecSwizzledData<T, 4, 1, 3, 2, 0> ywzx;
-		TVecSwizzledData<T, 4, 1, 3, 2, 1> ywzy;
-		TVecSwizzledData<T, 4, 1, 3, 2, 2> ywzz;
-		TVecSwizzledData<T, 4, 1, 3, 2, 3> ywzw;
-		TVecSwizzledData<T, 4, 1, 3, 3, 0> ywwx;
-		TVecSwizzledData<T, 4, 1, 3, 3, 1> ywwy;
-		TVecSwizzledData<T, 4, 1, 3, 3, 2> ywwz;
-		TVecSwizzledData<T, 4, 1, 3, 3, 3> ywww;
-		TVecSwizzledData<T, 4, 2, 0, 0, 0> zxxx;
-		TVecSwizzledData<T, 4, 2, 0, 0, 1> zxxy;
-		TVecSwizzledData<T, 4, 2, 0, 0, 2> zxxz;
-		TVecSwizzledData<T, 4, 2, 0, 0, 3> zxxw;
-		TVecSwizzledData<T, 4, 2, 0, 1, 0> zxyx;
-		TVecSwizzledData<T, 4, 2, 0, 1, 1> zxyy;
-		TVecSwizzledData<T, 4, 2, 0, 1, 2> zxyz;
-		TVecSwizzledData<T, 4, 2, 0, 1, 3> zxyw;
-		TVecSwizzledData<T, 4, 2, 0, 2, 0> zxzx;
-		TVecSwizzledData<T, 4, 2, 0, 2, 1> zxzy;
-		TVecSwizzledData<T, 4, 2, 0, 2, 2> zxzz;
-		TVecSwizzledData<T, 4, 2, 0, 2, 3> zxzw;
-		TVecSwizzledData<T, 4, 2, 0, 3, 0> zxwx;
-		TVecSwizzledData<T, 4, 2, 0, 3, 1> zxwy;
-		TVecSwizzledData<T, 4, 2, 0, 3, 2> zxwz;
-		TVecSwizzledData<T, 4, 2, 0, 3, 3> zxww;
-		TVecSwizzledData<T, 4, 2, 1, 0, 0> zyxx;
-		TVecSwizzledData<T, 4, 2, 1, 0, 1> zyxy;
-		TVecSwizzledData<T, 4, 2, 1, 0, 2> zyxz;
-		TVecSwizzledData<T, 4, 2, 1, 0, 3> zyxw;
-		TVecSwizzledData<T, 4, 2, 1, 1, 0> zyyx;
-		TVecSwizzledData<T, 4, 2, 1, 1, 1> zyyy;
-		TVecSwizzledData<T, 4, 2, 1, 1, 2> zyyz;
-		TVecSwizzledData<T, 4, 2, 1, 1, 3> zyyw;
-		TVecSwizzledData<T, 4, 2, 1, 2, 0> zyzx;
-		TVecSwizzledData<T, 4, 2, 1, 2, 1> zyzy;
-		TVecSwizzledData<T, 4, 2, 1, 2, 2> zyzz;
-		TVecSwizzledData<T, 4, 2, 1, 2, 3> zyzw;
-		TVecSwizzledData<T, 4, 2, 1, 3, 0> zywx;
-		TVecSwizzledData<T, 4, 2, 1, 3, 1> zywy;
-		TVecSwizzledData<T, 4, 2, 1, 3, 2> zywz;
-		TVecSwizzledData<T, 4, 2, 1, 3, 3> zyww;
-		TVecSwizzledData<T, 4, 2, 2, 0, 0> zzxx;
-		TVecSwizzledData<T, 4, 2, 2, 0, 1> zzxy;
-		TVecSwizzledData<T, 4, 2, 2, 0, 2> zzxz;
-		TVecSwizzledData<T, 4, 2, 2, 0, 3> zzxw;
-		TVecSwizzledData<T, 4, 2, 2, 1, 0> zzyx;
-		TVecSwizzledData<T, 4, 2, 2, 1, 1> zzyy;
-		TVecSwizzledData<T, 4, 2, 2, 1, 2> zzyz;
-		TVecSwizzledData<T, 4, 2, 2, 1, 3> zzyw;
-		TVecSwizzledData<T, 4, 2, 2, 2, 0> zzzx;
-		TVecSwizzledData<T, 4, 2, 2, 2, 1> zzzy;
-		TVecSwizzledData<T, 4, 2, 2, 2, 2> zzzz;
-		TVecSwizzledData<T, 4, 2, 2, 2, 3> zzzw;
-		TVecSwizzledData<T, 4, 2, 2, 3, 0> zzwx;
-		TVecSwizzledData<T, 4, 2, 2, 3, 1> zzwy;
-		TVecSwizzledData<T, 4, 2, 2, 3, 2> zzwz;
-		TVecSwizzledData<T, 4, 2, 2, 3, 3> zzww;
-		TVecSwizzledData<T, 4, 2, 3, 0, 0> zwxx;
-		TVecSwizzledData<T, 4, 2, 3, 0, 1> zwxy;
-		TVecSwizzledData<T, 4, 2, 3, 0, 2> zwxz;
-		TVecSwizzledData<T, 4, 2, 3, 0, 3> zwxw;
-		TVecSwizzledData<T, 4, 2, 3, 1, 0> zwyx;
-		TVecSwizzledData<T, 4, 2, 3, 1, 1> zwyy;
-		TVecSwizzledData<T, 4, 2, 3, 1, 2> zwyz;
-		TVecSwizzledData<T, 4, 2, 3, 1, 3> zwyw;
-		TVecSwizzledData<T, 4, 2, 3, 2, 0> zwzx;
-		TVecSwizzledData<T, 4, 2, 3, 2, 1> zwzy;
-		TVecSwizzledData<T, 4, 2, 3, 2, 2> zwzz;
-		TVecSwizzledData<T, 4, 2, 3, 2, 3> zwzw;
-		TVecSwizzledData<T, 4, 2, 3, 3, 0> zwwx;
-		TVecSwizzledData<T, 4, 2, 3, 3, 1> zwwy;
-		TVecSwizzledData<T, 4, 2, 3, 3, 2> zwwz;
-		TVecSwizzledData<T, 4, 2, 3, 3, 3> zwww;
-		TVecSwizzledData<T, 4, 3, 0, 0, 0> wxxx;
-		TVecSwizzledData<T, 4, 3, 0, 0, 1> wxxy;
-		TVecSwizzledData<T, 4, 3, 0, 0, 2> wxxz;
-		TVecSwizzledData<T, 4, 3, 0, 0, 3> wxxw;
-		TVecSwizzledData<T, 4, 3, 0, 1, 0> wxyx;
-		TVecSwizzledData<T, 4, 3, 0, 1, 1> wxyy;
-		TVecSwizzledData<T, 4, 3, 0, 1, 2> wxyz;
-		TVecSwizzledData<T, 4, 3, 0, 1, 3> wxyw;
-		TVecSwizzledData<T, 4, 3, 0, 2, 0> wxzx;
-		TVecSwizzledData<T, 4, 3, 0, 2, 1> wxzy;
-		TVecSwizzledData<T, 4, 3, 0, 2, 2> wxzz;
-		TVecSwizzledData<T, 4, 3, 0, 2, 3> wxzw;
-		TVecSwizzledData<T, 4, 3, 0, 3, 0> wxwx;
-		TVecSwizzledData<T, 4, 3, 0, 3, 1> wxwy;
-		TVecSwizzledData<T, 4, 3, 0, 3, 2> wxwz;
-		TVecSwizzledData<T, 4, 3, 0, 3, 3> wxww;
-		TVecSwizzledData<T, 4, 3, 1, 0, 0> wyxx;
-		TVecSwizzledData<T, 4, 3, 1, 0, 1> wyxy;
-		TVecSwizzledData<T, 4, 3, 1, 0, 2> wyxz;
-		TVecSwizzledData<T, 4, 3, 1, 0, 3> wyxw;
-		TVecSwizzledData<T, 4, 3, 1, 1, 0> wyyx;
-		TVecSwizzledData<T, 4, 3, 1, 1, 1> wyyy;
-		TVecSwizzledData<T, 4, 3, 1, 1, 2> wyyz;
-		TVecSwizzledData<T, 4, 3, 1, 1, 3> wyyw;
-		TVecSwizzledData<T, 4, 3, 1, 2, 0> wyzx;
-		TVecSwizzledData<T, 4, 3, 1, 2, 1> wyzy;
-		TVecSwizzledData<T, 4, 3, 1, 2, 2> wyzz;
-		TVecSwizzledData<T, 4, 3, 1, 2, 3> wyzw;
-		TVecSwizzledData<T, 4, 3, 1, 3, 0> wywx;
-		TVecSwizzledData<T, 4, 3, 1, 3, 1> wywy;
-		TVecSwizzledData<T, 4, 3, 1, 3, 2> wywz;
-		TVecSwizzledData<T, 4, 3, 1, 3, 3> wyww;
-		TVecSwizzledData<T, 4, 3, 2, 0, 0> wzxx;
-		TVecSwizzledData<T, 4, 3, 2, 0, 1> wzxy;
-		TVecSwizzledData<T, 4, 3, 2, 0, 2> wzxz;
-		TVecSwizzledData<T, 4, 3, 2, 0, 3> wzxw;
-		TVecSwizzledData<T, 4, 3, 2, 1, 0> wzyx;
-		TVecSwizzledData<T, 4, 3, 2, 1, 1> wzyy;
-		TVecSwizzledData<T, 4, 3, 2, 1, 2> wzyz;
-		TVecSwizzledData<T, 4, 3, 2, 1, 3> wzyw;
-		TVecSwizzledData<T, 4, 3, 2, 2, 0> wzzx;
-		TVecSwizzledData<T, 4, 3, 2, 2, 1> wzzy;
-		TVecSwizzledData<T, 4, 3, 2, 2, 2> wzzz;
-		TVecSwizzledData<T, 4, 3, 2, 2, 3> wzzw;
-		TVecSwizzledData<T, 4, 3, 2, 3, 0> wzwx;
-		TVecSwizzledData<T, 4, 3, 2, 3, 1> wzwy;
-		TVecSwizzledData<T, 4, 3, 2, 3, 2> wzwz;
-		TVecSwizzledData<T, 4, 3, 2, 3, 3> wzww;
-		TVecSwizzledData<T, 4, 3, 3, 0, 0> wwxx;
-		TVecSwizzledData<T, 4, 3, 3, 0, 1> wwxy;
-		TVecSwizzledData<T, 4, 3, 3, 0, 2> wwxz;
-		TVecSwizzledData<T, 4, 3, 3, 0, 3> wwxw;
-		TVecSwizzledData<T, 4, 3, 3, 1, 0> wwyx;
-		TVecSwizzledData<T, 4, 3, 3, 1, 1> wwyy;
-		TVecSwizzledData<T, 4, 3, 3, 1, 2> wwyz;
-		TVecSwizzledData<T, 4, 3, 3, 1, 3> wwyw;
-		TVecSwizzledData<T, 4, 3, 3, 2, 0> wwzx;
-		TVecSwizzledData<T, 4, 3, 3, 2, 1> wwzy;
-		TVecSwizzledData<T, 4, 3, 3, 2, 2> wwzz;
-		TVecSwizzledData<T, 4, 3, 3, 2, 3> wwzw;
-		TVecSwizzledData<T, 4, 3, 3, 3, 0> wwwx;
-		TVecSwizzledData<T, 4, 3, 3, 3, 1> wwwy;
-		TVecSwizzledData<T, 4, 3, 3, 3, 2> wwwz;
-		TVecSwizzledData<T, 4, 3, 3, 3, 3> wwww;
-	};
-};
-
-#if ANKI_COMPILER_MSVC
-#	pragma warning(pop)
-#elif ANKI_COMPILER_GCC_COMPATIBLE
-#	pragma GCC diagnostic pop
-#endif
-
-template<typename T, U32 kTComponentCount>
-class TVec : public TVecData<T, kTComponentCount>
-{
-public:
-	static constexpr Bool kVec4Simd = kTComponentCount == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
-	static constexpr Bool kIsInteger = std::is_integral<T>::value;
-
-	using Base = TVecData<T, kTComponentCount>;
-	using Base::m_arr;
-	using Base::m_simd;
-
-	// Constructors
-
-	constexpr TVec()
-		: TVec(T(0))
-	{
-	}
-
-	explicit TVec(T f)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_set1_ps(f);
-#else
-			m_simd = vdupq_n_f32(f);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; ++i)
-			{
-				m_arr[i] = f;
-			}
-		}
-	}
-
-	// Copy
-	TVec(const TVec& b)
-	{
-		if constexpr(kVec4Simd)
-		{
-			m_simd = b.m_simd;
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				m_arr[i] = b.m_arr[i];
-			}
-		}
-	}
-
-	// Convert from another type. From int to float vectors and the opposite.
-	template<typename Y>
-	explicit TVec(TVec<Y, kTComponentCount> b) requires(!std::is_same<Y, T>::value)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] = T(b[i]);
-		}
-	}
-
-	explicit TVec(T arr[])
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_load_ps(arr);
-#else
-			m_simd = vld1q_f32(arr);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; ++i)
-			{
-				m_arr[i] = arr[i];
-			}
-		}
-	}
-
-	explicit TVec(const Array<T, kTComponentCount>& arr)
-		: TVec(arr.getBegin())
-	{
-	}
-
-	// Vec2 specific
-
-	constexpr TVec(T x, T y) requires(kTComponentCount == 2)
-		: Base{x, y}
-	{
-	}
-
-	// Vec2 specific
-
-	constexpr TVec(T x, T y, T z) requires(kTComponentCount == 3)
-		: Base{x, y, z}
-	{
-	}
-
-	constexpr TVec(TVec<T, 2> a, T z) requires(kTComponentCount == 3)
-		: Base{a.m_arr[0], a.m_arr[1], z}
-	{
-	}
-
-	constexpr TVec(T x, TVec<T, 2> a) requires(kTComponentCount == 3)
-		: Base{x, a.m_arr[0], a.m_arr[1]}
-	{
-	}
-
-	// Vec4 specific
-
-	explicit TVec(T x, T y, T z, T w) requires(kTComponentCount == 4)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_set_ps(w, z, y, x);
-#else
-			alignas(16) T data[4] = {x, y, z, w};
-			m_simd = vld1q_f32(data);
-#endif
-		}
-		else
-		{
-			this->m_arr = {x, y, z, w};
-		}
-	}
-
-	constexpr TVec(TVec<T, 3> a, T w) requires(kTComponentCount == 4)
-		: Base{a.m_arr[0], a.m_arr[1], a.m_arr[2], w}
-	{
-	}
-
-	constexpr TVec(T x, TVec<T, 3> a) requires(kTComponentCount == 4)
-		: Base{x, a.m_arr[0], a.m_arr[1], a.m_arr[2]}
-	{
-	}
-
-	constexpr TVec(TVec<T, 2> a, T z, T w) requires(kTComponentCount == 4)
-		: Base{a.m_arr[0], a.m_arr[1], z, w}
-	{
-	}
-
-	constexpr TVec(T x, TVec<T, 2> a, T w) requires(kTComponentCount == 4)
-		: Base{x, a.m_arr[0], a.m_arr[1], w}
-	{
-	}
-
-	constexpr TVec(T x, T y, TVec<T, 2> a) requires(kTComponentCount == 4)
-		: Base{x, y, a.m_arr[0], a.m_arr[1]}
-	{
-	}
-
-	constexpr TVec(TVec<T, 2> a, TVec<T, 2> b) requires(kTComponentCount == 4)
-		: Base{a.m_arr[0], a.m_arr[1], b.m_arr[0], b.m_arr[1]}
-	{
-	}
-
-	explicit TVec(Base::Simd simd) requires(kTComponentCount == 4)
-	{
-		m_simd = simd;
-	}
-
-	// Accessors
-
-	T& operator[](U32 i)
-	{
-		return m_arr[i];
-	}
-
-	T operator[](U32 i) const
-	{
-		return m_arr[i];
-	}
-
-	// Operators with the same type
-
-	// Copy
-	TVec& operator=(const TVec& b)
-	{
-		if constexpr(kVec4Simd)
-		{
-			m_simd = b.m_simd;
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				m_arr[i] = b.m_carr[i];
-			}
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator+(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_add_ps(m_simd, b.m_simd));
-#else
-			return TVec(vaddq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				out.m_arr[i] = m_arr[i] + b.m_arr[i];
-			}
-
-			return out;
-		}
-	}
-
-	TVec& operator+=(TVec b)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_add_ps(m_simd, b.m_simd);
-#else
-			m_simd = vaddq_f32(m_simd, b.m_simd);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				m_arr[i] += b.m_arr[i];
-			}
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator-(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_sub_ps(m_simd, b.m_simd));
-#else
-			return TVec(vsubq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				out.m_arr[i] = m_arr[i] - b.m_arr[i];
-			}
-			return out;
-		}
-	}
-
-	TVec& operator-=(TVec b)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_sub_ps(m_simd, b.m_simd);
-#else
-			m_simd = vsubq_f32(m_simd, b.m_simd);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				m_arr[i] -= b.m_arr[i];
-			}
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator*(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_mul_ps(m_simd, b.m_simd));
-#else
-			return TVec(vmulq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				out.m_arr[i] = m_arr[i] * b.m_arr[i];
-			}
-			return out;
-		}
-	}
-
-	TVec& operator*=(TVec b)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_mul_ps(m_simd, b.m_simd);
-#else
-			m_simd = vmulq_f32(m_simd, b.m_simd);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				m_arr[i] *= b.m_arr[i];
-			}
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator/(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_div_ps(m_simd, b.m_simd));
-#else
-			return TVec(vdivq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				ANKI_ASSERT(b.m_arr[i] != 0.0);
-				out.m_arr[i] = m_arr[i] / b.m_arr[i];
-			}
-			return out;
-		}
-	}
-
-	TVec& operator/=(TVec b)
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			m_simd = _mm_div_ps(m_simd, b.m_simd);
-#else
-			m_simd = vdivq_f32(m_simd, b.m_simd);
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				ANKI_ASSERT(b.m_arr[i] != 0.0);
-				m_arr[i] /= b.m_arr[i];
-			}
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator-() const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_xor_ps(m_simd, _mm_set1_ps(-0.0)));
-#else
-			return TVec(veorq_s32(m_simd, vdupq_n_f32(-0.0)));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				out.m_arr[i] = -m_arr[i];
-			}
-			return out;
-		}
-	}
-
-	[[nodiscard]] TVec operator<<(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] << b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator<<=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] <<= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator>>(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] >> b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator>>=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] >>= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator&(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] & b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator&=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] &= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator|(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] | b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator|=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] |= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator^(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] ^ b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator^=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] ^= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator%(TVec b) const requires(kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			out.m_arr[i] = m_arr[i] % b.m_arr[i];
-		}
-		return out;
-	}
-
-	TVec& operator%=(TVec b) requires(kIsInteger)
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			m_arr[i] %= b.m_arr[i];
-		}
-		return *this;
-	}
-
-	[[nodiscard]] Bool operator==(TVec b) const
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			if(!isZero<T>(m_arr[i] - b.m_arr[i]))
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	[[nodiscard]] Bool operator!=(TVec b) const
-	{
-		return !operator==(b);
-	}
-
-	[[nodiscard]] Bool operator<(TVec b) const
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			if(m_arr[i] >= b.m_arr[i])
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	[[nodiscard]] Bool operator<=(TVec b) const
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			if(m_arr[i] > b.m_arr[i])
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	[[nodiscard]] Bool operator>(TVec b) const
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			if(m_arr[i] <= b.m_arr[i])
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	[[nodiscard]] Bool operator>=(TVec b) const
-	{
-		for(U i = 0; i < kTComponentCount; i++)
-		{
-			if(m_arr[i] < b.m_arr[i])
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	// Operators with T
-
-	[[nodiscard]] TVec operator+(T f) const
-	{
-		return (*this) + TVec(f);
-	}
-
-	TVec& operator+=(T f)
-	{
-		(*this) += TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator-(T f) const
-	{
-		return (*this) - TVec(f);
-	}
-
-	TVec& operator-=(T f)
-	{
-		(*this) -= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator*(T f) const
-	{
-		return (*this) * TVec(f);
-	}
-
-	TVec& operator*=(T f)
-	{
-		(*this) *= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator/(T f) const
-	{
-		return (*this) / TVec(f);
-	}
-
-	TVec& operator/=(T f)
-	{
-		(*this) /= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator<<(T f) const requires(kIsInteger)
-	{
-		return (*this) << TVec(f);
-	}
-
-	TVec& operator<<=(T f) requires(kIsInteger)
-	{
-		(*this) <<= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator>>(T f) const requires(kIsInteger)
-	{
-		return (*this) >> TVec(f);
-	}
-
-	TVec& operator>>=(T f) requires(kIsInteger)
-	{
-		(*this) >>= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator&(T f) const requires(kIsInteger)
-	{
-		return (*this) & TVec(f);
-	}
-
-	TVec& operator&=(T f) requires(kIsInteger)
-	{
-		(*this) &= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator|(T f) const requires(kIsInteger)
-	{
-		return (*this) | TVec(f);
-	}
-
-	TVec& operator|=(T f) requires(kIsInteger)
-	{
-		(*this) |= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator^(T f) const requires(kIsInteger)
-	{
-		return (*this) ^ TVec(f);
-	}
-
-	TVec& operator^=(T f) requires(kIsInteger)
-	{
-		(*this) ^= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] TVec operator%(T f) const requires(kIsInteger)
-	{
-		return (*this) % TVec(f);
-	}
-
-	TVec& operator%=(T f) requires(kIsInteger)
-	{
-		(*this) %= TVec(f);
-		return *this;
-	}
-
-	[[nodiscard]] Bool operator==(T f) const
-	{
-		return *this == TVec(f);
-	}
-
-	[[nodiscard]] Bool operator!=(T f) const
-	{
-		return *this != TVec(f);
-	}
-
-	[[nodiscard]] Bool operator<(T f) const
-	{
-		return *this < TVec(f);
-	}
-
-	[[nodiscard]] Bool operator<=(T f) const
-	{
-		return *this <= TVec(f);
-	}
-
-	[[nodiscard]] Bool operator>(T f) const
-	{
-		return *this > TVec(f);
-	}
-
-	[[nodiscard]] Bool operator>=(T f) const
-	{
-		return *this >= TVec(f);
-	}
-
-	// Operators with other
-
-	[[nodiscard]] TVec operator*(const TMat<T, 4, 4>& m4) const requires(kTComponentCount == 4)
-	{
-		TVec out;
-		out.x = this->x * m4(0, 0) + this->y * m4(1, 0) + this->z * m4(2, 0) + this->w * m4(3, 0);
-		out.y = this->x * m4(0, 1) + this->y * m4(1, 1) + this->z * m4(2, 1) + this->w * m4(3, 1);
-		out.z = this->x * m4(0, 2) + this->y * m4(1, 2) + this->z * m4(2, 2) + this->w * m4(3, 2);
-		out.w = this->x * m4(0, 3) + this->y * m4(1, 3) + this->z * m4(2, 3) + this->w * m4(3, 3);
-		return out;
-	}
-
-	// Other
-
-	[[nodiscard]] T dot(TVec b) const
-	{
-		T out = T(0);
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			_mm_store_ss(&out, _mm_dp_ps(m_simd, b.m_simd, 0xF1));
-#else
-			out = vaddvq_f32(vmulq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			for(U i = 0; i < kTComponentCount; i++)
-			{
-				out += m_arr[i] * b.m_arr[i];
-			}
-		}
-		return out;
-	}
-
-	// 6 muls, 3 adds
-	[[nodiscard]] TVec cross(TVec b) const requires(kTComponentCount == 3)
-	{
-		return TVec(this->y * b.z - this->z * b.y, this->z * b.x - this->x * b.z, this->x * b.y - this->y * b.x);
-	}
-
-	// It's like calculating the cross of a 3 component TVec.
-	[[nodiscard]] TVec cross(TVec b_) const requires(kTComponentCount == 4)
-	{
-		ANKI_ASSERT(this->w == T(0));
-		ANKI_ASSERT(b_.w() == T(0));
-
-#if ANKI_SIMD_SSE
-		const auto& a = m_simd;
-		const auto& b = b_.m_simd;
-
-		__m128 t1 = _mm_shuffle_ps(b, b, _MM_SHUFFLE(0, 0, 2, 1));
-		t1 = _mm_mul_ps(t1, a);
-		__m128 t2 = _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 2, 1));
-		t2 = _mm_mul_ps(t2, b);
-		__m128 t3 = _mm_sub_ps(t1, t2);
-
-		return TVec(_mm_shuffle_ps(t3, t3, _MM_SHUFFLE(0, 0, 2, 1))).xyz0;
-#elif ANKI_SIMD_NEON
-		const auto& a = m_simd;
-		const auto& b = b_.m_simd;
-
-		float32x4_t t1 = ANKI_NEON_SHUFFLE_F32x4(b, b, 0, 0, 2, 1);
-		t1 = vmulq_f32(t1, a);
-		float32x4_t t2 = ANKI_NEON_SHUFFLE_F32x4(a, a, 0, 0, 2, 1);
-		t2 = vmulq_f32(t2, b);
-		float32x4_t t3 = vsubq_f32(t1, t2);
-
-		return TVec(ANKI_NEON_SHUFFLE_F32x4(t3, t3, 0, 0, 2, 1)).xyz0;
-#else
-		return TVec(xyz.cross(b_.xyz), T(0));
-#endif
-	}
-
-	[[nodiscard]] TVec projectTo(TVec toThis) const requires(kTComponentCount == 3 || kTComponentCount == 2)
-	{
-		return toThis * ((*this).dot(toThis) / (toThis.dot(toThis)));
-	}
-
-	[[nodiscard]] TVec projectTo(TVec toThis) const requires(kTComponentCount == 4)
-	{
-		ANKI_ASSERT(this->w == T(0));
-		return (toThis * ((*this).dot(toThis) / (toThis.dot(toThis)))).xyz0;
-	}
-
-	[[nodiscard]] TVec projectTo(TVec rayOrigin, TVec rayDir) const requires(kTComponentCount == 3 || kTComponentCount == 2)
-	{
-		const auto& a = *this;
-		return rayOrigin + rayDir * ((a - rayOrigin).dot(rayDir));
-	}
-
-	[[nodiscard]] TVec projectTo(TVec rayOrigin, TVec rayDir) const requires(kTComponentCount == 4)
-	{
-		ANKI_ASSERT(this->w == T(0));
-		ANKI_ASSERT(rayOrigin.w() == T(0));
-		ANKI_ASSERT(rayDir.w() == T(0));
-		const auto& a = *this;
-		return rayOrigin + rayDir * ((a - rayOrigin).dot(rayDir));
-	}
-
-	// Perspective divide. Divide the xyzw of this to the w of this. This method will handle some edge cases.
-	[[nodiscard]] TVec perspectiveDivide() const requires(kTComponentCount == 4 && !kIsInteger)
-	{
-		auto invw = T(1) / this->w; // This may become (+-)inf
-		invw = (invw > T(1e+11)) ? T(1e+11) : invw; // Clamp
-		invw = (invw < T(-1e+11)) ? T(-1e+11) : invw; // Clamp
-		return (*this) * invw;
-	}
-
-	[[nodiscard]] T lengthSquared() const
-	{
-		return dot(*this);
-	}
-
-	[[nodiscard]] T length() const
-	{
-		return sqrt<T>(lengthSquared());
-	}
-
-	[[nodiscard]] T distanceSquared(TVec b) const
-	{
-		return ((*this) - b).lengthSquared();
-	}
-
-	[[nodiscard]] T distance(TVec b) const
-	{
-		return sqrt<T>(distance(b));
-	}
-
-	[[nodiscard]] TVec normalize() const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			__m128 v = _mm_dp_ps(m_simd, m_simd, 0xFF);
-			v = _mm_sqrt_ps(v);
-			v = _mm_div_ps(m_simd, v);
-			return TVec(v);
-#else
-			float32x4_t v = vmulq_f32(m_simd, m_simd);
-			v = vdupq_n_f32(vaddvq_f32(v));
-			v = vsqrtq_f32(v);
-			v = vdivq_f32(m_simd, v);
-			return TVec(v);
-#endif
-		}
-		else
-		{
-			return (*this) / length();
-		}
-	}
-
-	// Return lerp(this, v1, t)
-	[[nodiscard]] TVec lerp(TVec v1, TVec t) const
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			out[i] = m_arr[i] * (T(1) - t.m_arr[i]) + v1.m_arr[i] * t.m_arr[i];
-		}
-		return out;
-	}
-
-	// Return lerp(this, v1, t)
-	[[nodiscard]] TVec lerp(TVec v1, T t) const
-	{
-		return ((*this) * (T(1) - t)) + (v1 * t);
-	}
-
-	[[nodiscard]] TVec abs() const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			const __m128 signMask = _mm_set1_ps(-0.0f);
-			return TVec(_mm_andnot_ps(signMask, m_simd));
-#else
-			return TVec(vabsq_f32(m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; ++i)
-			{
-				out[i] = absolute<T>(m_arr[i]);
-			}
-			return out;
-		}
-	}
-
-	// Get clamped between two values.
-	[[nodiscard]] TVec clamp(T minv, T maxv) const
-	{
-		return max(TVec(minv)).min(TVec(maxv));
-	}
-
-	// Get clamped between two vectors.
-	[[nodiscard]] TVec clamp(TVec minv, TVec maxv) const
-	{
-		return max(minv).min(maxv);
-	}
-
-	// Get the min of all components.
-	[[nodiscard]] TVec min(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_min_ps(m_simd, b.m_simd));
-#else
-			return TVec(vminq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; ++i)
-			{
-				out[i] = anki::min<T>(m_arr[i], b[i]);
-			}
-			return out;
-		}
-	}
-
-	// Get the min of all components.
-	[[nodiscard]] TVec min(T b) const
-	{
-		return min(TVec(b));
-	}
-
-	// Get the max of all components.
-	[[nodiscard]] TVec max(TVec b) const
-	{
-		if constexpr(kVec4Simd)
-		{
-#if ANKI_SIMD_SSE
-			return TVec(_mm_max_ps(m_simd, b.m_simd));
-#else
-			return TVec(vmaxq_f32(m_simd, b.m_simd));
-#endif
-		}
-		else
-		{
-			TVec out;
-			for(U i = 0; i < kTComponentCount; ++i)
-			{
-				out[i] = anki::max<T>(m_arr[i], b[i]);
-			}
-			return out;
-		}
-	}
-
-	// Get the max of all components.
-	[[nodiscard]] TVec max(T b) const
-	{
-		return max(TVec(b));
-	}
-
-	[[nodiscard]] TVec round() const requires(!kIsInteger)
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			out[i] = T(::round(m_arr[i]));
-		}
-		return out;
-	}
-
-	// Get a safe 1 / (*this)
-	[[nodiscard]] TVec reciprocal() const
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			out[i] = T(1) / m_arr[i];
-		}
-		return out;
-	}
-
-	// Power
-	[[nodiscard]] TVec pow(TVec b) const
-	{
-		TVec out;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			out[i] = anki::pow(m_arr[i], b.m_arr[i]);
-		}
-		return out;
-	}
-
-	// Power
-	[[nodiscard]] TVec pow(T b) const
-	{
-		return pow(TVec(b));
-	}
-
-	[[nodiscard]] static TVec xAxis() requires(kTComponentCount == 2)
-	{
-		return TVec(T(1), T(0));
-	}
-
-	[[nodiscard]] static TVec xAxis() requires(kTComponentCount == 3)
-	{
-		return TVec(T(1), T(0), T(0));
-	}
-
-	[[nodiscard]] static TVec xAxis() requires(kTComponentCount == 4)
-	{
-		return TVec(T(1), T(0), T(0), T(0));
-	}
-
-	[[nodiscard]] static TVec yAxis() requires(kTComponentCount == 2)
-	{
-		return TVec(T(0), T(1));
-	}
-
-	[[nodiscard]] static TVec yAxis() requires(kTComponentCount == 3)
-	{
-		return TVec(T(0), T(1), T(0));
-	}
-
-	[[nodiscard]] static TVec yAxis() requires(kTComponentCount == 4)
-	{
-		return TVec(T(0), T(1), T(0), T(0));
-	}
-
-	[[nodiscard]] static TVec zAxis() requires(kTComponentCount == 3)
-	{
-		return TVec(T(0), T(0), T(1));
-	}
-
-	[[nodiscard]] static TVec zAxis() requires(kTComponentCount == 4)
-	{
-		return TVec(T(0), T(0), T(1), T(0));
-	}
-
-	// Serialize the structure.
-	void serialize(void* data, PtrSize& size) const
-	{
-		size = sizeof(*this);
-		if(data)
-		{
-			memcpy(data, this, sizeof(*this));
-		}
-	}
-
-	// De-serialize the structure.
-	void deserialize(const void* data)
-	{
-		ANKI_ASSERT(data);
-		memcpy(this, data, sizeof(*this));
-	}
-
-	[[nodiscard]] static constexpr U8 getSize()
-	{
-		return U8(kTComponentCount);
-	}
-
-	[[nodiscard]] String toString() const requires(std::is_floating_point<T>::value)
-	{
-		String str;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			str += String().sprintf((i < i - kTComponentCount) ? "%f " : "%f", m_arr[i]);
-		}
-		return str;
-	}
-
-	static constexpr Bool kClangWorkaround = std::is_integral<T>::value && std::is_unsigned<T>::value;
-	[[nodiscard]] String toString() const requires(kClangWorkaround)
-	{
-		String str;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			str += String().sprintf((i < i - kTComponentCount) ? "%u " : "%u", m_arr[i]);
-		}
-		return str;
-	}
-
-	static constexpr Bool kClangWorkaround2 = std::is_integral<T>::value && std::is_signed<T>::value;
-	[[nodiscard]] String toString() const requires(kClangWorkaround2)
-	{
-		String str;
-		for(U i = 0; i < kTComponentCount; ++i)
-		{
-			str += String().sprintf((i < i - kTComponentCount) ? "%d " : "%d", m_arr[i]);
-		}
-		return str;
-	}
-};
-
-template<typename T, U kTComponentCount>
-TVec<T, kTComponentCount> operator+(T f, TVec<T, kTComponentCount> v)
-{
-	return v + f;
-}
-
-template<typename T, U kTComponentCount>
-TVec<T, kTComponentCount> operator-(T f, TVec<T, kTComponentCount> v)
-{
-	return TVec<T, kTComponentCount>(f) - v;
-}
-
-template<typename T, U kTComponentCount>
-TVec<T, kTComponentCount> operator*(T f, TVec<T, kTComponentCount> v)
-{
-	return v * f;
-}
-
-template<typename T, U kTComponentCount>
-TVec<T, kTComponentCount> operator/(T f, TVec<T, kTComponentCount> v)
-{
-	return TVec<T, kTComponentCount>(f) / v;
-}
-
-// All vectors
-using Vec2 = TVec<F32, 2>;
-using HVec2 = TVec<F16, 2>;
-using IVec2 = TVec<I32, 2>;
-using I16Vec2 = TVec<I16, 2>;
-using I8Vec2 = TVec<I8, 2>;
-using UVec2 = TVec<U32, 2>;
-using U16Vec2 = TVec<U16, 2>;
-using U8Vec2 = TVec<U8, 2>;
-using Vec3 = TVec<F32, 3>;
-using HVec3 = TVec<F16, 3>;
-using IVec3 = TVec<I32, 3>;
-using I16Vec3 = TVec<I16, 3>;
-using I8Vec3 = TVec<I8, 3>;
-using UVec3 = TVec<U32, 3>;
-using U16Vec3 = TVec<U16, 3>;
-using U8Vec3 = TVec<U8, 3>;
-using Vec4 = TVec<F32, 4>;
-using HVec4 = TVec<F16, 4>;
-using IVec4 = TVec<I32, 4>;
-using I16Vec4 = TVec<I16, 4>;
-using I8Vec4 = TVec<I8, 4>;
-using UVec4 = TVec<U32, 4>;
-using U16Vec4 = TVec<U16, 4>;
-using U8Vec4 = TVec<U8, 4>;
-
-} // end namespace v2
-} // end namespace anki

+ 1 - 1
AnKi/Physics/Common.h

@@ -227,7 +227,7 @@ public:
 
 inline JPH::RVec3 toJPH(Vec3 ak)
 {
-	return JPH::RVec3(ak.x(), ak.y(), ak.z());
+	return JPH::RVec3(ak.x, ak.y, ak.z);
 }
 
 inline JPH::Quat toJPH(Quat ak)

+ 4 - 4
AnKi/Physics/PhysicsBody.cpp

@@ -52,15 +52,15 @@ void PhysicsBody::init(const PhysicsBodyInitInfo& init)
 
 	PhysicsWorld& world = PhysicsWorld::getSingleton();
 
-	const Vec3 pos = init.m_transform.getOrigin().xyz();
+	const Vec3 pos = init.m_transform.getOrigin().xyz;
 	const Quat rot = Quat(init.m_transform.getRotation());
 
 	// Create a scale shape
-	const Bool hasScale = (init.m_transform.getScale().xyz() - 1.0).lengthSquared() > kEpsilonf * 10.0;
+	const Bool hasScale = (init.m_transform.getScale().xyz - 1.0).lengthSquared() > kEpsilonf * 10.0;
 	PhysicsCollisionShapePtr scaledShape;
 	if(hasScale)
 	{
-		scaledShape = world.newScaleCollisionObject(init.m_transform.getScale().xyz(), init.m_shape);
+		scaledShape = world.newScaleCollisionObject(init.m_transform.getScale().xyz, init.m_shape);
 	}
 
 	// Create JPH body
@@ -114,7 +114,7 @@ void PhysicsBody::setPositionAndRotation(Vec3 position, const Mat3& rotation)
 
 	PhysicsWorld::getSingleton().m_jphPhysicsSystem->GetBodyInterfaceNoLock().SetPositionAndRotation(m_jphBody->GetID(), pos, rot,
 																									 JPH::EActivation::Activate);
-	m_worldTrf.setOrigin(position.xyz0());
+	m_worldTrf.setOrigin(position.xyz0);
 	m_worldTrf.setRotation(rotation);
 	++m_worldTrfVersion;
 }

+ 2 - 2
AnKi/Physics/PhysicsWorld.cpp

@@ -543,7 +543,7 @@ PhysicsCollisionShapePtr PhysicsWorld::newStaticMeshShape(ConstWeakArray<Vec3> p
 	verts.resize(positions.getSize());
 	for(U32 i = 0; i < positions.getSize(); ++i)
 	{
-		verts[i] = {positions[i].x(), positions[i].y(), positions[i].z()};
+		verts[i] = {positions[i].x, positions[i].y, positions[i].z};
 	}
 
 	JPH::IndexedTriangleList idx;
@@ -630,7 +630,7 @@ PhysicsJointPtr PhysicsWorld::newHingeJoint(PhysicsBody* body1, PhysicsBody* bod
 	JPH::HingeConstraintSettings settings;
 	settings.SetEmbedded();
 
-	settings.mPoint1 = settings.mPoint2 = toJPH(pivot.getOrigin().xyz());
+	settings.mPoint1 = settings.mPoint2 = toJPH(pivot.getOrigin().xyz);
 	settings.mHingeAxis1 = settings.mHingeAxis2 = toJPH(pivot.getRotation().getXAxis());
 
 	settings.mNormalAxis1 = settings.mNormalAxis2 = toJPH(pivot.getRotation().getYAxis());

+ 2 - 2
AnKi/Renderer/AccelerationStructureBuilder.cpp

@@ -23,7 +23,7 @@ void AccelerationStructureBuilder::populateRenderGraph(RenderingContext& ctx)
 
 		GpuVisibilityAccelerationStructuresInput in;
 		in.m_passesName = "Main TLAS visiblity";
-		in.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+		in.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 		in.m_lodDistances = lodDistances;
 		in.m_pointOfTest = in.m_lodReferencePoint;
 		in.m_testRadius = g_cvarRenderRtExtendedFrustumDistance;
@@ -71,7 +71,7 @@ void AccelerationStructureBuilder::populateRenderGraph(RenderingContext& ctx)
 		GpuVisibilityLocalLightsInput in;
 		in.m_cellCounts = UVec3(g_cvarRenderRtLightGridCellCountXZ, g_cvarRenderRtLightGridCellCountY, g_cvarRenderRtLightGridCellCountXZ);
 		in.m_cellSize = Vec3(g_cvarRenderRtLightGridSizeXZ, g_cvarRenderRtLightGridSizeY, g_cvarRenderRtLightGridSizeXZ) / Vec3(in.m_cellCounts);
-		in.m_cameraPosition = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+		in.m_cameraPosition = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 		in.m_lookDirection = -ctx.m_matrices.m_cameraTransform.getRotationPart().getZAxis();
 		in.m_lightIndexListSize = g_cvarRenderRtLightIndexListSize;
 		in.m_rgraph = &ctx.m_renderGraphDescr;

+ 4 - 4
AnKi/Renderer/Bloom.cpp

@@ -16,13 +16,13 @@ Error Bloom::init()
 	// Pyramid
 	{
 		const UVec2 pyramidSize = getRenderer().getInternalResolution() / 2;
-		const U8 pyramidMipCount = computeMaxMipmapCount2d(pyramidSize.x(), pyramidSize.y(), g_cvarRenderBloomPyramidLowLimit);
+		const U8 pyramidMipCount = computeMaxMipmapCount2d(pyramidSize.x, pyramidSize.y, g_cvarRenderBloomPyramidLowLimit);
 
 		const Bool preferCompute = g_cvarRenderPreferCompute;
 
 		// Create the miped texture
 		TextureInitInfo texinit =
-			getRenderer().create2DRenderTargetDescription(pyramidSize.x(), pyramidSize.y(), getRenderer().getHdrFormat(), "Bloom pyramid");
+			getRenderer().create2DRenderTargetDescription(pyramidSize.x, pyramidSize.y, getRenderer().getHdrFormat(), "Bloom pyramid");
 		texinit.m_usage = TextureUsageBit::kSrvPixel | TextureUsageBit::kSrvCompute;
 		texinit.m_usage |= (preferCompute) ? TextureUsageBit::kUavCompute : TextureUsageBit::kRtvDsvWrite;
 		texinit.m_mipmapCount = pyramidMipCount;
@@ -39,7 +39,7 @@ Error Bloom::init()
 		const UVec2 expSize = pyramidSmallerMipSize * 2; // Upacale a bit
 
 		// Create RT info
-		m_exposureRtDesc = getRenderer().create2DRenderTargetDescription(expSize.x(), expSize.y(), getRenderer().getHdrFormat(), "Bloom exposure");
+		m_exposureRtDesc = getRenderer().create2DRenderTargetDescription(expSize.x, expSize.y, getRenderer().getHdrFormat(), "Bloom exposure");
 		m_exposureRtDesc.bake();
 
 		// init shaders
@@ -51,7 +51,7 @@ Error Bloom::init()
 		const UVec2 size = getRenderer().getPostProcessResolution() / g_cvarRenderBloomUpscaleDivisor;
 
 		// Create RT descr
-		m_finalRtDesc = getRenderer().create2DRenderTargetDescription(size.x(), size.y(), getRenderer().getHdrFormat(), "Bloom final");
+		m_finalRtDesc = getRenderer().create2DRenderTargetDescription(size.x, size.y, getRenderer().getHdrFormat(), "Bloom final");
 		m_finalRtDesc.bake();
 
 		// init shaders

+ 6 - 6
AnKi/Renderer/ClusterBinning.cpp

@@ -49,7 +49,7 @@ void ClusterBinning::populateRenderGraph(RenderingContext& ctx)
 
 	// Allocate the clusters buffer
 	{
-		const U32 clusterCount = getRenderer().getTileCounts().x() * getRenderer().getTileCounts().y() + getRenderer().getZSplitCount();
+		const U32 clusterCount = getRenderer().getTileCounts().x * getRenderer().getTileCounts().y + getRenderer().getZSplitCount();
 		m_runCtx.m_clustersBuffer = GpuVisibleTransientMemoryPool::getSingleton().allocateStructuredBuffer<Cluster>(clusterCount);
 		m_runCtx.m_dep = rgraph.importBuffer(m_runCtx.m_clustersBuffer, BufferUsageBit::kNone);
 	}
@@ -78,7 +78,7 @@ void ClusterBinning::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.bindShaderProgram(m_jobSetupGrProg.get());
 
-			const UVec4 consts(getRenderer().getTileCounts().x() * getRenderer().getTileCounts().y());
+			const UVec4 consts(getRenderer().getTileCounts().x * getRenderer().getTileCounts().y);
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
 			for(GpuSceneNonRenderableObjectType type : EnumIterable<GpuSceneNonRenderableObjectType>())
@@ -178,15 +178,15 @@ void ClusterBinning::populateRenderGraph(RenderingContext& ctx)
 					Mat4 m_invertedViewProjMat;
 				} consts;
 
-				consts.m_cameraOrigin = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+				consts.m_cameraOrigin = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 				consts.m_zSplitCountOverFrustumLength = F32(getRenderer().getZSplitCount()) / (ctx.m_matrices.m_far - ctx.m_matrices.m_near);
 				consts.m_renderingSize = Vec2(getRenderer().getInternalResolution());
-				consts.m_tileCountX = getRenderer().getTileCounts().x();
-				consts.m_tileCount = getRenderer().getTileCounts().x() * getRenderer().getTileCounts().y();
+				consts.m_tileCountX = getRenderer().getTileCounts().x;
+				consts.m_tileCount = getRenderer().getTileCounts().x * getRenderer().getTileCounts().y;
 
 				Plane nearPlane;
 				extractClipPlane(ctx.m_matrices.m_viewProjection, FrustumPlaneType::kNear, nearPlane);
-				consts.m_nearPlaneWorld = Vec4(nearPlane.getNormal().xyz(), nearPlane.getOffset());
+				consts.m_nearPlaneWorld = Vec4(nearPlane.getNormal().xyz, nearPlane.getOffset());
 
 				consts.m_zSplitCountMinusOne = getRenderer().getZSplitCount() - 1;
 

+ 7 - 7
AnKi/Renderer/Dbg.cpp

@@ -404,16 +404,16 @@ Dbg::~Dbg()
 Error Dbg::init()
 {
 	// RT descr
-	m_rtDescr = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+	m_rtDescr = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 															  Format::kR8G8B8A8_Unorm, "Dbg");
 	m_rtDescr.bake();
 
 	m_objectPickingRtDescr = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR32_Uint, "ObjectPicking");
+		getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR32_Uint, "ObjectPicking");
 	m_objectPickingRtDescr.bake();
 
 	m_objectPickingDepthRtDescr = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kD32_Sfloat, "ObjectPickingDepth");
+		getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kD32_Sfloat, "ObjectPickingDepth");
 	m_objectPickingDepthRtDescr.bake();
 
 	ResourceManager& rsrcManager = ResourceManager::getSingleton();
@@ -633,7 +633,7 @@ void Dbg::populateRenderGraphMain(RenderingContext& ctx)
 		CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
 		// Set common state
-		cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+		cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		cmdb.setDepthWrite(false);
 
 		cmdb.setBlendFactors(0, BlendFactor::kSrcAlpha, BlendFactor::kOneMinusSrcAlpha);
@@ -727,7 +727,7 @@ void Dbg::populateRenderGraphMain(RenderingContext& ctx)
 							break;
 						}
 
-						m_positions.emplaceBack(HVec4(pos.xyz0()));
+						m_positions.emplaceBack(HVec4(Vec4(pos.xyz0)));
 						m_colors.emplaceBack(color);
 					}
 				}
@@ -934,7 +934,7 @@ void Dbg::populateRenderGraphObjectPicking(RenderingContext& ctx)
 				CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
 				// Set common state
-				cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2);
+				cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2);
 				cmdb.setDepthCompareOperation(CompareOperation::kLess);
 
 				ShaderProgramResourceVariantInitInfo variantInitInfo(m_dbgProg);
@@ -1022,7 +1022,7 @@ void Dbg::populateRenderGraphObjectPicking(RenderingContext& ctx)
 			cmdb.bindUav(0, 0, readbackBuff);
 
 			Vec2 mousePos = Input::getSingleton().getMousePositionNdc();
-			mousePos.y() = -mousePos.y();
+			mousePos.y = -mousePos.y;
 			mousePos = mousePos / 2.0f + 0.5f;
 			mousePos *= Vec2(getRenderer().getInternalResolution() / 2);
 

+ 1 - 1
AnKi/Renderer/Dbg.h

@@ -94,7 +94,7 @@ public:
 
 	void enableGizmos(const Transform& trf, Bool enableGizmos)
 	{
-		m_gizmos.m_trf = Mat3x4(trf.getOrigin().xyz(), trf.getRotation().getRotationPart());
+		m_gizmos.m_trf = Mat3x4(trf.getOrigin().xyz, trf.getRotation().getRotationPart());
 		m_gizmos.m_enabled = enableGizmos;
 	}
 

+ 4 - 4
AnKi/Renderer/DepthDownscale.cpp

@@ -34,8 +34,8 @@ DepthDownscale::~DepthDownscale()
 
 Error DepthDownscale::initInternal()
 {
-	const U32 width = getRenderer().getInternalResolution().x() / 2;
-	const U32 height = getRenderer().getInternalResolution().y() / 2;
+	const U32 width = getRenderer().getInternalResolution().x / 2;
+	const U32 height = getRenderer().getInternalResolution().y / 2;
 
 	m_mipCount = 2;
 
@@ -103,7 +103,7 @@ void DepthDownscale::populateRenderGraph(RenderingContext& ctx)
 			varAU2(dispatchThreadGroupCountXY);
 			varAU2(workGroupOffset); // needed if Left and Top are not 0,0
 			varAU2(numWorkGroupsAndMips);
-			varAU4(rectInfo) = initAU4(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			varAU4(rectInfo) = initAU4(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 			SpdSetup(dispatchThreadGroupCountXY, workGroupOffset, numWorkGroupsAndMips, rectInfo, m_mipCount);
 
 			DepthDownscaleConstants pc;
@@ -178,7 +178,7 @@ void DepthDownscale::populateRenderGraph(RenderingContext& ctx)
 				}
 
 				const UVec2 size = (getRenderer().getInternalResolution() / 2) >> mip;
-				cmdb.setViewport(0, 0, size.x(), size.y());
+				cmdb.setViewport(0, 0, size.x, size.y);
 				cmdb.draw(PrimitiveTopology::kTriangles, 3);
 			});
 		}

+ 2 - 2
AnKi/Renderer/FinalComposite.cpp

@@ -53,7 +53,7 @@ Error FinalComposite::initInternal()
 	if(getRenderer().getSwapchainResolution() != getRenderer().getPostProcessResolution())
 	{
 		m_rtDesc = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y(),
+			getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y,
 			(GrManager::getSingleton().getDeviceCapabilities().m_unalignedBbpTextureFormats) ? Format::kR8G8B8_Unorm : Format::kR8G8B8A8_Unorm,
 			"Final Composite");
 		m_rtDesc.bake();
@@ -213,7 +213,7 @@ void FinalComposite::populateRenderGraph(RenderingContext& ctx)
 			}
 		}
 
-		cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+		cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 		drawQuad(cmdb);
 
 		// Draw UI

+ 1 - 1
AnKi/Renderer/ForwardShading.cpp

@@ -33,7 +33,7 @@ void ForwardShading::populateRenderGraph(RenderingContext& ctx)
 	visIn.m_passesName = "FW shading";
 	visIn.m_technique = RenderingTechnique::kForward;
 	visIn.m_viewProjectionMatrix = ctx.m_matrices.m_viewProjection;
-	visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+	visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 	visIn.m_lodDistances = lodDistances;
 	visIn.m_rgraph = &rgraph;
 	visIn.m_gatherAabbIndices = !!(getDbg().getOptions() & DbgOption::kGatherAabbs);

+ 8 - 8
AnKi/Renderer/GBuffer.cpp

@@ -30,7 +30,7 @@ Error GBuffer::init()
 	{
 		const TextureUsageBit usage = TextureUsageBit::kAllSrv | TextureUsageBit::kAllRtvDsv;
 		TextureInitInfo texinit =
-			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 													   getRenderer().getDepthNoStencilFormat(), usage, depthRtNames[i]);
 
 		m_depthRts[i] = getRenderer().createAndClearRenderTarget(texinit, TextureUsageBit::kSrvPixel);
@@ -40,15 +40,15 @@ Error GBuffer::init()
 	for(U i = 0; i < kGBufferColorRenderTargetCount; ++i)
 	{
 		m_colorRtDescrs[i] = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), kGBufferColorRenderTargetFormats[i], rtNames[i]);
+			getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, kGBufferColorRenderTargetFormats[i], rtNames[i]);
 		m_colorRtDescrs[i].bake();
 	}
 
 	{
 		const TextureUsageBit usage = TextureUsageBit::kSrvCompute | TextureUsageBit::kUavCompute | TextureUsageBit::kSrvGeometry;
 
-		TextureInitInfo texinit = getRenderer().create2DRenderTargetInitInfo(previousPowerOfTwo(getRenderer().getInternalResolution().x()),
-																			 previousPowerOfTwo(getRenderer().getInternalResolution().y()),
+		TextureInitInfo texinit = getRenderer().create2DRenderTargetInitInfo(previousPowerOfTwo(getRenderer().getInternalResolution().x),
+																			 previousPowerOfTwo(getRenderer().getInternalResolution().y),
 																			 Format::kR32_Sfloat, usage, "GBuffer HZB");
 		texinit.m_mipmapCount = computeMaxMipmapCount2d(texinit.m_width, texinit.m_height);
 		ClearValue clear;
@@ -102,7 +102,7 @@ void GBuffer::populateRenderGraph(RenderingContext& ctx)
 		visIn.m_passesName = "GBuffer";
 		visIn.m_technique = RenderingTechnique::kGBuffer;
 		visIn.m_viewProjectionMatrix = matrices.m_viewProjection;
-		visIn.m_lodReferencePoint = matrices.m_cameraTransform.getTranslationPart().xyz();
+		visIn.m_lodReferencePoint = matrices.m_cameraTransform.getTranslationPart().xyz;
 		visIn.m_lodDistances = lodDistances;
 		visIn.m_rgraph = &rgraph;
 		visIn.m_hzbRt = &m_runCtx.m_hzbRt;
@@ -171,7 +171,7 @@ void GBuffer::populateRenderGraph(RenderingContext& ctx)
 			CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
 			// Set some state, leave the rest to default
-			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 
 			RenderableDrawerArguments args;
 			args.m_viewMatrix = ctx.m_matrices.m_view;
@@ -216,7 +216,7 @@ void GBuffer::populateRenderGraph(RenderingContext& ctx)
 						consts->m_viewportSize = Vec2(getRenderer().getInternalResolution());
 						consts->m_probeIdx = probe.getGpuSceneAllocation().getIndex();
 						consts->m_sphereRadius = 0.5f;
-						consts->m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+						consts->m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 						consts->m_pixelShift = (getRenderer().getFrameCount() & 1) ? 1.0f : 0.0f;
 
 						cmdb.draw(PrimitiveTopology::kTriangles, 6, probe.getCellCount());
@@ -238,7 +238,7 @@ void GBuffer::populateRenderGraph(RenderingContext& ctx)
 						consts->m_viewportSize = Vec2(getRenderer().getInternalResolution());
 						consts->m_probeIdx = probe.getGpuSceneAllocation().getIndex();
 						consts->m_sphereRadius = 0.5f;
-						consts->m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+						consts->m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 						consts->m_pixelShift = (getRenderer().getFrameCount() & 1) ? 1.0f : 0.0f;
 
 						cmdb.draw(PrimitiveTopology::kTriangles, 6);

+ 1 - 1
AnKi/Renderer/GBufferPost.cpp

@@ -54,7 +54,7 @@ void GBufferPost::populateRenderGraph(RenderingContext& ctx)
 
 		cmdb.bindShaderProgram(m_grProg.get());
 
-		dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+		dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 	});
 }
 

+ 3 - 3
AnKi/Renderer/HistoryLength.cpp

@@ -17,7 +17,7 @@ Error HistoryLength::init()
 		texUsage |= (g_cvarRenderPreferCompute) ? TextureUsageBit::kUavCompute : TextureUsageBit::kRtvDsvWrite;
 
 		const TextureInitInfo init =
-			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 													   Format::kR8_Unorm, texUsage, generateTempPassName("HistoryLen #%d", i));
 
 		m_historyLenTextures[i] = getRenderer().createAndClearRenderTarget(init, TextureUsageBit::kSrvCompute);
@@ -92,11 +92,11 @@ void HistoryLength::populateRenderGraph(RenderingContext& ctx)
 		if(g_cvarRenderPreferCompute)
 		{
 			rgraphCtx.bindUav(0, 0, current);
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		}
 		else
 		{
-			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 			drawQuad(cmdb);
 		}
 	});

+ 2 - 2
AnKi/Renderer/IndirectDiffuse.cpp

@@ -43,7 +43,7 @@ Error IndirectDiffuse::init()
 										GrManager::getSingleton().getDeviceCapabilities().m_shaderGroupHandleSize + U32(sizeof(UVec4)));
 
 	m_transientRtDesc1 = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat, "IndirectDiffuse #1");
+		getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR16G16B16A16_Sfloat, "IndirectDiffuse #1");
 	m_transientRtDesc1.bake();
 
 	return Error::kNone;
@@ -195,7 +195,7 @@ void IndirectDiffuse::populateRenderGraph(RenderingContext& ctx)
 			cmdb.setFastConstants(&dummyConsts, sizeof(dummyConsts));
 
 			cmdb.dispatchRays(sbtBuffer, m_sbtRecordSize, GpuSceneArrays::RenderableBoundingVolumeRt::getSingleton().getElementCount(), 1,
-							  getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), 1);
+							  getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, 1);
 		});
 	}
 

+ 76 - 81
AnKi/Renderer/IndirectDiffuseClipmaps.cpp

@@ -40,7 +40,7 @@ static void findClipmapInUpdateRanges(Vec3 newClipmapMin, Vec3 oldClipmapMin, Ve
 	const IVec3 delta = IVec3((newClipmapMin - oldClipmapMin) / probeSize);
 	const IVec3 absDelta = delta.abs();
 
-	if(absDelta.x() >= probeCounts.x() || absDelta.y() >= probeCounts.y() || absDelta.z() >= probeCounts.z())
+	if(absDelta.x >= probeCounts.x || absDelta.y >= probeCounts.y || absDelta.z >= probeCounts.z)
 	{
 		// No overlap between the old and new clipmap positions, full update
 
@@ -54,73 +54,70 @@ static void findClipmapInUpdateRanges(Vec3 newClipmapMin, Vec3 oldClipmapMin, Ve
 
 		IVec3 fullUpdateProbeRangeBegin(0);
 		IVec3 fullUpdateProbeRangeEnd(0);
-		if(delta.x() > 0)
+		if(delta.x > 0)
 		{
 			// New AABB on the right of old
-			fullUpdateProbeRangeBegin =
-				IVec3(partialUpdateProbeRangeEnd.x() - delta.x(), partialUpdateProbeRangeBegin.y(), partialUpdateProbeRangeBegin.z());
+			fullUpdateProbeRangeBegin = IVec3(partialUpdateProbeRangeEnd.x - delta.x, partialUpdateProbeRangeBegin.y, partialUpdateProbeRangeBegin.z);
 			fullUpdateProbeRangeEnd = partialUpdateProbeRangeEnd;
 
-			partialUpdateProbeRangeEnd.x() -= delta.x();
+			partialUpdateProbeRangeEnd.x -= delta.x;
 		}
-		else if(delta.x() < 0)
+		else if(delta.x < 0)
 		{
 			// New AABB on the left of old
 			fullUpdateProbeRangeBegin = partialUpdateProbeRangeBegin;
-			fullUpdateProbeRangeEnd = IVec3(-delta.x(), partialUpdateProbeRangeEnd.y(), partialUpdateProbeRangeEnd.z());
+			fullUpdateProbeRangeEnd = IVec3(-delta.x, partialUpdateProbeRangeEnd.y, partialUpdateProbeRangeEnd.z);
 
-			partialUpdateProbeRangeBegin.x() += -delta.x();
+			partialUpdateProbeRangeBegin.x += -delta.x;
 		}
 
-		if(delta.x() != 0)
+		if(delta.x != 0)
 		{
 			fullUpdateProbeRanges[fullUpdateProbeRangeCount++] = {fullUpdateProbeRangeBegin, fullUpdateProbeRangeEnd};
 		}
 
 		fullUpdateProbeRangeBegin = fullUpdateProbeRangeEnd = IVec3(0);
-		if(delta.y() > 0)
+		if(delta.y > 0)
 		{
 			// New AABB on the top of old
-			fullUpdateProbeRangeBegin =
-				IVec3(partialUpdateProbeRangeBegin.x(), partialUpdateProbeRangeEnd.y() - delta.y(), partialUpdateProbeRangeBegin.z());
+			fullUpdateProbeRangeBegin = IVec3(partialUpdateProbeRangeBegin.x, partialUpdateProbeRangeEnd.y - delta.y, partialUpdateProbeRangeBegin.z);
 			fullUpdateProbeRangeEnd = partialUpdateProbeRangeEnd;
 
-			partialUpdateProbeRangeEnd.y() -= delta.y();
+			partialUpdateProbeRangeEnd.y -= delta.y;
 		}
-		else if(delta.y() < 0)
+		else if(delta.y < 0)
 		{
 			// New AABB at the bottom of old
 			fullUpdateProbeRangeBegin = partialUpdateProbeRangeBegin;
-			fullUpdateProbeRangeEnd = IVec3(partialUpdateProbeRangeEnd.x(), -delta.y(), partialUpdateProbeRangeEnd.z());
+			fullUpdateProbeRangeEnd = IVec3(partialUpdateProbeRangeEnd.x, -delta.y, partialUpdateProbeRangeEnd.z);
 
-			partialUpdateProbeRangeBegin.y() += -delta.y();
+			partialUpdateProbeRangeBegin.y += -delta.y;
 		}
 
-		if(delta.y() != 0)
+		if(delta.y != 0)
 		{
 			fullUpdateProbeRanges[fullUpdateProbeRangeCount++] = {fullUpdateProbeRangeBegin, fullUpdateProbeRangeEnd};
 		}
 
 		fullUpdateProbeRangeBegin = fullUpdateProbeRangeEnd = IVec3(0);
-		if(delta.z() > 0)
+		if(delta.z > 0)
 		{
 			// New AABB on the front of old
-			fullUpdateProbeRangeBegin =
-				IVec3(partialUpdateProbeRangeBegin.x(), partialUpdateProbeRangeBegin.y(), partialUpdateProbeRangeEnd.z() - delta.z());
+			fullUpdateProbeRangeBegin = IVec3(partialUpdateProbeRangeBegin.x, partialUpdateProbeRangeBegin.y, partialUpdateProbeRangeEnd.z - delta.z);
 			fullUpdateProbeRangeEnd = partialUpdateProbeRangeEnd;
 
-			partialUpdateProbeRangeEnd.z() -= delta.z();
+			partialUpdateProbeRangeEnd.z -= delta.z;
 		}
-		else if(delta.z() < 0)
+		else if(delta.z < 0)
 		{
 			// New AABB on the back of old
 			fullUpdateProbeRangeBegin = partialUpdateProbeRangeBegin;
-			fullUpdateProbeRangeEnd = IVec3(partialUpdateProbeRangeEnd.x(), partialUpdateProbeRangeEnd.y(), -delta.z());
+			fullUpdateProbeRangeEnd = IVec3(partialUpdateProbeRangeEnd.x, partialUpdateProbeRangeEnd.y, -delta.z);
 
-			partialUpdateProbeRangeBegin.z() += -delta.z();
+			partialUpdateProbeRangeBegin.z += -delta.z;
 		}
 
-		if(delta.z() != 0)
+		if(delta.z != 0)
 		{
 			fullUpdateProbeRanges[fullUpdateProbeRangeCount++] = {fullUpdateProbeRangeBegin, fullUpdateProbeRangeEnd};
 		}
@@ -134,18 +131,18 @@ static void findClipmapInUpdateRanges(Vec3 newClipmapMin, Vec3 oldClipmapMin, Ve
 			const IVec3 end = fullUpdateProbeRanges[i].m_end;
 			const IVec3 begin = fullUpdateProbeRanges[i].m_begin;
 			const IVec3 diff = end - begin;
-			ANKI_ASSERT(diff.x() * diff.y() * diff.z() > 0);
-			totalProbeCount += diff.x() * diff.y() * diff.z();
+			ANKI_ASSERT(diff.x * diff.y * diff.z > 0);
+			totalProbeCount += diff.x * diff.y * diff.z;
 		}
 
 		{
 			const IVec3 end = partialUpdateProbeRange.m_end;
 			const IVec3 begin = partialUpdateProbeRange.m_begin;
 			const IVec3 diff = end - begin;
-			ANKI_ASSERT(diff.x() * diff.y() * diff.z() > 0);
-			totalProbeCount += diff.x() * diff.y() * diff.z();
+			ANKI_ASSERT(diff.x * diff.y * diff.z > 0);
+			totalProbeCount += diff.x * diff.y * diff.z;
 		}
-		ANKI_ASSERT(totalProbeCount == probeCounts.x() * probeCounts.y() * probeCounts.z());
+		ANKI_ASSERT(totalProbeCount == probeCounts.x * probeCounts.y * probeCounts.z);
 	}
 }
 
@@ -154,12 +151,12 @@ static void computeClipmapBounds(Vec3 cameraPos, Vec3 lookDir, U32 clipmapIdx, I
 	const Vec3 offset = lookDir * kIndirectDiffuseClipmapForwardBias * F32(clipmapIdx + 1);
 	cameraPos += offset;
 
-	const Vec3 halfSize = consts.m_sizes[clipmapIdx].xyz() * 0.5;
-	const Vec3 probeSize = consts.m_sizes[clipmapIdx].xyz() / Vec3(consts.m_probeCounts);
+	const Vec3 halfSize = consts.m_sizes[clipmapIdx].xyz * 0.5f;
+	const Vec3 probeSize = consts.m_sizes[clipmapIdx].xyz / Vec3(consts.m_probeCounts);
 	const Vec3 roundedPos = (cameraPos / probeSize).round() * probeSize;
-	consts.m_aabbMins[clipmapIdx] = (roundedPos - halfSize).xyz0();
+	consts.m_aabbMins[clipmapIdx] = (roundedPos - halfSize).xyz0;
 	[[maybe_unused]] const Vec3 aabbMax = roundedPos + halfSize;
-	ANKI_ASSERT(aabbMax - consts.m_aabbMins[clipmapIdx].xyz() == consts.m_sizes[clipmapIdx].xyz());
+	ANKI_ASSERT(aabbMax - consts.m_aabbMins[clipmapIdx].xyz == consts.m_sizes[clipmapIdx].xyz);
 }
 
 Error IndirectDiffuseClipmaps::init()
@@ -168,12 +165,12 @@ Error IndirectDiffuseClipmaps::init()
 
 	const Bool firstBounceUsesRt = g_cvarRenderIdcFirstBounceRayDistance > 0.0f;
 
-	m_lowRezRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x() / 2,
-																   getRenderer().getInternalResolution().y() / (!g_cvarRenderIdcApplyHighQuality + 1),
+	m_lowRezRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x / 2,
+																   getRenderer().getInternalResolution().y / (!g_cvarRenderIdcApplyHighQuality + 1),
 																   getRenderer().getHdrFormat(), "IndirectDiffuseClipmap: Apply rez");
 	m_lowRezRtDesc.bake();
 
-	m_fullRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+	m_fullRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 																 getRenderer().getHdrFormat(), "IndirectDiffuseClipmap: Full");
 	m_fullRtDesc.bake();
 
@@ -182,7 +179,7 @@ Error IndirectDiffuseClipmaps::init()
 		for(U32 i = 0; i < 2; ++i)
 		{
 			const TextureInitInfo init = getRenderer().create2DRenderTargetInitInfo(
-				getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat,
+				getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR16G16B16A16_Sfloat,
 				TextureUsageBit::kAllShaderResource, generateTempPassName("IndirectDiffuseClipmap: Final #%u", i));
 
 			m_irradianceRts[i] = getRenderer().createAndClearRenderTarget(init, TextureUsageBit::kSrvCompute);
@@ -190,19 +187,19 @@ Error IndirectDiffuseClipmaps::init()
 	}
 
 	m_consts.m_probeCounts = UVec3(g_cvarRenderIdcProbesXZ, g_cvarRenderIdcProbesY, g_cvarRenderIdcProbesXZ);
-	m_consts.m_totalProbeCount = m_consts.m_probeCounts.x() * m_consts.m_probeCounts.y() * m_consts.m_probeCounts.z();
+	m_consts.m_totalProbeCount = m_consts.m_probeCounts.x * m_consts.m_probeCounts.y * m_consts.m_probeCounts.z;
 
-	m_consts.m_sizes[0] = Vec3(g_cvarRenderIdcClipmap0XZSize, g_cvarRenderIdcClipmap0YSize, g_cvarRenderIdcClipmap0XZSize).xyz0();
-	m_consts.m_sizes[1] = Vec3(g_cvarRenderIdcClipmap1XZSize, g_cvarRenderIdcClipmap1YSize, g_cvarRenderIdcClipmap1XZSize).xyz0();
-	m_consts.m_sizes[2] = Vec3(g_cvarRenderIdcClipmap2XZSize, g_cvarRenderIdcClipmap2YSize, g_cvarRenderIdcClipmap2XZSize).xyz0();
+	m_consts.m_sizes[0] = Vec3(g_cvarRenderIdcClipmap0XZSize, g_cvarRenderIdcClipmap0YSize, g_cvarRenderIdcClipmap0XZSize).xyz0;
+	m_consts.m_sizes[1] = Vec3(g_cvarRenderIdcClipmap1XZSize, g_cvarRenderIdcClipmap1YSize, g_cvarRenderIdcClipmap1XZSize).xyz0;
+	m_consts.m_sizes[2] = Vec3(g_cvarRenderIdcClipmap2XZSize, g_cvarRenderIdcClipmap2YSize, g_cvarRenderIdcClipmap2XZSize).xyz0;
 
 	for(U32 i = 0; i < kIndirectDiffuseClipmapCount; ++i)
 	{
-		TextureInitInfo init = getRenderer().create2DRenderTargetInitInfo(m_consts.m_probeCounts.x(), m_consts.m_probeCounts.z(), Format::kR8_Unorm,
+		TextureInitInfo init = getRenderer().create2DRenderTargetInitInfo(m_consts.m_probeCounts.x, m_consts.m_probeCounts.z, Format::kR8_Unorm,
 																		  TextureUsageBit::kUavCompute | TextureUsageBit::kAllSrv,
 																		  generateTempPassName("IndirectDiffuseClipmap: Probe validity #%u", i));
 
-		init.m_depth = m_consts.m_probeCounts.y();
+		init.m_depth = m_consts.m_probeCounts.y;
 		init.m_type = TextureType::k3D;
 
 		m_probeValidityVolumes[i] = getRenderer().createAndClearRenderTarget(init, TextureUsageBit::kSrvCompute);
@@ -218,10 +215,10 @@ Error IndirectDiffuseClipmaps::init()
 	for(U32 clipmap = 0; clipmap < kIndirectDiffuseClipmapCount; ++clipmap)
 	{
 		TextureInitInfo volumeInit = getRenderer().create2DRenderTargetInitInfo(
-			m_consts.m_probeCounts.x() * (g_cvarRenderIdcRadianceOctMapSize + 2),
-			m_consts.m_probeCounts.z() * (g_cvarRenderIdcRadianceOctMapSize + 2), Format::kB10G11R11_Ufloat_Pack32,
-			TextureUsageBit::kAllShaderResource, generateTempPassName("IndirectDiffuseClipmap: Radiance #%u", clipmap));
-		volumeInit.m_depth = m_consts.m_probeCounts.y();
+			m_consts.m_probeCounts.x * (g_cvarRenderIdcRadianceOctMapSize + 2), m_consts.m_probeCounts.z * (g_cvarRenderIdcRadianceOctMapSize + 2),
+			Format::kB10G11R11_Ufloat_Pack32, TextureUsageBit::kAllShaderResource,
+			generateTempPassName("IndirectDiffuseClipmap: Radiance #%u", clipmap));
+		volumeInit.m_depth = m_consts.m_probeCounts.y;
 		volumeInit.m_type = TextureType::k3D;
 
 		m_radianceVolumes[clipmap] = getRenderer().createAndClearRenderTarget(volumeInit, TextureUsageBit::kSrvCompute);
@@ -230,10 +227,10 @@ Error IndirectDiffuseClipmaps::init()
 	for(U32 clipmap = 0; clipmap < kIndirectDiffuseClipmapCount; ++clipmap)
 	{
 		TextureInitInfo volumeInit = getRenderer().create2DRenderTargetInitInfo(
-			m_consts.m_probeCounts.x() * (g_cvarRenderIdcIrradianceOctMapSize + 2),
-			m_consts.m_probeCounts.z() * (g_cvarRenderIdcIrradianceOctMapSize + 2), Format::kB10G11R11_Ufloat_Pack32,
+			m_consts.m_probeCounts.x * (g_cvarRenderIdcIrradianceOctMapSize + 2),
+			m_consts.m_probeCounts.z * (g_cvarRenderIdcIrradianceOctMapSize + 2), Format::kB10G11R11_Ufloat_Pack32,
 			TextureUsageBit::kAllShaderResource, generateTempPassName("IndirectDiffuseClipmap: Irradiance #%u", clipmap));
-		volumeInit.m_depth = m_consts.m_probeCounts.y();
+		volumeInit.m_depth = m_consts.m_probeCounts.y;
 		volumeInit.m_type = TextureType::k3D;
 
 		m_irradianceVolumes[clipmap] = getRenderer().createAndClearRenderTarget(volumeInit, TextureUsageBit::kSrvCompute);
@@ -242,10 +239,9 @@ Error IndirectDiffuseClipmaps::init()
 	for(U32 clipmap = 0; clipmap < kIndirectDiffuseClipmapCount; ++clipmap)
 	{
 		TextureInitInfo volumeInit = getRenderer().create2DRenderTargetInitInfo(
-			m_consts.m_probeCounts.x() * (g_cvarRenderIdcRadianceOctMapSize + 2),
-			m_consts.m_probeCounts.z() * (g_cvarRenderIdcRadianceOctMapSize + 2), Format::kR16G16_Sfloat, TextureUsageBit::kAllShaderResource,
-			generateTempPassName("IndirectDiffuseClipmap: Dist moments #%u", clipmap));
-		volumeInit.m_depth = m_consts.m_probeCounts.y();
+			m_consts.m_probeCounts.x * (g_cvarRenderIdcRadianceOctMapSize + 2), m_consts.m_probeCounts.z * (g_cvarRenderIdcRadianceOctMapSize + 2),
+			Format::kR16G16_Sfloat, TextureUsageBit::kAllShaderResource, generateTempPassName("IndirectDiffuseClipmap: Dist moments #%u", clipmap));
+		volumeInit.m_depth = m_consts.m_probeCounts.y;
 		volumeInit.m_type = TextureType::k3D;
 
 		m_distanceMomentsVolumes[clipmap] = getRenderer().createAndClearRenderTarget(volumeInit, TextureUsageBit::kSrvCompute);
@@ -254,9 +250,9 @@ Error IndirectDiffuseClipmaps::init()
 	for(U32 clipmap = 0; clipmap < kIndirectDiffuseClipmapCount; ++clipmap)
 	{
 		TextureInitInfo volumeInit = getRenderer().create2DRenderTargetInitInfo(
-			m_consts.m_probeCounts.x(), m_consts.m_probeCounts.z(), Format::kB10G11R11_Ufloat_Pack32, TextureUsageBit::kAllShaderResource,
+			m_consts.m_probeCounts.x, m_consts.m_probeCounts.z, Format::kB10G11R11_Ufloat_Pack32, TextureUsageBit::kAllShaderResource,
 			generateTempPassName("IndirectDiffuseClipmap: Avg light #%u", clipmap));
-		volumeInit.m_depth = m_consts.m_probeCounts.y();
+		volumeInit.m_depth = m_consts.m_probeCounts.y;
 		volumeInit.m_type = TextureType::k3D;
 
 		m_avgIrradianceVolumes[clipmap] = getRenderer().createAndClearRenderTarget(volumeInit, TextureUsageBit::kSrvCompute);
@@ -324,9 +320,9 @@ Error IndirectDiffuseClipmaps::init()
 		m_consts.m_textures[i].m_probeValidityTexture = m_probeValidityVolumes[i]->getOrCreateBindlessTextureIndex(TextureSubresourceDesc::all());
 		m_consts.m_textures[i].m_averageIrradianceTexture = m_avgIrradianceVolumes[i]->getOrCreateBindlessTextureIndex(TextureSubresourceDesc::all());
 
-		m_consts.m_textures[i].m_distanceMomentsOctMapSize = (m_distanceMomentsVolumes[i]->getWidth() / m_consts.m_probeCounts.x()) - 2;
-		m_consts.m_textures[i].m_irradianceOctMapSize = (m_irradianceVolumes[i]->getWidth() / m_consts.m_probeCounts.x()) - 2;
-		m_consts.m_textures[i].m_radianceOctMapSize = (m_radianceVolumes[i]->getWidth() / m_consts.m_probeCounts.x()) - 2;
+		m_consts.m_textures[i].m_distanceMomentsOctMapSize = (m_distanceMomentsVolumes[i]->getWidth() / m_consts.m_probeCounts.x) - 2;
+		m_consts.m_textures[i].m_irradianceOctMapSize = (m_irradianceVolumes[i]->getWidth() / m_consts.m_probeCounts.x) - 2;
+		m_consts.m_textures[i].m_radianceOctMapSize = (m_radianceVolumes[i]->getWidth() / m_consts.m_probeCounts.x) - 2;
 
 		m_consts.m_previousFrameAabbMins[i] = 100000.0f * m_consts.m_sizes[i] / Vec4(Vec3(m_consts.m_probeCounts), 1.0f);
 		m_consts.m_aabbMins[i] = m_consts.m_previousFrameAabbMins[i];
@@ -413,15 +409,15 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 		Array<ProbeRange, 3> fullUpdateRanges;
 		U32 fullUpdateRangeCount = 0;
 		ProbeRange partialUpdateRange;
-		const Vec3 probeSize = m_consts.m_sizes[clipmap].xyz() / Vec3(m_consts.m_probeCounts);
-		findClipmapInUpdateRanges(m_consts.m_aabbMins[clipmap].xyz(), m_consts.m_previousFrameAabbMins[clipmap].xyz(), probeSize,
+		const Vec3 probeSize = m_consts.m_sizes[clipmap].xyz / Vec3(m_consts.m_probeCounts);
+		findClipmapInUpdateRanges(m_consts.m_aabbMins[clipmap].xyz, m_consts.m_previousFrameAabbMins[clipmap].xyz, probeSize,
 								  UVec3(m_consts.m_probeCounts), fullUpdateRanges, fullUpdateRangeCount, partialUpdateRange);
 
 		U32 fullUpdateRayCount = 0;
 		for(U32 i = 0; i < fullUpdateRangeCount; ++i)
 		{
 			const UVec3 counts = UVec3(fullUpdateRanges[i].m_end - fullUpdateRanges[i].m_begin);
-			const U32 count = counts.x() * counts.y() * counts.z();
+			const U32 count = counts.x * counts.y * counts.z;
 			fullUpdateRayCount += square<U32>(g_cvarRenderIdcRadianceOctMapSize) * g_cvarRenderIdcRayCountPerTexelOfNewProbe * count;
 		}
 
@@ -431,8 +427,7 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 
 		const UVec3 partialUpdateProbeCounts = UVec3(partialUpdateRange.m_end - partialUpdateRange.m_begin);
 		U32 partialUpdateProbeCount = remainingRayCount / square<U32>(g_cvarRenderIdcRadianceOctMapSize);
-		partialUpdateProbeCount =
-			min(partialUpdateProbeCount, partialUpdateProbeCounts.x() * partialUpdateProbeCounts.y() * partialUpdateProbeCounts.z());
+		partialUpdateProbeCount = min(partialUpdateProbeCount, partialUpdateProbeCounts.x * partialUpdateProbeCounts.y * partialUpdateProbeCounts.z);
 
 		g_svarIdcRays.increment(fullUpdateRayCount + partialUpdateProbeCount * square<U32>(g_cvarRenderIdcRadianceOctMapSize));
 
@@ -508,8 +503,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 					consts.m_rayCountPerTexel = g_cvarRenderIdcRayCountPerTexelOfNewProbe;
 					consts.m_clipmapRegion.m_probesBegin = UVec3(fullUpdateRanges[i].m_begin);
 					consts.m_clipmapRegion.m_probeCounts = UVec3(fullUpdateRanges[i].m_end - fullUpdateRanges[i].m_begin);
-					consts.m_clipmapRegion.m_probeCount = consts.m_clipmapRegion.m_probeCounts.x() * consts.m_clipmapRegion.m_probeCounts.y()
-														  * consts.m_clipmapRegion.m_probeCounts.z();
+					consts.m_clipmapRegion.m_probeCount =
+						consts.m_clipmapRegion.m_probeCounts.x * consts.m_clipmapRegion.m_probeCounts.y * consts.m_clipmapRegion.m_probeCounts.z;
 					consts.m_maxProbesToUpdate = consts.m_clipmapRegion.m_probeCount;
 					consts.m_clipmapRegion.m_partialUpdate = 0;
 
@@ -538,8 +533,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 					consts.m_rayCountPerTexel = 1;
 					consts.m_clipmapRegion.m_probesBegin = UVec3(partialUpdateRange.m_begin);
 					consts.m_clipmapRegion.m_probeCounts = UVec3(partialUpdateRange.m_end - partialUpdateRange.m_begin);
-					consts.m_clipmapRegion.m_probeCount = consts.m_clipmapRegion.m_probeCounts.x() * consts.m_clipmapRegion.m_probeCounts.y()
-														  * consts.m_clipmapRegion.m_probeCounts.z();
+					consts.m_clipmapRegion.m_probeCount =
+						consts.m_clipmapRegion.m_probeCounts.x * consts.m_clipmapRegion.m_probeCounts.y * consts.m_clipmapRegion.m_probeCounts.z;
 					consts.m_maxProbesToUpdate = partialUpdateProbeCount;
 					consts.m_clipmapRegion.m_partialUpdate = 1;
 
@@ -598,8 +593,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 					consts.m_rayCountPerTexel = g_cvarRenderIdcRayCountPerTexelOfNewProbe;
 					consts.m_clipmapRegion.m_probesBegin = UVec3(fullUpdateRanges[i].m_begin);
 					consts.m_clipmapRegion.m_probeCounts = UVec3(fullUpdateRanges[i].m_end - fullUpdateRanges[i].m_begin);
-					consts.m_clipmapRegion.m_probeCount = consts.m_clipmapRegion.m_probeCounts.x() * consts.m_clipmapRegion.m_probeCounts.y()
-														  * consts.m_clipmapRegion.m_probeCounts.z();
+					consts.m_clipmapRegion.m_probeCount =
+						consts.m_clipmapRegion.m_probeCounts.x * consts.m_clipmapRegion.m_probeCounts.y * consts.m_clipmapRegion.m_probeCounts.z;
 					consts.m_maxProbesToUpdate = consts.m_clipmapRegion.m_probeCount;
 					consts.m_clipmapRegion.m_partialUpdate = 0;
 
@@ -620,8 +615,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 					consts.m_rayCountPerTexel = 1;
 					consts.m_clipmapRegion.m_probesBegin = UVec3(partialUpdateRange.m_begin);
 					consts.m_clipmapRegion.m_probeCounts = UVec3(partialUpdateRange.m_end - partialUpdateRange.m_begin);
-					consts.m_clipmapRegion.m_probeCount = consts.m_clipmapRegion.m_probeCounts.x() * consts.m_clipmapRegion.m_probeCounts.y()
-														  * consts.m_clipmapRegion.m_probeCounts.z();
+					consts.m_clipmapRegion.m_probeCount =
+						consts.m_clipmapRegion.m_probeCounts.x * consts.m_clipmapRegion.m_probeCounts.y * consts.m_clipmapRegion.m_probeCounts.z;
 					consts.m_maxProbesToUpdate = partialUpdateProbeCount;
 					consts.m_clipmapRegion.m_partialUpdate = 1;
 
@@ -721,8 +716,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 			const Array<Vec4, 3> consts = {Vec4(g_cvarRenderIdcFirstBounceRayDistance), {}, {}};
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
-			const U32 width = getRenderer().getInternalResolution().x() / 2;
-			const U32 height = getRenderer().getInternalResolution().y() / (!g_cvarRenderIdcApplyHighQuality + 1);
+			const U32 width = getRenderer().getInternalResolution().x / 2;
+			const U32 height = getRenderer().getInternalResolution().y / (!g_cvarRenderIdcApplyHighQuality + 1);
 
 			if(g_cvarRenderIdcInlineRt)
 			{
@@ -771,8 +766,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.bindSampler(0, 0, getRenderer().getSamplers().m_trilinearRepeat.get());
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2,
-							  getRenderer().getInternalResolution().y() / (!g_cvarRenderIdcApplyHighQuality + 1));
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2,
+							  getRenderer().getInternalResolution().y / (!g_cvarRenderIdcApplyHighQuality + 1));
 		});
 	}
 
@@ -793,8 +788,8 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 			rgraphCtx.bindSrv(1, 0, getGBuffer().getDepthRt());
 			rgraphCtx.bindUav(0, 0, fullRtTmp);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2,
-							  getRenderer().getInternalResolution().y() / (!g_cvarRenderIdcApplyHighQuality + 1));
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2,
+							  getRenderer().getInternalResolution().y / (!g_cvarRenderIdcApplyHighQuality + 1));
 		});
 	}
 
@@ -833,7 +828,7 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.bindConstantBuffer(0, 0, ctx.m_globalRenderingConstantsBuffer);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -854,7 +849,7 @@ void IndirectDiffuseClipmaps::populateRenderGraph(RenderingContext& ctx)
 			rgraphCtx.bindSrv(1, 0, getGBuffer().getDepthRt());
 			rgraphCtx.bindUav(0, 0, historyRt);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 

+ 8 - 9
AnKi/Renderer/IndirectDiffuseProbes.cpp

@@ -28,8 +28,8 @@ static Vec3 computeCellCenter(U32 cellIdx, const GlobalIlluminationProbeComponen
 	const Vec3 halfAabbSize = probe.getBoxVolumeSize() / 2.0f;
 	const Vec3 aabbMin = -halfAabbSize + probe.getWorldPosition();
 	U32 x, y, z;
-	unflatten3dArrayIndex(probe.getCellCountsPerDimension().x(), probe.getCellCountsPerDimension().y(), probe.getCellCountsPerDimension().z(),
-						  cellIdx, x, y, z);
+	unflatten3dArrayIndex(probe.getCellCountsPerDimension().x, probe.getCellCountsPerDimension().y, probe.getCellCountsPerDimension().z, cellIdx, x,
+						  y, z);
 	const Vec3 cellSize = probe.getBoxVolumeSize() / Vec3(probe.getCellCountsPerDimension());
 	const Vec3 halfCellSize = cellSize / 2.0f;
 	const Vec3 cellCenter = aabbMin + halfCellSize + cellSize * Vec3(UVec3(x, y, z));
@@ -195,8 +195,7 @@ void IndirectDiffuseProbes::populateRenderGraph(RenderingContext& rctx)
 			Frustum frustum;
 			{
 				frustum.setPerspective(kClusterObjectFrustumNearPlane, probeToRefresh->getRenderRadius(), kPi / 2.0f, kPi / 2.0f);
-				frustum.setWorldTransform(
-					Transform(cellCenter.xyz0(), Frustum::getOmnidirectionalFrustumRotations()[f], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
+				frustum.setWorldTransform(Transform(cellCenter.xyz0, Frustum::getOmnidirectionalFrustumRotations()[f], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
 				frustum.update();
 
 				Array<F32, kMaxLodCount - 1> lodDistances = {g_cvarRenderLod0MaxDistance, g_cvarRenderLod1MaxDistance};
@@ -393,7 +392,7 @@ void IndirectDiffuseProbes::populateRenderGraph(RenderingContext& rctx)
 					TraditionalDeferredLightShadingDrawInfo dsInfo;
 					dsInfo.m_viewProjectionMatrix = viewProjMat;
 					dsInfo.m_invViewProjectionMatrix = viewProjMat.invert();
-					dsInfo.m_cameraPosWSpace = cellCenter.xyz1();
+					dsInfo.m_cameraPosWSpace = cellCenter.xyz1;
 					dsInfo.m_viewport = UVec4(0, 0, m_tileSize, m_tileSize);
 					dsInfo.m_effectiveShadowDistance = (doShadows) ? probeToRefresh->getShadowsRenderRadius() : -1.0f;
 
@@ -464,11 +463,11 @@ void IndirectDiffuseProbes::populateRenderGraph(RenderingContext& rctx)
 				} consts;
 
 				U32 x, y, z;
-				unflatten3dArrayIndex(probeToRefresh->getCellCountsPerDimension().x(), probeToRefresh->getCellCountsPerDimension().y(),
-									  probeToRefresh->getCellCountsPerDimension().z(), cellIdx, x, y, z);
-				consts.m_volumeTexel = IVec3(x, probeToRefresh->getCellCountsPerDimension().y() - y - 1, z);
+				unflatten3dArrayIndex(probeToRefresh->getCellCountsPerDimension().x, probeToRefresh->getCellCountsPerDimension().y,
+									  probeToRefresh->getCellCountsPerDimension().z, cellIdx, x, y, z);
+				consts.m_volumeTexel = IVec3(x, probeToRefresh->getCellCountsPerDimension().y - y - 1, z);
 
-				consts.m_nextTexelOffsetInU = probeToRefresh->getCellCountsPerDimension().x();
+				consts.m_nextTexelOffsetInU = probeToRefresh->getCellCountsPerDimension().x;
 				cmdb.setFastConstants(&consts, sizeof(consts));
 
 				// Dispatch

+ 6 - 6
AnKi/Renderer/LensFlare.cpp

@@ -105,8 +105,8 @@ void LensFlare::runDrawFlares(const RenderingContext& ctx, CommandBuffer& cmdb)
 		Vec4 lfPos = Vec4(comp.getWorldPosition(), 1.0f);
 		Vec4 posClip = ctx.m_matrices.m_viewProjectionJitter * lfPos;
 
-		/*if(posClip.x() > posClip.w() || posClip.x() < -posClip.w() || posClip.y() > posClip.w()
-			|| posClip.y() < -posClip.w())
+		/*if(posClip.x > posClip.w || posClip.x < -posClip.w || posClip.y > posClip.w
+			|| posClip.y < -posClip.w)
 		{
 			// Outside clip
 			ANKI_ASSERT(0 && "Check that before");
@@ -119,14 +119,14 @@ void LensFlare::runDrawFlares(const RenderingContext& ctx, CommandBuffer& cmdb)
 		WeakArray<LensFlareSprite> sprites = allocateAndBindSrvStructuredBuffer<LensFlareSprite>(cmdb, 0, 0, spritesCount);
 
 		// misc
-		Vec2 posNdc = posClip.xy() / posClip.w();
+		Vec2 posNdc = posClip.xy / posClip.w;
 
 		// First flare
 		sprites[c].m_posScale = Vec4(posNdc, comp.getFirstFlareSize() * Vec2(1.0f, getRenderer().getAspectRatio()));
 		sprites[c].m_depthPad3 = Vec4(0.0f);
-		const F32 alpha = comp.getColorMultiplier().w() * (1.0f - pow(absolute(posNdc.x()), 6.0f))
-						  * (1.0f - pow(absolute(posNdc.y()), 6.0f)); // Fade the flare on the edges
-		sprites[c].m_color = Vec4(comp.getColorMultiplier().xyz(), alpha);
+		const F32 alpha = comp.getColorMultiplier().w * (1.0f - pow(absolute(posNdc.x), 6.0f))
+						  * (1.0f - pow(absolute(posNdc.y), 6.0f)); // Fade the flare on the edges
+		sprites[c].m_color = Vec4(comp.getColorMultiplier().xyz, alpha);
 		++c;
 
 		// Render

+ 4 - 4
AnKi/Renderer/LightShading.cpp

@@ -37,8 +37,8 @@ Error LightShading::init()
 
 		// Create RT descr
 		const UVec2 internalResolution = getRenderer().getInternalResolution();
-		m_lightShading.m_rtDescr = getRenderer().create2DRenderTargetDescription(internalResolution.x(), internalResolution.y(),
-																				 getRenderer().getHdrFormat(), "Light Shading");
+		m_lightShading.m_rtDescr =
+			getRenderer().create2DRenderTargetDescription(internalResolution.x, internalResolution.y, getRenderer().getHdrFormat(), "Light Shading");
 		m_lightShading.m_rtDescr.bake();
 	}
 
@@ -65,7 +65,7 @@ void LightShading::run(const RenderingContext& ctx, RenderPassWorkContext& rgrap
 
 	CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
-	cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+	cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 
 	const Bool enableVrs = GrManager::getSingleton().getDeviceCapabilities().m_vrs && g_cvarGrVrs;
 	if(enableVrs)
@@ -152,7 +152,7 @@ void LightShading::run(const RenderingContext& ctx, RenderPassWorkContext& rgrap
 			} pc;
 
 			pc.m_invertedViewProjectionJitterMat = ctx.m_matrices.m_invertedViewProjectionJitter;
-			pc.m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+			pc.m_cameraPos = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 			pc.m_scale = sky->getImageScale();
 			pc.m_bias = sky->getImageBias();
 

+ 9 - 10
AnKi/Renderer/MotionBlur.cpp

@@ -28,16 +28,15 @@ Error MotionBlur::init()
 		m_reconstructGrProg, "Reconstruct"));
 
 	const UVec2 tiledTexSize = (getRenderer().getPostProcessResolution() + g_cvarRenderMotionBlurTileSize - 1) / g_cvarRenderMotionBlurTileSize;
-	m_maxVelocityRtDesc =
-		getRenderer().create2DRenderTargetDescription(tiledTexSize.x(), tiledTexSize.y(), Format::kR16G16_Sfloat, "MaxTileVelocity");
+	m_maxVelocityRtDesc = getRenderer().create2DRenderTargetDescription(tiledTexSize.x, tiledTexSize.y, Format::kR16G16_Sfloat, "MaxTileVelocity");
 	m_maxVelocityRtDesc.bake();
 
 	m_maxNeighbourVelocityRtDesc =
-		getRenderer().create2DRenderTargetDescription(tiledTexSize.x(), tiledTexSize.y(), Format::kR16G16_Sfloat, "MaxNeighbourTileVelocity");
+		getRenderer().create2DRenderTargetDescription(tiledTexSize.x, tiledTexSize.y, Format::kR16G16_Sfloat, "MaxNeighbourTileVelocity");
 	m_maxNeighbourVelocityRtDesc.bake();
 
 	m_finalRtDesc = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y(),
+		getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y,
 		(GrManager::getSingleton().getDeviceCapabilities().m_unalignedBbpTextureFormats) ? Format::kR8G8B8_Unorm : Format::kR8G8B8A8_Unorm,
 		"MotionBlur");
 	m_finalRtDesc.bake();
@@ -79,7 +78,7 @@ void MotionBlur::populateRenderGraph(RenderingContext& ctx)
 
 			const UVec2 tiledTexSize =
 				(getRenderer().getPostProcessResolution() + g_cvarRenderMotionBlurTileSize - 1) / g_cvarRenderMotionBlurTileSize;
-			cmdb.dispatchCompute(tiledTexSize.x(), tiledTexSize.y(), 1);
+			cmdb.dispatchCompute(tiledTexSize.x, tiledTexSize.y, 1);
 		});
 	}
 
@@ -102,7 +101,7 @@ void MotionBlur::populateRenderGraph(RenderingContext& ctx)
 
 			const UVec2 tiledTexSize =
 				(getRenderer().getPostProcessResolution() + g_cvarRenderMotionBlurTileSize - 1) / g_cvarRenderMotionBlurTileSize;
-			cmdb.dispatchCompute(tiledTexSize.x(), tiledTexSize.y(), 1);
+			cmdb.dispatchCompute(tiledTexSize.x, tiledTexSize.y, 1);
 		});
 	}
 
@@ -154,8 +153,8 @@ void MotionBlur::populateRenderGraph(RenderingContext& ctx)
 				U32 m_frame;
 				F32 m_far;
 			} consts;
-			consts.m_depthLinearizationParams.x() = (ctx.m_matrices.m_near - ctx.m_matrices.m_far) / ctx.m_matrices.m_near;
-			consts.m_depthLinearizationParams.y() = ctx.m_matrices.m_far / ctx.m_matrices.m_near;
+			consts.m_depthLinearizationParams.x = (ctx.m_matrices.m_near - ctx.m_matrices.m_far) / ctx.m_matrices.m_near;
+			consts.m_depthLinearizationParams.y = ctx.m_matrices.m_far / ctx.m_matrices.m_near;
 			consts.m_frame = getRenderer().getFrameCount() % 32;
 			consts.m_far = ctx.m_matrices.m_far;
 			cmdb.setFastConstants(&consts, sizeof(consts));
@@ -163,11 +162,11 @@ void MotionBlur::populateRenderGraph(RenderingContext& ctx)
 			if(g_cvarRenderPreferCompute)
 			{
 				rgraphCtx.bindUav(0, 0, m_runCtx.m_rt);
-				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+				cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 				drawQuad(cmdb);
 			}
 		});

+ 3 - 3
AnKi/Renderer/MotionVectors.cpp

@@ -17,7 +17,7 @@ Error MotionVectors::init()
 	ANKI_CHECK(loadShaderProgram("ShaderBinaries/MotionVectors.ankiprogbin", m_prog, m_grProg));
 
 	m_motionVectorsRtDescr = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR16G16_Sfloat, "MotionVectors");
+		getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR16G16_Sfloat, "MotionVectors");
 	m_motionVectorsRtDescr.bake();
 
 	return Error::kNone;
@@ -81,11 +81,11 @@ void MotionVectors::populateRenderGraph(RenderingContext& ctx)
 
 		if(g_cvarRenderPreferCompute)
 		{
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		}
 		else
 		{
-			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 
 			cmdb.draw(PrimitiveTopology::kTriangles, 3);
 		}

+ 3 - 3
AnKi/Renderer/PrimaryNonRenderableVisibility.cpp

@@ -23,13 +23,13 @@ static WeakArray<TComponent*> gatherComponents(ConstWeakArray<UVec2> pairs, TArr
 
 	for(UVec2 pair : pairs)
 	{
-		if(!array.indexExists(pair.y()))
+		if(!array.indexExists(pair.y))
 		{
 			continue;
 		}
 
-		TComponent* comp = &array[pair.y()];
-		const U32 uuid = pair.x();
+		TComponent* comp = &array[pair.y];
+		const U32 uuid = pair.x;
 		ANKI_ASSERT(uuid != 0);
 		if(comp->getUuid() == uuid)
 		{

+ 2 - 2
AnKi/Renderer/ProbeReflections.cpp

@@ -133,7 +133,7 @@ void ProbeReflections::populateRenderGraph(RenderingContext& rctx)
 		{
 			frustum.setPerspective(kClusterObjectFrustumNearPlane, probeToRefresh->getRenderRadius(), kPi / 2.0f, kPi / 2.0f);
 			frustum.setWorldTransform(
-				Transform(probeToRefresh->getWorldPosition().xyz0(), Frustum::getOmnidirectionalFrustumRotations()[f], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
+				Transform(probeToRefresh->getWorldPosition().xyz0, Frustum::getOmnidirectionalFrustumRotations()[f], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
 			frustum.update();
 
 			Array<F32, kMaxLodCount - 1> lodDistances = {g_cvarRenderLod0MaxDistance, g_cvarRenderLod1MaxDistance};
@@ -324,7 +324,7 @@ void ProbeReflections::populateRenderGraph(RenderingContext& rctx)
 				TraditionalDeferredLightShadingDrawInfo dsInfo;
 				dsInfo.m_viewProjectionMatrix = viewProjMat;
 				dsInfo.m_invViewProjectionMatrix = viewProjMat.invert();
-				dsInfo.m_cameraPosWSpace = probeToRefresh->getWorldPosition().xyz1();
+				dsInfo.m_cameraPosWSpace = probeToRefresh->getWorldPosition().xyz1;
 				dsInfo.m_viewport = UVec4(0, 0, m_lightShading.m_tileSize, m_lightShading.m_tileSize);
 				dsInfo.m_effectiveShadowDistance = probeToRefresh->getShadowsRenderRadius();
 				dsInfo.m_applyIndirectDiffuse = true;

+ 16 - 17
AnKi/Renderer/Reflections.cpp

@@ -70,35 +70,35 @@ Error Reflections::init()
 	ANKI_CHECK(loadShaderProgram(kProgFname, mutation, m_mainProg, m_tileClassificationGrProg, "Classification"));
 
 	m_transientRtDesc1 = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat, "Reflections #1");
+		getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR16G16B16A16_Sfloat, "Reflections #1");
 	m_transientRtDesc1.bake();
 
 	m_transientRtDesc2 = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat, "Reflections #2");
+		getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR16G16B16A16_Sfloat, "Reflections #2");
 	m_transientRtDesc2.bake();
 
 	m_hitPosAndDepthRtDesc = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x() / 2u, getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat, "HitPosAndDepth");
+		getRenderer().getInternalResolution().x / 2u, getRenderer().getInternalResolution().y, Format::kR16G16B16A16_Sfloat, "HitPosAndDepth");
 	m_hitPosAndDepthRtDesc.bake();
 
-	m_hitPosRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x(),
-																   getRenderer().getInternalResolution().y(), Format::kR16G16B16A16_Sfloat, "HitPos");
+	m_hitPosRtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
+																   Format::kR16G16B16A16_Sfloat, "HitPos");
 	m_hitPosRtDesc.bake();
 
 	TextureInitInfo texInit = getRenderer().create2DRenderTargetDescription(
-		getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), getRenderer().getHdrFormat(), "ReflectionsMain");
+		getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, getRenderer().getHdrFormat(), "ReflectionsMain");
 	texInit.m_usage = TextureUsageBit::kAllShaderResource | TextureUsageBit::kAllUav;
 	m_tex = getRenderer().createAndClearRenderTarget(texInit, TextureUsageBit::kSrvCompute);
 
-	texInit = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+	texInit = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 															Format::kR32G32_Sfloat, "ReflectionsMoments #1");
 	texInit.m_usage = TextureUsageBit::kAllShaderResource | TextureUsageBit::kAllUav;
 	m_momentsTextures[0] = getRenderer().createAndClearRenderTarget(texInit, TextureUsageBit::kSrvCompute);
 	texInit.setName("ReflectionsMoments #2");
 	m_momentsTextures[1] = getRenderer().createAndClearRenderTarget(texInit, TextureUsageBit::kSrvCompute);
 
-	m_classTileMapRtDesc = getRenderer().create2DRenderTargetDescription((getRenderer().getInternalResolution().x() + kTileSize - 1) / kTileSize,
-																		 (getRenderer().getInternalResolution().y() + kTileSize - 1) / kTileSize,
+	m_classTileMapRtDesc = getRenderer().create2DRenderTargetDescription((getRenderer().getInternalResolution().x + kTileSize - 1) / kTileSize,
+																		 (getRenderer().getInternalResolution().y + kTileSize - 1) / kTileSize,
 																		 Format::kR8_Uint, "ReflClassTileMap");
 	m_classTileMapRtDesc.bake();
 
@@ -193,15 +193,14 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
-			dispatchPPCompute(cmdb, kTileSize / 2, kTileSize, getRenderer().getInternalResolution().x() / 2,
-							  getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, kTileSize / 2, kTileSize, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y);
 		});
 	}
 
 	// SSR
 	BufferView pixelsFailedSsrBuff;
 	{
-		const U32 pixelCount = getRenderer().getInternalResolution().x() / 2 * getRenderer().getInternalResolution().y();
+		const U32 pixelCount = getRenderer().getInternalResolution().x / 2 * getRenderer().getInternalResolution().y;
 		pixelsFailedSsrBuff = GpuVisibleTransientMemoryPool::getSingleton().allocateStructuredBuffer<PixelFailedSsr>(pixelCount);
 
 		// Create the pass
@@ -253,7 +252,7 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -433,7 +432,7 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -473,7 +472,7 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.bindConstantBuffer(0, 0, ctx.m_globalRenderingConstantsBuffer);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -504,7 +503,7 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			cmdb.setFastConstants(&consts, sizeof(consts));
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -529,7 +528,7 @@ void Reflections::populateRenderGraph(RenderingContext& ctx)
 
 			rgraphCtx.bindUav(0, 0, mainRt);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 

+ 24 - 24
AnKi/Renderer/Renderer.cpp

@@ -75,7 +75,7 @@ static Vec2 generateJitter(U32 frame)
 	F32 fraction = invBase;
 	while(index > 0)
 	{
-		result.x() += F32(index % baseX) * fraction;
+		result.x += F32(index % baseX) * fraction;
 		index /= baseX;
 		fraction *= invBase;
 	}
@@ -86,13 +86,13 @@ static Vec2 generateJitter(U32 frame)
 	fraction = invBase;
 	while(index > 0)
 	{
-		result.y() += F32(index % baseY) * fraction;
+		result.y += F32(index % baseY) * fraction;
 		index /= baseY;
 		fraction *= invBase;
 	}
 
-	result.x() -= 0.5f;
-	result.y() -= 0.5f;
+	result.x -= 0.5f;
+	result.y -= 0.5f;
 	return result;
 }
 
@@ -154,8 +154,8 @@ Error Renderer::initInternal(const RendererInitInfo& inf)
 		else
 		{
 			out = UVec2(Vec2(baseResolution) * scale);
-			alignRoundDown(2, out.x());
-			alignRoundDown(2, out.y());
+			alignRoundDown(2, out.x);
+			alignRoundDown(2, out.y);
 		}
 		return out;
 	};
@@ -163,11 +163,11 @@ Error Renderer::initInternal(const RendererInitInfo& inf)
 	m_postProcessResolution = setResolution(m_swapchainResolution, g_cvarRenderRenderScaling);
 	m_internalResolution = setResolution(m_postProcessResolution, g_cvarRenderInternalRenderScaling);
 
-	ANKI_R_LOGI("Initializing offscreen renderer. Resolution %ux%u. Internal resolution %ux%u", m_postProcessResolution.x(),
-				m_postProcessResolution.y(), m_internalResolution.x(), m_internalResolution.y());
+	ANKI_R_LOGI("Initializing offscreen renderer. Resolution %ux%u. Internal resolution %ux%u", m_postProcessResolution.x, m_postProcessResolution.y,
+				m_internalResolution.x, m_internalResolution.y);
 
-	m_tileCounts.x() = (m_internalResolution.x() + kClusteredShadingTileSize - 1) / kClusteredShadingTileSize;
-	m_tileCounts.y() = (m_internalResolution.y() + kClusteredShadingTileSize - 1) / kClusteredShadingTileSize;
+	m_tileCounts.x = (m_internalResolution.x + kClusteredShadingTileSize - 1) / kClusteredShadingTileSize;
+	m_tileCounts.y = (m_internalResolution.y + kClusteredShadingTileSize - 1) / kClusteredShadingTileSize;
 	m_zSplitCount = g_cvarRenderZSplitCount;
 
 	if(g_cvarCoreMeshletRendering && !GrManager::getSingleton().getDeviceCapabilities().m_meshShaders)
@@ -184,7 +184,7 @@ Error Renderer::initInternal(const RendererInitInfo& inf)
 	}
 
 	// A few sanity checks
-	if(m_internalResolution.x() < 64 || m_internalResolution.y() < 64)
+	if(m_internalResolution.x < 64 || m_internalResolution.y < 64)
 	{
 		ANKI_R_LOGE("Incorrect sizes");
 		return Error::kUserData;
@@ -286,7 +286,7 @@ Error Renderer::initInternal(const RendererInitInfo& inf)
 		}
 
 		sinit.setName("TrilinearRepeatAnisoRezScalingBias");
-		F32 scalingMipBias = log2(F32(m_internalResolution.x()) / F32(m_postProcessResolution.x()));
+		F32 scalingMipBias = log2(F32(m_internalResolution.x) / F32(m_postProcessResolution.x));
 		if(getTemporalUpscaler().getEnabled())
 		{
 			// DLSS wants more bias
@@ -401,21 +401,21 @@ void Renderer::writeGlobalRendererConstants(RenderingContext& ctx, GlobalRendere
 	GlobalRendererConstants consts;
 	memset(&consts, 0, sizeof(consts));
 
-	consts.m_renderingSize = Vec2(F32(m_internalResolution.x()), F32(m_internalResolution.y()));
+	consts.m_renderingSize = Vec2(F32(m_internalResolution.x), F32(m_internalResolution.y));
 
 	consts.m_time = F32(HighRezTimer::getCurrentTime());
 	consts.m_frame = m_frameCount & kMaxU32;
 
 	Plane nearPlane;
 	extractClipPlane(ctx.m_matrices.m_viewProjection, FrustumPlaneType::kNear, nearPlane);
-	consts.m_nearPlaneWSpace = Vec4(nearPlane.getNormal().xyz(), nearPlane.getOffset());
-	consts.m_cameraPosition = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+	consts.m_nearPlaneWSpace = Vec4(nearPlane.getNormal().xyz, nearPlane.getOffset());
+	consts.m_cameraPosition = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 
 	consts.m_tileCounts = m_tileCounts;
 	consts.m_zSplitCount = m_zSplitCount;
 	consts.m_zSplitCountOverFrustumLength = F32(m_zSplitCount) / (ctx.m_matrices.m_far - ctx.m_matrices.m_near);
-	consts.m_zSplitMagic.x() = (ctx.m_matrices.m_near - ctx.m_matrices.m_far) / (ctx.m_matrices.m_near * F32(m_zSplitCount));
-	consts.m_zSplitMagic.y() = ctx.m_matrices.m_far / (ctx.m_matrices.m_near * F32(m_zSplitCount));
+	consts.m_zSplitMagic.x = (ctx.m_matrices.m_near - ctx.m_matrices.m_far) / (ctx.m_matrices.m_near * F32(m_zSplitCount));
+	consts.m_zSplitMagic.y = ctx.m_matrices.m_far / (ctx.m_matrices.m_near * F32(m_zSplitCount));
 	consts.m_lightVolumeLastZSplit = min(g_cvarRenderVolumetricLightingAccumulationFinalZSplit - 1, m_zSplitCount);
 
 	consts.m_reflectionProbesMipCount = F32(m_probeReflections->getReflectionTextureMipmapCount());
@@ -430,7 +430,7 @@ void Renderer::writeGlobalRendererConstants(RenderingContext& ctx, GlobalRendere
 		DirectionalLight& out = consts.m_directionalLight;
 		const U32 shadowCascadeCount = (dirLight->getShadowEnabled()) ? g_cvarRenderShadowCascadeCount : 0;
 
-		out.m_diffuseColor = dirLight->getDiffuseColor().xyz();
+		out.m_diffuseColor = dirLight->getDiffuseColor().xyz;
 		out.m_power = dirLight->getLightPower();
 		out.m_shadowCascadeCount = shadowCascadeCount;
 		out.m_active = 1;
@@ -438,7 +438,7 @@ void Renderer::writeGlobalRendererConstants(RenderingContext& ctx, GlobalRendere
 		out.m_shadowCascadeDistances = Vec4(g_cvarRenderShadowCascade0Distance, g_cvarRenderShadowCascade1Distance,
 											g_cvarRenderShadowCascade2Distance, g_cvarRenderShadowCascade3Distance);
 
-		for(U cascade = 0; cascade < shadowCascadeCount; ++cascade)
+		for(U32 cascade = 0; cascade < shadowCascadeCount; ++cascade)
 		{
 			ANKI_ASSERT(ctx.m_dirLightTextureMatrices[cascade] != Mat4::getZero());
 			out.m_textureMatrices[cascade] = ctx.m_dirLightTextureMatrices[cascade];
@@ -642,11 +642,11 @@ TexturePtr Renderer::createAndClearRenderTarget(const TextureInitInfo& inf, Text
 					cmdb->setPipelineBarrier({&barrier, 1}, {}, {});
 
 					UVec3 wgSize;
-					wgSize.x() = (8 - 1 + (tex->getWidth() >> mip)) / 8;
-					wgSize.y() = (8 - 1 + (tex->getHeight() >> mip)) / 8;
-					wgSize.z() = (inf.m_type == TextureType::k3D) ? ((8 - 1 + (tex->getDepth() >> mip)) / 8) : 1;
+					wgSize.x = (8 - 1 + (tex->getWidth() >> mip)) / 8;
+					wgSize.y = (8 - 1 + (tex->getHeight() >> mip)) / 8;
+					wgSize.z = (inf.m_type == TextureType::k3D) ? ((8 - 1 + (tex->getDepth() >> mip)) / 8) : 1;
 
-					cmdb->dispatchCompute(wgSize.x(), wgSize.y(), wgSize.z());
+					cmdb->dispatchCompute(wgSize.x, wgSize.y, wgSize.z);
 
 					if(!!initialUsage)
 					{
@@ -910,7 +910,7 @@ Error Renderer::render()
 		pass.setWork([this](RenderPassWorkContext& rgraphCtx) {
 			ANKI_TRACE_SCOPED_EVENT(BlitAndUi);
 			CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
-			cmdb.setViewport(0, 0, m_swapchainResolution.x(), m_swapchainResolution.y());
+			cmdb.setViewport(0, 0, m_swapchainResolution.x, m_swapchainResolution.y);
 
 			cmdb.bindShaderProgram(m_blitGrProg.get());
 			cmdb.bindSampler(0, 0, m_samplers.m_trilinearClamp.get());

+ 1 - 1
AnKi/Renderer/Renderer.h

@@ -128,7 +128,7 @@ public:
 
 	F32 getAspectRatio() const
 	{
-		return F32(m_internalResolution.x()) / F32(m_internalResolution.y());
+		return F32(m_internalResolution.x) / F32(m_internalResolution.y);
 	}
 
 	U64 getFrameCount() const

+ 2 - 2
AnKi/Renderer/RtMaterialFetchDbg.cpp

@@ -43,7 +43,7 @@ Error RtMaterialFetchDbg::init()
 	m_sbtRecordSize = getAlignedRoundUp(GrManager::getSingleton().getDeviceCapabilities().m_sbtRecordAlignment,
 										GrManager::getSingleton().getDeviceCapabilities().m_shaderGroupHandleSize + U32(sizeof(UVec4)));
 
-	m_rtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+	m_rtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 															 Format::kR8G8B8A8_Unorm, "RtMaterialFetch");
 	m_rtDesc.bake();
 
@@ -102,7 +102,7 @@ void RtMaterialFetchDbg::populateRenderGraph(RenderingContext& ctx)
 			cmdb.setFastConstants(&dummy, sizeof(dummy));
 
 			cmdb.dispatchRays(sbtBuffer, m_sbtRecordSize, GpuSceneArrays::RenderableBoundingVolumeRt::getSingleton().getElementCount(), 1,
-							  getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), 1);
+							  getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, 1);
 		});
 	}
 }

+ 11 - 11
AnKi/Renderer/RtShadows.cpp

@@ -79,7 +79,7 @@ Error RtShadows::init()
 	// Quarter rez shadow RT
 	{
 		TextureInitInfo texinit = getRenderer().create2DRenderTargetInitInfo(
-			getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR8_Unorm,
+			getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR8_Unorm,
 			TextureUsageBit::kAllSrv | TextureUsageBit::kUavDispatchRays | TextureUsageBit::kUavCompute, "RtShadows History");
 		m_historyRt = getRenderer().createAndClearRenderTarget(texinit, TextureUsageBit::kSrvPixel);
 	}
@@ -87,14 +87,14 @@ Error RtShadows::init()
 	// Temp shadow RT
 	{
 		m_intermediateShadowsRtDescr = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR8_Unorm, "RtShadows Tmp");
+			getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR8_Unorm, "RtShadows Tmp");
 		m_intermediateShadowsRtDescr.bake();
 	}
 
 	// Moments RT
 	{
 		TextureInitInfo texinit = getRenderer().create2DRenderTargetInitInfo(
-			getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR32G32_Sfloat,
+			getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR32G32_Sfloat,
 			TextureUsageBit::kAllSrv | TextureUsageBit::kUavDispatchRays | TextureUsageBit::kUavCompute, "RtShadows Moments #1");
 		m_momentsRts[0] = getRenderer().createAndClearRenderTarget(texinit, TextureUsageBit::kSrvPixel);
 
@@ -106,20 +106,20 @@ Error RtShadows::init()
 	if(m_useSvgf)
 	{
 		m_varianceRtDescr = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR32_Sfloat, "RtShadows Variance");
+			getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR32_Sfloat, "RtShadows Variance");
 		m_varianceRtDescr.bake();
 	}
 
 	// Final RT
 	{
 		m_upscaledRtDescr = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(), Format::kR8_Unorm, "RtShadows Upscaled");
+			getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y, Format::kR8_Unorm, "RtShadows Upscaled");
 		m_upscaledRtDescr.bake();
 	}
 
 	{
 		TextureInitInfo texinit = getRenderer().create2DRenderTargetInitInfo(
-			getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, Format::kR32_Sfloat,
+			getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, Format::kR32_Sfloat,
 			TextureUsageBit::kAllSrv | TextureUsageBit::kUavDispatchRays | TextureUsageBit::kUavCompute, "RtShadows history len");
 		ClearValue clear;
 		clear.m_colorf[0] = 1.0f;
@@ -323,7 +323,7 @@ void RtShadows::populateRenderGraph(RenderingContext& ctx)
 			cmdb.bindSrv(7, 2, TextureView(&m_blueNoiseImage->getTexture(), TextureSubresourceDesc::all()));
 
 			cmdb.dispatchRays(sbtBuffer, m_sbtRecordSize, GpuSceneArrays::RenderableBoundingVolumeRt::getSingleton().getElementCount(), 1,
-							  getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2, 1);
+							  getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2, 1);
 		});
 	}
 
@@ -392,7 +392,7 @@ void RtShadows::populateRenderGraph(RenderingContext& ctx)
 			const Mat4& invProjMat = ctx.m_matrices.m_projectionJitter.invert();
 			cmdb.setFastConstants(&invProjMat, sizeof(invProjMat));
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2);
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2);
 		});
 	}
 
@@ -457,7 +457,7 @@ void RtShadows::populateRenderGraph(RenderingContext& ctx)
 				const Mat4& invProjMat = ctx.m_matrices.m_projectionJitter.invert();
 				cmdb.setFastConstants(&invProjMat, sizeof(invProjMat));
 
-				dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2);
+				dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2);
 			});
 		}
 	}
@@ -485,7 +485,7 @@ void RtShadows::populateRenderGraph(RenderingContext& ctx)
 			rgraphCtx.bindSrv(1, 0, getDepthDownscale().getRt(), DepthDownscale::kQuarterInternalResolution);
 			rgraphCtx.bindSrv(2, 0, getGBuffer().getDepthRt());
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		});
 	}
 }
@@ -513,7 +513,7 @@ void RtShadows::runDenoise(const RenderingContext& ctx, RenderPassWorkContext& r
 	consts.m_maxSampleCount = 32;
 	cmdb.setFastConstants(&consts, sizeof(consts));
 
-	dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x() / 2, getRenderer().getInternalResolution().y() / 2);
+	dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x / 2, getRenderer().getInternalResolution().y / 2);
 }
 
 } // end namespace anki

+ 9 - 10
AnKi/Renderer/ShadowMapping.cpp

@@ -91,7 +91,7 @@ Error ShadowMapping::init()
 		UVec2 size(min(cascadeResolution, 1024u));
 		size /= 2;
 
-		m_cascadeHzbRtDescrs[i] = getRenderer().create2DRenderTargetDescription(size.x(), size.y(), Format::kR32_Sfloat, name);
+		m_cascadeHzbRtDescrs[i] = getRenderer().create2DRenderTargetDescription(size.x, size.y, Format::kR32_Sfloat, name);
 		m_cascadeHzbRtDescrs[i].m_mipmapCount = computeMaxMipmapCount2d(m_cascadeHzbRtDescrs[i].m_width, m_cascadeHzbRtDescrs[i].m_height);
 		m_cascadeHzbRtDescrs[i].bake();
 	}
@@ -117,8 +117,7 @@ Mat4 ShadowMapping::createSpotLightTextureMatrix(const UVec4& viewport) const
 
 	const Mat4 biasMat4(0.5f, 0.0f, 0.0f, 0.5f, 0.0f, -0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
 
-	return Mat4(sizeTextureSpace, 0.0f, 0.0f, uv.x(), 0.0f, sizeTextureSpace, 0.0f, uv.y(), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f)
-		   * biasMat4;
+	return Mat4(sizeTextureSpace, 0.0f, 0.0f, uv.x, 0.0f, sizeTextureSpace, 0.0f, uv.y, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f) * biasMat4;
 }
 
 void ShadowMapping::populateRenderGraph(RenderingContext& ctx)
@@ -252,7 +251,7 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 	// passes and it will push the other types of lights further into the future. So do those first.
 
 	// Vars
-	const Vec3 cameraOrigin = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+	const Vec3 cameraOrigin = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 	RenderGraphBuilder& rgraph = ctx.m_renderGraphDescr;
 	const CameraComponent& mainCam = SceneGraph::getSingleton().getActiveCameraNode().getFirstComponentOfType<CameraComponent>();
 
@@ -321,7 +320,7 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 			for(U face = 0; face < 6; ++face)
 			{
 				// Add a half texel to the viewport's start to avoid bilinear filtering bleeding
-				const Vec2 uvViewportXY = (Vec2(atlasViewports[face].xy()) + texelsBorder) / atlasResolution;
+				const Vec2 uvViewportXY = (Vec2(atlasViewports[face].xy) + texelsBorder) / atlasResolution;
 
 				uvViewports[face] = Vec4(uvViewportXY, Vec2(superTileSize / atlasResolution));
 			}
@@ -336,7 +335,7 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 			DistanceGpuVisibilityInput visIn;
 			visIn.m_passesName = generateTempPassName("Shadows point light light UUID:%u", lightc->getUuid());
 			visIn.m_technique = RenderingTechnique::kDepth;
-			visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+			visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 			visIn.m_lodDistances = lodDistances;
 			visIn.m_rgraph = &rgraph;
 			visIn.m_pointOfTest = lightc->getWorldPosition();
@@ -363,7 +362,7 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 				frustum.init(FrustumType::kPerspective);
 				frustum.setPerspective(kClusterObjectFrustumNearPlane, lightc->getRadius(), kPi / 2.0f, kPi / 2.0f);
 				frustum.setWorldTransform(
-					Transform(lightc->getWorldPosition().xyz0(), Frustum::getOmnidirectionalFrustumRotations()[face], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
+					Transform(lightc->getWorldPosition().xyz0, Frustum::getOmnidirectionalFrustumRotations()[face], Vec4(1.0f, 1.0f, 1.0f, 0.0f)));
 				frustum.update();
 
 				subpasses[face].m_clearTileIndirectArgs = clearTileIndirectArgs;
@@ -416,7 +415,7 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 			visIn.m_rgraph = &rgraph;
 			visIn.m_viewProjectionMatrix = lightc->getSpotLightViewProjectionMatrix();
 			visIn.m_hashVisibles = true;
-			visIn.m_viewportSize = atlasViewport.zw();
+			visIn.m_viewportSize = atlasViewport.zw;
 
 			GpuVisibilityOutput visOut;
 			getRenderer().getGpuVisibility().populateRenderGraph(visIn, visOut);
@@ -492,11 +491,11 @@ void ShadowMapping::processLights(RenderingContext& ctx)
 			visIn.m_passesName = generateTempPassName("Shadows: Dir light cascade cascade:%u", cascade);
 			visIn.m_technique = RenderingTechnique::kDepth;
 			visIn.m_viewProjectionMatrix = cascadeViewProjMats[cascade];
-			visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz();
+			visIn.m_lodReferencePoint = ctx.m_matrices.m_cameraTransform.getTranslationPart().xyz;
 			visIn.m_lodDistances = lodDistances;
 			visIn.m_hzbRt = &hzbGenIn.m_cascades[cascade].m_hzbRt;
 			visIn.m_rgraph = &rgraph;
-			visIn.m_viewportSize = dirLightAtlasViewports[cascade].zw();
+			visIn.m_viewportSize = dirLightAtlasViewports[cascade].zw;
 
 			GpuVisibilityOutput visOut;
 			getRenderer().getGpuVisibility().populateRenderGraph(visIn, visOut);

+ 2 - 2
AnKi/Renderer/ShadowmapsResolve.cpp

@@ -18,8 +18,8 @@ namespace anki {
 Error ShadowmapsResolve::init()
 {
 	m_quarterRez = g_cvarRenderShadowmapResolveQuarterRez;
-	const U32 width = getRenderer().getInternalResolution().x() / (m_quarterRez + 1);
-	const U32 height = getRenderer().getInternalResolution().y() / (m_quarterRez + 1);
+	const U32 width = getRenderer().getInternalResolution().x / (m_quarterRez + 1);
+	const U32 height = getRenderer().getInternalResolution().y / (m_quarterRez + 1);
 
 	m_rtDescr = getRenderer().create2DRenderTargetDescription(width, height, Format::kR8G8B8A8_Unorm, "SM resolve");
 	m_rtDescr.bake();

+ 8 - 8
AnKi/Renderer/Sky.cpp

@@ -24,19 +24,19 @@ Error GeneratedSky::init()
 	const Format formatB = getRenderer().getHdrFormat();
 
 	m_transmittanceLut = getRenderer().createAndClearRenderTarget(
-		getRenderer().create2DRenderTargetInitInfo(kTransmittanceLutSize.x(), kTransmittanceLutSize.y(), formatB, usage, "SkyTransmittanceLut"),
+		getRenderer().create2DRenderTargetInitInfo(kTransmittanceLutSize.x, kTransmittanceLutSize.y, formatB, usage, "SkyTransmittanceLut"),
 		initialUsage);
 
 	m_multipleScatteringLut = getRenderer().createAndClearRenderTarget(
-		getRenderer().create2DRenderTargetInitInfo(kMultipleScatteringLutSize.x(), kMultipleScatteringLutSize.y(), formatB, usage,
+		getRenderer().create2DRenderTargetInitInfo(kMultipleScatteringLutSize.x, kMultipleScatteringLutSize.y, formatB, usage,
 												   "SkyMultipleScatteringLut"),
 		initialUsage);
 
 	m_skyLut = getRenderer().createAndClearRenderTarget(
-		getRenderer().create2DRenderTargetInitInfo(kSkyLutSize.x(), kSkyLutSize.y(), formatB, usage | TextureUsageBit::kSrvPixel, "SkyLut"),
+		getRenderer().create2DRenderTargetInitInfo(kSkyLutSize.x, kSkyLutSize.y, formatB, usage | TextureUsageBit::kSrvPixel, "SkyLut"),
 		initialUsage);
 
-	m_envMap = getRenderer().createAndClearRenderTarget(getRenderer().create2DRenderTargetInitInfo(kEnvMapSize.x(), kEnvMapSize.y(),
+	m_envMap = getRenderer().createAndClearRenderTarget(getRenderer().create2DRenderTargetInitInfo(kEnvMapSize.x, kEnvMapSize.y,
 																								   getRenderer().getHdrFormat(),
 																								   usage | TextureUsageBit::kAllSrv, "SkyEnvMap"),
 														initialUsage);
@@ -108,7 +108,7 @@ void GeneratedSky::populateRenderGraph(RenderingContext& ctx)
 
 			rgraphCtx.bindUav(0, 0, transmittanceLutRt);
 
-			dispatchPPCompute(cmdb, 8, 8, kTransmittanceLutSize.x(), kTransmittanceLutSize.y());
+			dispatchPPCompute(cmdb, 8, 8, kTransmittanceLutSize.x, kTransmittanceLutSize.y);
 		});
 	}
 
@@ -131,7 +131,7 @@ void GeneratedSky::populateRenderGraph(RenderingContext& ctx)
 			cmdb.bindSampler(0, 0, getRenderer().getSamplers().m_trilinearClamp.get());
 			rgraphCtx.bindUav(0, 0, multipleScatteringLutRt);
 
-			dispatchPPCompute(cmdb, 8, 8, kMultipleScatteringLutSize.x(), kMultipleScatteringLutSize.y());
+			dispatchPPCompute(cmdb, 8, 8, kMultipleScatteringLutSize.x, kMultipleScatteringLutSize.y);
 		});
 	}
 
@@ -157,7 +157,7 @@ void GeneratedSky::populateRenderGraph(RenderingContext& ctx)
 			rgraphCtx.bindUav(0, 0, m_runCtx.m_skyLutRt);
 			cmdb.bindConstantBuffer(0, 0, ctx.m_globalRenderingConstantsBuffer);
 
-			dispatchPPCompute(cmdb, 8, 8, kSkyLutSize.x(), kSkyLutSize.y());
+			dispatchPPCompute(cmdb, 8, 8, kSkyLutSize.x, kSkyLutSize.y);
 		});
 	}
 
@@ -181,7 +181,7 @@ void GeneratedSky::populateRenderGraph(RenderingContext& ctx)
 			rgraphCtx.bindUav(0, 0, m_runCtx.m_envMapRt);
 			cmdb.bindConstantBuffer(0, 0, ctx.m_globalRenderingConstantsBuffer);
 
-			dispatchPPCompute(cmdb, 8, 8, kEnvMapSize.x(), kEnvMapSize.y());
+			dispatchPPCompute(cmdb, 8, 8, kEnvMapSize.x, kEnvMapSize.y);
 		});
 	}
 

+ 10 - 12
AnKi/Renderer/Ssao.cpp

@@ -21,16 +21,14 @@ Error Ssao::init()
 	{
 		TextureUsageBit usage = TextureUsageBit::kAllSrv;
 		usage |= (preferCompute) ? TextureUsageBit::kUavCompute : TextureUsageBit::kRtvDsvWrite;
-		TextureInitInfo texInit =
-			getRenderer().create2DRenderTargetInitInfo(rez.x(), rez.y(), Format::kR8G8B8A8_Snorm, usage, "Bent normals + SSAO #1");
+		TextureInitInfo texInit = getRenderer().create2DRenderTargetInitInfo(rez.x, rez.y, Format::kR8G8B8A8_Snorm, usage, "Bent normals + SSAO #1");
 		m_tex[0] = getRenderer().createAndClearRenderTarget(texInit, TextureUsageBit::kAllSrv);
 
 		texInit.setName("Bent normals + SSAO #2");
 		m_tex[1] = getRenderer().createAndClearRenderTarget(texInit, TextureUsageBit::kAllSrv);
 	}
 
-	m_bentNormalsAndSsaoRtDescr =
-		getRenderer().create2DRenderTargetDescription(rez.x(), rez.y(), Format::kR8G8B8A8_Snorm, "Bent normals + SSAO temp");
+	m_bentNormalsAndSsaoRtDescr = getRenderer().create2DRenderTargetDescription(rez.x, rez.y, Format::kR8G8B8A8_Snorm, "Bent normals + SSAO temp");
 	m_bentNormalsAndSsaoRtDescr.bake();
 
 	const Array<SubMutation, 2> mutation = {{{"SPATIAL_DENOISE_SAMPLE_COUNT", MutatorValue(g_cvarRenderSsaoSpatialDenoiseSampleCout)},
@@ -141,11 +139,11 @@ void Ssao::populateRenderGraph(RenderingContext& ctx)
 			{
 				rgraphCtx.bindUav(0, 0, finalRt);
 
-				dispatchPPCompute(cmdb, 8, 8, rez.x(), rez.y());
+				dispatchPPCompute(cmdb, 8, 8, rez.x, rez.y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, rez.x(), rez.y());
+				cmdb.setViewport(0, 0, rez.x, rez.y);
 
 				drawQuad(cmdb);
 			}
@@ -193,11 +191,11 @@ void Ssao::populateRenderGraph(RenderingContext& ctx)
 			if(g_cvarRenderPreferCompute)
 			{
 				rgraphCtx.bindUav(0, 0, bentNormalsAndSsaoTempRt);
-				dispatchPPCompute(cmdb, 8, 8, rez.x(), rez.y());
+				dispatchPPCompute(cmdb, 8, 8, rez.x, rez.y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, rez.x(), rez.y());
+				cmdb.setViewport(0, 0, rez.x, rez.y);
 				drawQuad(cmdb);
 			}
 		});
@@ -238,11 +236,11 @@ void Ssao::populateRenderGraph(RenderingContext& ctx)
 			if(g_cvarRenderPreferCompute)
 			{
 				rgraphCtx.bindUav(0, 0, historyRt);
-				dispatchPPCompute(cmdb, 8, 8, rez.x(), rez.y());
+				dispatchPPCompute(cmdb, 8, 8, rez.x, rez.y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, rez.x(), rez.y());
+				cmdb.setViewport(0, 0, rez.x, rez.y);
 				drawQuad(cmdb);
 			}
 		});
@@ -283,11 +281,11 @@ void Ssao::populateRenderGraph(RenderingContext& ctx)
 			if(g_cvarRenderPreferCompute)
 			{
 				rgraphCtx.bindUav(0, 0, finalRt);
-				dispatchPPCompute(cmdb, 8, 8, rez.x(), rez.y());
+				dispatchPPCompute(cmdb, 8, 8, rez.x, rez.y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, rez.x(), rez.y());
+				cmdb.setViewport(0, 0, rez.x, rez.y);
 				drawQuad(cmdb);
 			}
 		});

+ 3 - 3
AnKi/Renderer/TemporalAA.cpp

@@ -24,7 +24,7 @@ Error TemporalAA::init()
 		usage |= (g_cvarRenderPreferCompute) ? TextureUsageBit::kUavCompute : TextureUsageBit::kRtvDsvWrite;
 
 		TextureInitInfo texinit =
-			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y(),
+			getRenderer().create2DRenderTargetInitInfo(getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y,
 													   getRenderer().getHdrFormat(), usage, String().sprintf("TemporalAA #%u", i).cstr());
 
 		m_rtTextures[i] = getRenderer().createAndClearRenderTarget(texinit, TextureUsageBit::kSrvPixel);
@@ -100,11 +100,11 @@ void TemporalAA::populateRenderGraph(RenderingContext& ctx)
 		{
 			rgraphCtx.bindUav(0, 0, m_runCtx.m_renderRt);
 
-			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, 8, 8, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 		}
 		else
 		{
-			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x(), getRenderer().getInternalResolution().y());
+			cmdb.setViewport(0, 0, getRenderer().getInternalResolution().x, getRenderer().getInternalResolution().y);
 
 			cmdb.draw(PrimitiveTopology::kTriangles, 3);
 		}

+ 4 - 4
AnKi/Renderer/TemporalUpscaler.cpp

@@ -42,8 +42,8 @@ Error TemporalUpscaler::init()
 		ANKI_CHECK(loadShaderProgram("ShaderBinaries/Blit.ankiprogbin", m_blitProg, m_blitGrProg));
 	}
 
-	m_rtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getPostProcessResolution().x(),
-															 getRenderer().getPostProcessResolution().y(), getRenderer().getHdrFormat(), "Upscaled");
+	m_rtDesc = getRenderer().create2DRenderTargetDescription(getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y,
+															 getRenderer().getHdrFormat(), "Upscaled");
 	m_rtDesc.bake();
 
 	return Error::kNone;
@@ -78,7 +78,7 @@ void TemporalUpscaler::populateRenderGraph(RenderingContext& ctx)
 			const Bool reset = getRenderer().getFrameCount() == 0;
 			const Vec2 mvScale = srcRes; // UV space to Pixel space factor
 			// In [-texSize / 2, texSize / 2] -> sub-pixel space {-0.5, 0.5}
-			const Vec2 jitterOffset = ctx.m_matrices.m_jitter.getTranslationPart().xy() * srcRes * 0.5f;
+			const Vec2 jitterOffset = ctx.m_matrices.m_jitter.getTranslationPart().xy * srcRes * 0.5f;
 
 			const TextureView srcView = rgraphCtx.createTextureView(getRenderer().getLightShading().getRt(), TextureSubresourceDesc::firstSurface());
 			const TextureView motionVectorsView =
@@ -139,7 +139,7 @@ void TemporalUpscaler::populateRenderGraph(RenderingContext& ctx)
 			{
 				rgraphCtx.bindUav(0, 0, m_runCtx.m_rt);
 
-				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 			}
 			else
 			{

+ 3 - 3
AnKi/Renderer/Tonemapping.cpp

@@ -35,7 +35,7 @@ Error Tonemapping::init()
 		ANKI_CHECK(loadShaderProgram("ShaderBinaries/Tonemap.ankiprogbin", m_tonemapping.m_prog, m_tonemapping.m_grProg));
 
 		m_tonemapping.m_rtDesc = getRenderer().create2DRenderTargetDescription(
-			getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y(),
+			getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y,
 			(GrManager::getSingleton().getDeviceCapabilities().m_unalignedBbpTextureFormats) ? Format::kR8G8B8_Unorm : Format::kR8G8B8A8_Unorm,
 			"Tonemapped");
 		m_tonemapping.m_rtDesc.bake();
@@ -123,11 +123,11 @@ void Tonemapping::populateRenderGraph(RenderingContext& ctx)
 			if(preferCompute)
 			{
 				rgraphCtx.bindUav(1, 0, outRt);
-				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+				dispatchPPCompute(cmdb, 8, 8, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 			}
 			else
 			{
-				cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y());
+				cmdb.setViewport(0, 0, getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y);
 				cmdb.draw(PrimitiveTopology::kTriangles, 3);
 			}
 		});

+ 1 - 2
AnKi/Renderer/UiStage.cpp

@@ -14,8 +14,7 @@ namespace anki {
 
 Error UiStage::init()
 {
-	ANKI_CHECK(
-		UiManager::getSingleton().newCanvas(getRenderer().getPostProcessResolution().x(), getRenderer().getPostProcessResolution().y(), m_canvas));
+	ANKI_CHECK(UiManager::getSingleton().newCanvas(getRenderer().getPostProcessResolution().x, getRenderer().getPostProcessResolution().y, m_canvas));
 
 	return Error::kNone;
 }

+ 7 - 7
AnKi/Renderer/Utils/GpuVisibility.cpp

@@ -180,7 +180,7 @@ Error GpuVisibility::init()
 
 void GpuVisibility::populateRenderGraphInternal(Bool distanceBased, BaseGpuVisibilityInput& in, GpuVisibilityOutput& out)
 {
-	ANKI_ASSERT(in.m_lodReferencePoint.x() != kMaxF32);
+	ANKI_ASSERT(in.m_lodReferencePoint.x != kMaxF32);
 
 	if(RenderStateBucketContainer::getSingleton().getBucketsActiveUserCount(in.m_technique) == 0) [[unlikely]]
 	{
@@ -685,7 +685,7 @@ void GpuVisibility::populateRenderGraphInternal(Bool distanceBased, BaseGpuVisib
 				extractClipPlanes(frustumTestData->m_viewProjMat, planes);
 				for(U32 i = 0; i < 6; ++i)
 				{
-					consts->m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz(), planes[i].getOffset());
+					consts->m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz, planes[i].getOffset());
 				}
 
 				ANKI_ASSERT(kMaxLodCount == 3);
@@ -756,8 +756,8 @@ void GpuVisibility::populateRenderGraphInternal(Bool distanceBased, BaseGpuVisib
 					allocateAndBindSrvStructuredBuffer<UVec2>(cmdb, 6, 0, out.m_legacy.m_bucketIndirectArgsRanges.getSize());
 				for(U32 ibucket = 0; ibucket < out.m_legacy.m_bucketIndirectArgsRanges.getSize(); ++ibucket)
 				{
-					firstDrawIndirectArgAndCount[ibucket].x() = out.m_legacy.m_bucketIndirectArgsRanges[ibucket].m_firstInstance;
-					firstDrawIndirectArgAndCount[ibucket].y() = out.m_legacy.m_bucketIndirectArgsRanges[ibucket].m_instanceCount;
+					firstDrawIndirectArgAndCount[ibucket].x = out.m_legacy.m_bucketIndirectArgsRanges[ibucket].m_firstInstance;
+					firstDrawIndirectArgAndCount[ibucket].y = out.m_legacy.m_bucketIndirectArgsRanges[ibucket].m_instanceCount;
 				}
 
 				cmdb.bindUav(0, 0, stage2Mem.m_legacy.m_perDraw);
@@ -1076,7 +1076,7 @@ void GpuVisibilityNonRenderables::populateRenderGraph(GpuVisibilityNonRenderable
 		extractClipPlanes(viewProjectionMat, planes);
 		for(U32 i = 0; i < 6; ++i)
 		{
-			consts.m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz(), planes[i].getOffset());
+			consts.m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz, planes[i].getOffset());
 		}
 		consts.m_viewProjectionMat = viewProjectionMat;
 		cmdb.setFastConstants(&consts, sizeof(consts));
@@ -1176,7 +1176,7 @@ void GpuVisibilityAccelerationStructures::pupulateRenderGraph(GpuVisibilityAccel
 			extractClipPlanes(viewProjMat, planes);
 			for(U32 i = 0; i < 6; ++i)
 			{
-				consts.m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz(), planes[i].getOffset());
+				consts.m_clipPlanes[i] = Vec4(planes[i].getNormal().xyz, planes[i].getOffset());
 			}
 
 			consts.m_pointOfTest = pointOfTest;
@@ -1247,7 +1247,7 @@ void GpuVisibilityLocalLights::populateRenderGraph(GpuVisibilityLocalLightsInput
 	out.m_lightGridMin = newCamPos - gridSize / 2.0f;
 	out.m_lightGridMax = out.m_lightGridMin + gridSize;
 
-	const U32 cellCount = in.m_cellCounts.x() * in.m_cellCounts.y() * in.m_cellCounts.z();
+	const U32 cellCount = in.m_cellCounts.x * in.m_cellCounts.y * in.m_cellCounts.z;
 
 	const BufferView lightIndexCountsPerCellBuff = allocateStructuredBuffer<U32>(cellCount);
 	const BufferView lightIndexOffsetsPerCellBuff = allocateStructuredBuffer<U32>(cellCount);

+ 1 - 1
AnKi/Renderer/Utils/GpuVisibility.h

@@ -269,7 +269,7 @@ public:
 	void validate() const
 	{
 		ANKI_ASSERT(m_passesName.getLength() > 0);
-		ANKI_ASSERT(m_lodReferencePoint.x() != kMaxF32);
+		ANKI_ASSERT(m_lodReferencePoint.x != kMaxF32);
 		ANKI_ASSERT(m_lodReferencePoint == m_pointOfTest && "For now these should be the same");
 		ANKI_ASSERT(m_testRadius != kMaxF32);
 		ANKI_ASSERT(m_viewProjectionMatrix != Mat4());

+ 11 - 12
AnKi/Renderer/Utils/HzbGenerator.cpp

@@ -118,15 +118,14 @@ void HzbGenerator::populateRenderGraphInternal(ConstWeakArray<DispatchInput> dis
 		{
 			const DispatchInput& in = dispatchInputsCopy[dispatch];
 
-			const U8 hzbMipCount =
-				min(kMaxMipsSinglePassDownsamplerCanProduce, computeMaxMipmapCount2d(in.m_dstHzbRtSize.x(), in.m_dstHzbRtSize.y()));
+			const U8 hzbMipCount = min(kMaxMipsSinglePassDownsamplerCanProduce, computeMaxMipmapCount2d(in.m_dstHzbRtSize.x, in.m_dstHzbRtSize.y));
 
 			const U8 mipsToCompute = hzbMipCount;
 
 			varAU2(dispatchThreadGroupCountXY);
 			varAU2(workGroupOffset); // needed if Left and Top are not 0,0
 			varAU2(numWorkGroupsAndMips);
-			varAU4(rectInfo) = initAU4(0, 0, in.m_dstHzbRtSize.x() * 2, in.m_dstHzbRtSize.y() * 2);
+			varAU4(rectInfo) = initAU4(0, 0, in.m_dstHzbRtSize.x * 2, in.m_dstHzbRtSize.y * 2);
 			SpdSetup(dispatchThreadGroupCountXY, workGroupOffset, numWorkGroupsAndMips, rectInfo, mipsToCompute);
 
 			struct Constants
@@ -190,8 +189,8 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 	const UVec2 maxDepthRtSize = (in.m_depthBufferRtSize + kTileSize - 1) / kTileSize;
 	{
 		RenderTargetDesc maxDepthRtDescr("HZB max tile depth");
-		maxDepthRtDescr.m_width = maxDepthRtSize.x();
-		maxDepthRtDescr.m_height = maxDepthRtSize.y();
+		maxDepthRtDescr.m_width = maxDepthRtSize.x;
+		maxDepthRtDescr.m_height = maxDepthRtSize.y;
 		maxDepthRtDescr.m_format = Format::kR32_Sfloat;
 		maxDepthRtDescr.bake();
 		maxDepthRt = rgraph.newRenderTarget(maxDepthRtDescr);
@@ -211,7 +210,7 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 
 			cmdb.bindShaderProgram(m_maxDepthGrProg.get());
 
-			cmdb.dispatchCompute(maxDepthRtSize.x(), maxDepthRtSize.y(), 1);
+			cmdb.dispatchCompute(maxDepthRtSize.x, maxDepthRtSize.y, 1);
 		});
 	}
 
@@ -236,7 +235,7 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 				ANKI_ASSERT(minDist < M);
 
 				Vec4 v4 = in.m_cameraProjectionMatrix * Vec4(0.0f, 0.0f, -minDist, 1.0f);
-				cascadeMinDepth = saturate(v4.z() / v4.w());
+				cascadeMinDepth = saturate(v4.z / v4.w);
 			}
 			else
 			{
@@ -245,14 +244,14 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 
 			const F32 maxDist = cascade.m_cascadeMaxDistance;
 			const Vec4 v4 = in.m_cameraProjectionMatrix * Vec4(0.0f, 0.0f, -maxDist, 1.0f);
-			cascadeMaxDepth = saturate(v4.z() / v4.w());
+			cascadeMaxDepth = saturate(v4.z / v4.w);
 
 			ANKI_ASSERT(cascadeMinDepth <= cascadeMaxDepth);
 		}
 
 		RenderTargetDesc depthRtDescr(generateTempPassName("HZB boxes depth cascade:%u", i));
-		depthRtDescr.m_width = cascade.m_hzbRtSize.x() * 2;
-		depthRtDescr.m_height = cascade.m_hzbRtSize.y() * 2;
+		depthRtDescr.m_width = cascade.m_hzbRtSize.x * 2;
+		depthRtDescr.m_height = cascade.m_hzbRtSize.y * 2;
 		depthRtDescr.m_format = Format::kD16_Unorm;
 		depthRtDescr.bake();
 		depthRts[i] = rgraph.newRenderTarget(depthRtDescr);
@@ -276,7 +275,7 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 
 			cmdb.setDepthCompareOperation(CompareOperation::kGreater);
 
-			cmdb.setViewport(0, 0, viewport.x(), viewport.y());
+			cmdb.setViewport(0, 0, viewport.x, viewport.y);
 
 			cmdb.bindShaderProgram(m_maxBoxGrProg.get());
 
@@ -300,7 +299,7 @@ void HzbGenerator::populateRenderGraphDirectionalLight(const HzbDirectionalLight
 
 			cmdb.bindIndexBuffer(BufferView(m_boxIndexBuffer.get()), IndexType::kU16);
 
-			cmdb.drawIndexed(PrimitiveTopology::kTriangles, sizeof(kBoxIndices) / sizeof(kBoxIndices[0]), maxDepthRtSize.x() * maxDepthRtSize.y());
+			cmdb.drawIndexed(PrimitiveTopology::kTriangles, sizeof(kBoxIndices) / sizeof(kBoxIndices[0]), maxDepthRtSize.x * maxDepthRtSize.y);
 
 			// Restore state
 			cmdb.setDepthCompareOperation(CompareOperation::kLess);

+ 1 - 1
AnKi/Renderer/Utils/MipmapGenerator.cpp

@@ -43,7 +43,7 @@ void MipmapGenerator::populateRenderGraph(const MipmapGeneratorTargetArguments&
 					CommandBuffer& cmdb = *rgraphCtx.m_commandBuffer;
 
 					cmdb.bindShaderProgram(m_genMipsGrProg.get());
-					cmdb.setViewport(0, 0, viewport.x(), viewport.y());
+					cmdb.setViewport(0, 0, viewport.x, viewport.y);
 
 					rgraphCtx.bindSrv(0, 0, rt, TextureSubresourceDesc::surface(readMip, face, layer));
 					cmdb.bindSampler(0, 0, getRenderer().getSamplers().m_trilinearClamp.get());

+ 3 - 3
AnKi/Renderer/Utils/TraditionalDeferredShading.cpp

@@ -54,7 +54,7 @@ void TraditionalDeferredLightShading::drawLights(TraditionalDeferredLightShading
 	RenderPassWorkContext& rgraphCtx = *info.m_renderpassContext;
 
 	// Set common state for all
-	cmdb.setViewport(info.m_viewport.x(), info.m_viewport.y(), info.m_viewport.z(), info.m_viewport.w());
+	cmdb.setViewport(info.m_viewport.x, info.m_viewport.y, info.m_viewport.z, info.m_viewport.w);
 
 	// Skybox first
 	const SkyboxComponent* skyc = SceneGraph::getSingleton().getSkybox();
@@ -68,7 +68,7 @@ void TraditionalDeferredLightShading::drawLights(TraditionalDeferredLightShading
 
 		TraditionalDeferredSkyboxConstants consts = {};
 		consts.m_invertedViewProjectionMat = info.m_invViewProjectionMatrix;
-		consts.m_cameraPos = info.m_cameraPosWSpace.xyz();
+		consts.m_cameraPos = info.m_cameraPosWSpace.xyz;
 		consts.m_scale = skyc->getImageScale();
 		consts.m_bias = skyc->getImageBias();
 
@@ -99,7 +99,7 @@ void TraditionalDeferredLightShading::drawLights(TraditionalDeferredLightShading
 		TraditionalDeferredShadingConstants* consts = allocateAndBindConstants<TraditionalDeferredShadingConstants>(cmdb, 0, 0);
 
 		consts->m_invViewProjMat = info.m_invViewProjectionMatrix;
-		consts->m_cameraPos = info.m_cameraPosWSpace.xyz();
+		consts->m_cameraPos = info.m_cameraPosWSpace.xyz;
 
 		if(dirLightc)
 		{

+ 2 - 2
AnKi/Renderer/VolumetricFog.cpp

@@ -22,8 +22,8 @@ Error VolumetricFog::init()
 	const F32 qualityZ = g_cvarRenderVolumetricLightingAccumulationQualityZ;
 	m_finalZSplit = min<U32>(getRenderer().getZSplitCount() - 1, g_cvarRenderVolumetricLightingAccumulationFinalZSplit);
 
-	m_volumeSize[0] = U32(F32(getRenderer().getTileCounts().x()) * qualityXY);
-	m_volumeSize[1] = U32(F32(getRenderer().getTileCounts().y()) * qualityXY);
+	m_volumeSize[0] = U32(F32(getRenderer().getTileCounts().x) * qualityXY);
+	m_volumeSize[1] = U32(F32(getRenderer().getTileCounts().y) * qualityXY);
 	m_volumeSize[2] = U32(F32(m_finalZSplit + 1) * qualityZ);
 
 	// Shaders

+ 3 - 3
AnKi/Renderer/VolumetricLightingAccumulation.cpp

@@ -23,11 +23,11 @@ Error VolumetricLightingAccumulation::init()
 	const F32 qualityZ = g_cvarRenderVolumetricLightingAccumulationQualityZ;
 	const U32 finalZSplit = min<U32>(getRenderer().getZSplitCount() - 1, g_cvarRenderVolumetricLightingAccumulationFinalZSplit);
 
-	m_volumeSize[0] = U32(F32(getRenderer().getTileCounts().x()) * qualityXY);
-	m_volumeSize[1] = U32(F32(getRenderer().getTileCounts().y()) * qualityXY);
+	m_volumeSize[0] = U32(F32(getRenderer().getTileCounts().x) * qualityXY);
+	m_volumeSize[1] = U32(F32(getRenderer().getTileCounts().y) * qualityXY);
 	m_volumeSize[2] = U32(F32(finalZSplit + 1) * qualityZ);
 
-	if(!isAligned(getRenderer().getTileCounts().x(), m_volumeSize[0]) || !isAligned(getRenderer().getTileCounts().y(), m_volumeSize[1])
+	if(!isAligned(getRenderer().getTileCounts().x, m_volumeSize[0]) || !isAligned(getRenderer().getTileCounts().y, m_volumeSize[1])
 	   || m_volumeSize[0] == 0 || m_volumeSize[1] == 0 || m_volumeSize[2] == 0)
 	{
 		ANKI_R_LOGE("Wrong input");

+ 5 - 5
AnKi/Renderer/VrsSriGeneration.cpp

@@ -24,11 +24,11 @@ Error VrsSriGeneration::init()
 
 	// Create textures
 	const TextureUsageBit texUsage = TextureUsageBit::kShadingRate | TextureUsageBit::kUavCompute | TextureUsageBit::kAllSrv;
-	TextureInitInfo sriInitInfo = getRenderer().create2DRenderTargetInitInfo(rez.x(), rez.y(), Format::kR8_Uint, texUsage, "VrsSri");
+	TextureInitInfo sriInitInfo = getRenderer().create2DRenderTargetInitInfo(rez.x, rez.y, Format::kR8_Uint, texUsage, "VrsSri");
 	m_sriTex = getRenderer().createAndClearRenderTarget(sriInitInfo, TextureUsageBit::kShadingRate);
 
 	const UVec2 rezDownscaled = (getRenderer().getInternalResolution() / 2 + m_sriTexelDimension - 1) / m_sriTexelDimension;
-	sriInitInfo = getRenderer().create2DRenderTargetInitInfo(rezDownscaled.x(), rezDownscaled.y(), Format::kR8_Uint, texUsage, "VrsSriDownscaled");
+	sriInitInfo = getRenderer().create2DRenderTargetInitInfo(rezDownscaled.x, rezDownscaled.y, Format::kR8_Uint, texUsage, "VrsSriDownscaled");
 	m_downscaledSriTex = getRenderer().createAndClearRenderTarget(sriInitInfo, TextureUsageBit::kShadingRate);
 
 	// Load programs
@@ -116,8 +116,8 @@ void VrsSriGeneration::populateRenderGraph(RenderingContext& ctx)
 			cmdb.setFastConstants(&pc, sizeof(pc));
 
 			const U32 fakeWorkgroupSizeXorY = m_sriTexelDimension;
-			dispatchPPCompute(cmdb, fakeWorkgroupSizeXorY, fakeWorkgroupSizeXorY, getRenderer().getInternalResolution().x(),
-							  getRenderer().getInternalResolution().y());
+			dispatchPPCompute(cmdb, fakeWorkgroupSizeXorY, fakeWorkgroupSizeXorY, getRenderer().getInternalResolution().x,
+							  getRenderer().getInternalResolution().y);
 		});
 	}
 
@@ -142,7 +142,7 @@ void VrsSriGeneration::populateRenderGraph(RenderingContext& ctx)
 			const Vec4 pc(1.0f / Vec2(rezDownscaled), 0.0f, 0.0f);
 			cmdb.setFastConstants(&pc, sizeof(pc));
 
-			dispatchPPCompute(cmdb, 8, 8, rezDownscaled.x(), rezDownscaled.y());
+			dispatchPPCompute(cmdb, 8, 8, rezDownscaled.x, rezDownscaled.y);
 		});
 	}
 }

+ 1 - 1
AnKi/Resource/ImageLoader.cpp

@@ -88,7 +88,7 @@ static PtrSize calcSurfaceSize(const U32 width32, const U32 height32, const Imag
 		out = (width / 4) * (height / 4) * 8;
 		break;
 	case ImageBinaryDataCompression::kAstc:
-		out = (width / astcBlockSize.x()) * (height / astcBlockSize.y()) * 16;
+		out = (width / astcBlockSize.x) * (height / astcBlockSize.y) * 16;
 		break;
 	default:
 		ANKI_ASSERT(0);

+ 1 - 1
AnKi/Resource/MeshBinaryLoader.cpp

@@ -405,7 +405,7 @@ Error MeshBinaryLoader::storeIndicesAndPosition(U32 lod, ResourceDynamicArray<U3
 
 		for(U32 i = 0; i < tempPositions.getSize(); ++i)
 		{
-			positions[i] = Vec3(tempPositions[i].xyz()) / F32(kMaxU16);
+			positions[i] = Vec3(U16Vec3(tempPositions[i].xyz)) / F32(kMaxU16);
 			positions[i] *= Vec3(&attrib.m_scale[0]);
 			positions[i] += Vec3(&attrib.m_translation[0]);
 		}

+ 1 - 1
AnKi/Resource/MeshResource.cpp

@@ -320,7 +320,7 @@ Error MeshResource::loadAsync(MeshBinaryLoader& loader) const
 				outMeshletBoundingVolume.m_aabbMin = inMeshlet.m_boundingVolume.m_aabbMin;
 				outMeshletBoundingVolume.m_aabbMax = inMeshlet.m_boundingVolume.m_aabbMax;
 				outMeshletBoundingVolume.m_coneDirection_R8G8B8_Snorm_cosHalfAngle_R8_Snorm =
-					packSnorm4x8(Vec4(inMeshlet.m_coneDirection, cos(inMeshlet.m_coneAngle / 2.0f)));
+					Vec4(inMeshlet.m_coneDirection, cos(inMeshlet.m_coneAngle / 2.0f)).packSnorm4x8();
 				outMeshletBoundingVolume.m_coneApex = inMeshlet.m_coneApex;
 				outMeshletBoundingVolume.m_sphereRadius =
 					((outMeshletBoundingVolume.m_aabbMin + outMeshletBoundingVolume.m_aabbMax) / 2.0f - outMeshletBoundingVolume.m_aabbMax).length();

+ 1 - 1
AnKi/Scene/Components/BodyComponent.cpp

@@ -103,7 +103,7 @@ void BodyComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 
 		m_body = PhysicsWorld::getSingleton().newPhysicsBody(init);
 		m_body->setUserData(this);
-		m_creationScale = init.m_transform.getScale().xyz();
+		m_creationScale = init.m_transform.getScale().xyz;
 	}
 
 	if(info.m_node->isLocalTransformDirty())

+ 4 - 4
AnKi/Scene/Components/DecalComponent.cpp

@@ -66,15 +66,15 @@ void DecalComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 
 	m_dirty = false;
 
-	const Vec3 halfBoxSize = info.m_node->getWorldTransform().getScale().xyz();
+	const Vec3 halfBoxSize = info.m_node->getWorldTransform().getScale().xyz;
 
 	// Calculate the texture matrix
 	Transform trf = info.m_node->getWorldTransform();
 	trf.setScale(Vec3(1.0f));
 	const Mat4 viewMat = Mat4(trf).invert();
 
-	const Mat4 projMat = Mat4::calculateOrthographicProjectionMatrix(halfBoxSize.x(), -halfBoxSize.x(), halfBoxSize.y(), -halfBoxSize.y(),
-																	 -halfBoxSize.z(), halfBoxSize.z());
+	const Mat4 projMat =
+		Mat4::calculateOrthographicProjectionMatrix(halfBoxSize.x, -halfBoxSize.x, halfBoxSize.y, -halfBoxSize.y, -halfBoxSize.z, halfBoxSize.z);
 
 	const Mat4 biasMat4(0.5f, 0.0f, 0.0f, 0.5f, 0.0f, -0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
 
@@ -87,7 +87,7 @@ void DecalComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 	gpuDecal.m_diffuseBlendFactor = m_layers[LayerType::kDiffuse].m_blendFactor;
 	gpuDecal.m_roughnessMetalnessFactor = m_layers[LayerType::kRoughnessMetalness].m_blendFactor;
 	gpuDecal.m_textureMatrix = biasedProjViewMat;
-	gpuDecal.m_sphereCenter = info.m_node->getWorldTransform().getOrigin().xyz();
+	gpuDecal.m_sphereCenter = info.m_node->getWorldTransform().getOrigin().xyz;
 	gpuDecal.m_sphereRadius = halfBoxSize.length();
 
 	m_gpuSceneDecal.uploadToGpuScene(gpuDecal);

+ 4 - 4
AnKi/Scene/Components/FogDensityComponent.cpp

@@ -36,13 +36,13 @@ void FogDensityComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		GpuSceneFogDensityVolume gpuVolume;
 		if(m_type == FogDensityComponentShape::kBox)
 		{
-			gpuVolume.m_aabbMinOrSphereCenter = Vec3(-1.0f) * trf.getScale().xyz() + trf.getOrigin().xyz();
-			gpuVolume.m_aabbMaxOrSphereRadius = Vec3(+1.0f) * trf.getScale().xyz() + trf.getOrigin().xyz();
+			gpuVolume.m_aabbMinOrSphereCenter = Vec3(-1.0f) * trf.getScale().xyz + trf.getOrigin().xyz;
+			gpuVolume.m_aabbMaxOrSphereRadius = Vec3(+1.0f) * trf.getScale().xyz + trf.getOrigin().xyz;
 		}
 		else
 		{
-			gpuVolume.m_aabbMaxOrSphereRadius = Vec3(1.0f * max(max(trf.getScale().x(), trf.getScale().y()), trf.getScale().z()));
-			gpuVolume.m_aabbMinOrSphereCenter = trf.getOrigin().xyz();
+			gpuVolume.m_aabbMaxOrSphereRadius = Vec3(1.0f * max(max(trf.getScale().x, trf.getScale().y), trf.getScale().z));
+			gpuVolume.m_aabbMinOrSphereCenter = trf.getOrigin().xyz;
 		}
 		gpuVolume.m_isBox = m_type == FogDensityComponentShape::kBox;
 		gpuVolume.m_density = m_density;

+ 15 - 15
AnKi/Scene/Components/GlobalIlluminationProbeComponent.cpp

@@ -41,7 +41,7 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 
 	updated = true;
 
-	const Vec3 halfSize = info.m_node->getWorldTransform().getScale().xyz();
+	const Vec3 halfSize = info.m_node->getWorldTransform().getScale().xyz;
 	UVec3 newCellCounts = UVec3(2.0f * halfSize / m_cellSize);
 	newCellCounts = newCellCounts.max(UVec3(1));
 
@@ -51,12 +51,12 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 	{
 		m_volTex.reset(nullptr);
 		m_cellCounts = newCellCounts;
-		m_totalCellCount = m_cellCounts.x() * m_cellCounts.y() * m_cellCounts.z();
+		m_totalCellCount = m_cellCounts.x * m_cellCounts.y * m_cellCounts.z;
 	}
 
 	if(moved)
 	{
-		m_worldPos = info.m_node->getWorldTransform().getOrigin().xyz();
+		m_worldPos = info.m_node->getWorldTransform().getOrigin().xyz;
 		m_halfSize = halfSize;
 	}
 
@@ -71,9 +71,9 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 		TextureInitInfo texInit("GiProbe");
 		texInit.m_format = (GrManager::getSingleton().getDeviceCapabilities().m_unalignedBbpTextureFormats) ? Format::kR16G16B16_Sfloat
 																											: Format::kR16G16B16A16_Sfloat;
-		texInit.m_width = m_cellCounts.x() * 6;
-		texInit.m_height = m_cellCounts.y();
-		texInit.m_depth = m_cellCounts.z();
+		texInit.m_width = m_cellCounts.x * 6;
+		texInit.m_height = m_cellCounts.y;
+		texInit.m_depth = m_cellCounts.z;
 		texInit.m_type = TextureType::k3D;
 		texInit.m_usage = TextureUsageBit::kAllSrv | TextureUsageBit::kUavCompute;
 
@@ -104,10 +104,10 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 		cmdb->setFastConstants(&clearColor, sizeof(clearColor));
 
 		UVec3 wgSize;
-		wgSize.x() = (8 - 1 + m_volTex->getWidth()) / 8;
-		wgSize.y() = (8 - 1 + m_volTex->getHeight()) / 8;
-		wgSize.z() = (8 - 1 + m_volTex->getDepth()) / 8;
-		cmdb->dispatchCompute(wgSize.x(), wgSize.y(), wgSize.z());
+		wgSize.x = (8 - 1 + m_volTex->getWidth()) / 8;
+		wgSize.y = (8 - 1 + m_volTex->getHeight()) / 8;
+		wgSize.z = (8 - 1 + m_volTex->getDepth()) / 8;
+		cmdb->dispatchCompute(wgSize.x, wgSize.y, wgSize.z);
 
 		texBarrier.m_previousUsage = TextureUsageBit::kUavCompute;
 		texBarrier.m_nextUsage = TextureUsageBit::kAllSrv; // Put something random, the renderer will start from kNone
@@ -141,11 +141,11 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 		GpuSceneGlobalIlluminationProbe gpuProbe = {};
 
 		const Aabb aabb(-m_halfSize + m_worldPos, m_halfSize + m_worldPos);
-		gpuProbe.m_aabbMin = aabb.getMin().xyz();
-		gpuProbe.m_aabbMax = aabb.getMax().xyz();
+		gpuProbe.m_aabbMin = aabb.getMin().xyz;
+		gpuProbe.m_aabbMax = aabb.getMax().xyz;
 
 		gpuProbe.m_volumeTexture = m_volTexBindlessIdx;
-		gpuProbe.m_halfTexelSizeU = 1.0f / (F32(m_cellCounts.y()) * 6.0f) / 2.0f;
+		gpuProbe.m_halfTexelSizeU = 1.0f / (F32(m_cellCounts.y) * 6.0f) / 2.0f;
 		gpuProbe.m_fadeDistance = m_fadeDistance;
 		gpuProbe.m_uuid = getUuid();
 		gpuProbe.m_componentArrayIndex = getArrayIndex();
@@ -158,8 +158,8 @@ void GlobalIlluminationProbeComponent::update(SceneComponentUpdateInfo& info, Bo
 
 F32 GlobalIlluminationProbeComponent::getRenderRadius() const
 {
-	F32 effectiveDistance = max(m_halfSize.x(), m_halfSize.y());
-	effectiveDistance = max(effectiveDistance, m_halfSize.z());
+	F32 effectiveDistance = max(m_halfSize.x, m_halfSize.y);
+	effectiveDistance = max(effectiveDistance, m_halfSize.z);
 	effectiveDistance = max<F32>(effectiveDistance, g_cvarSceneProbeEffectiveDistance);
 	return effectiveDistance;
 }

+ 1 - 1
AnKi/Scene/Components/JointComponent.cpp

@@ -72,7 +72,7 @@ void JointComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		switch(m_type)
 		{
 		case JointComponentyType::kPoint:
-			m_joint = PhysicsWorld::getSingleton().newPointJoint(body1, body2, node.getWorldTransform().getOrigin().xyz());
+			m_joint = PhysicsWorld::getSingleton().newPointJoint(body1, body2, node.getWorldTransform().getOrigin().xyz);
 			break;
 		case JointComponentyType::kHinge:
 			m_joint = PhysicsWorld::getSingleton().newHingeJoint(body1, body2, node.getWorldTransform());

+ 1 - 1
AnKi/Scene/Components/LensFlareComponent.cpp

@@ -40,7 +40,7 @@ void LensFlareComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 	{
 		m_dirty = false;
 
-		m_worldPosition = info.m_node->getWorldTransform().getOrigin().xyz();
+		m_worldPosition = info.m_node->getWorldTransform().getOrigin().xyz;
 	}
 }
 

+ 17 - 15
AnKi/Scene/Components/LightComponent.cpp

@@ -123,9 +123,9 @@ void LightComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 
 		// Upload to the GPU scene
 		GpuSceneLight gpuLight = {};
-		gpuLight.m_position = m_worldTransform.getOrigin().xyz();
+		gpuLight.m_position = m_worldTransform.getOrigin().xyz;
 		gpuLight.m_radius = m_point.m_radius;
-		gpuLight.m_diffuseColor = m_diffColor.xyz();
+		gpuLight.m_diffuseColor = m_diffColor.xyz;
 		gpuLight.m_visibleRenderablesHashIndex = (reallyShadow) ? m_hash.getIndex() : 0;
 		gpuLight.m_isPointLight = 1;
 		gpuLight.m_isSpotLight = 0;
@@ -165,9 +165,9 @@ void LightComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 
 		// Upload to the GPU scene
 		GpuSceneLight gpuLight = {};
-		gpuLight.m_position = m_worldTransform.getOrigin().xyz();
+		gpuLight.m_position = m_worldTransform.getOrigin().xyz;
 		gpuLight.m_radius = m_spot.m_distance;
-		gpuLight.m_diffuseColor = m_diffColor.xyz();
+		gpuLight.m_diffuseColor = m_diffColor.xyz;
 		gpuLight.m_visibleRenderablesHashIndex = (reallyShadow) ? m_hash.getIndex() : 0;
 		gpuLight.m_isPointLight = 0;
 		gpuLight.m_isSpotLight = 1;
@@ -184,7 +184,7 @@ void LightComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		for(U32 i = 0; i < 4; ++i)
 		{
 			points[i] = m_worldTransform.transform(points[i]);
-			gpuLight.m_edgePoints[i] = points[i].xyz0();
+			gpuLight.m_edgePoints[i] = points[i].xyz0;
 		}
 
 		if(reallyShadow)
@@ -192,8 +192,8 @@ void LightComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			const Mat4 biasMat4(0.5f, 0.0f, 0.0f, 0.5f, 0.0f, -0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
 			const Mat4 proj = Mat4::calculatePerspectiveProjectionMatrix(m_spot.m_outerAngle, m_spot.m_outerAngle, kClusterObjectFrustumNearPlane,
 																		 m_spot.m_distance);
-			const Mat4 uvToAtlas(m_shadowAtlasUvViewports[0].z(), 0.0f, 0.0f, m_shadowAtlasUvViewports[0].x(), 0.0f, m_shadowAtlasUvViewports[0].w(),
-								 0.0f, m_shadowAtlasUvViewports[0].y(), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
+			const Mat4 uvToAtlas(m_shadowAtlasUvViewports[0].z, 0.0f, 0.0f, m_shadowAtlasUvViewports[0].x, 0.0f, m_shadowAtlasUvViewports[0].w, 0.0f,
+								 m_shadowAtlasUvViewports[0].y, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
 
 			m_spot.m_viewMat = Mat3x4(m_worldTransform.invert());
 			m_spot.m_viewProjMat = proj * Mat4(m_spot.m_viewMat, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
@@ -244,7 +244,9 @@ void LightComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			elevation = max(elevation, toRad(10.0f)); // Don't have it negative cause the renderer can't handle it
 
 			const F32 polarAng = kPi / 2.0f - elevation;
-			const Vec3 newDir = -sphericalToCartesian(polarAng, azimuth);
+			Vec3 newDir;
+			newDir.setFromSphericalToCartesian(polarAng, azimuth);
+			newDir = -newDir;
 
 			const Vec3 zAxis = newDir;
 			Vec3 yAxis = Vec3(0.0f, 1.0f, 0.0f);
@@ -319,7 +321,7 @@ void LightComponent::computeCascadeFrustums(const Frustum& primaryFrustum, Const
 		for(U32 cascade = 0; cascade < shadowCascadeCount; ++cascade)
 		{
 			const Sphere& sphere = boundingSpheres[cascade];
-			const Vec3 sphereCenter = sphere.getCenter().xyz();
+			const Vec3 sphereCenter = sphere.getCenter().xyz;
 			const F32 sphereRadius = sphere.getRadius();
 			const Vec3& lightDir = getDirection();
 			Array<Vec3, 2> sceneBounds = SceneGraph::getSingleton().getSceneBounds();
@@ -350,7 +352,7 @@ void LightComponent::computeCascadeFrustums(const Frustum& primaryFrustum, Const
 			rot.setZAxis(zAxis);
 			rot.setTranslationPart(Vec3(0.0f));
 
-			const Transform cascadeTransform(eye.xyz0(), rot, Vec4(1.0f, 1.0f, 1.0f, 0.0f));
+			const Transform cascadeTransform(eye.xyz0, rot, Vec4(1.0f, 1.0f, 1.0f, 0.0f));
 			const Mat4 cascadeViewMat = Mat4(cascadeTransform.invert());
 
 			// Projection
@@ -371,16 +373,16 @@ void LightComponent::computeCascadeFrustums(const Frustum& primaryFrustum, Const
 			// Now it's time to stabilize the shadows by aligning the projection matrix
 			{
 				// Project a random fixed point to the light matrix
-				const Vec4 randomPointAlmostLightSpace = (cascadeProjMat * cascadeViewMat) * Vec3(0.0f).xyz1();
+				const Vec4 randomPointAlmostLightSpace = (cascadeProjMat * cascadeViewMat) * Vec3(0.0f).xyz1;
 
 				// Chose a random low shadowmap size and align the random point
 				const F32 shadowmapSize = 128.0f;
 				const F32 shadowmapSize2 = shadowmapSize / 2.0f; // Div with 2 because the projected point is in NDC
-				const F32 alignedX = std::round(randomPointAlmostLightSpace.x() * shadowmapSize2) / shadowmapSize2;
-				const F32 alignedY = std::round(randomPointAlmostLightSpace.y() * shadowmapSize2) / shadowmapSize2;
+				const F32 alignedX = std::round(randomPointAlmostLightSpace.x * shadowmapSize2) / shadowmapSize2;
+				const F32 alignedY = std::round(randomPointAlmostLightSpace.y * shadowmapSize2) / shadowmapSize2;
 
-				const F32 dx = alignedX - randomPointAlmostLightSpace.x();
-				const F32 dy = alignedY - randomPointAlmostLightSpace.y();
+				const F32 dx = alignedX - randomPointAlmostLightSpace.x;
+				const F32 dy = alignedY - randomPointAlmostLightSpace.y;
 
 				// Fix the projection matrix by applying an offset
 				Mat4 correctionTranslationMat = Mat4::getIdentity();

+ 3 - 3
AnKi/Scene/Components/LightComponent.h

@@ -57,7 +57,7 @@ public:
 
 	F32 getLightPower() const
 	{
-		return m_diffColor.xyz().dot(Vec3(0.30f, 0.59f, 0.11f));
+		return m_diffColor.xyz.dot(Vec3(0.30f, 0.59f, 0.11f));
 	}
 
 	void setRadius(F32 x)
@@ -120,12 +120,12 @@ public:
 
 	Vec3 getDirection() const
 	{
-		return -m_worldTransform.getRotation().getZAxis().xyz();
+		return -m_worldTransform.getRotation().getZAxis().xyz;
 	}
 
 	Vec3 getWorldPosition() const
 	{
-		return m_worldTransform.getOrigin().xyz();
+		return m_worldTransform.getOrigin().xyz;
 	}
 
 	const Mat4& getSpotLightViewProjectionMatrix() const

+ 9 - 9
AnKi/Scene/Components/MaterialComponent.cpp

@@ -186,7 +186,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		if(info.m_forceUpdateSceneBounds || m_skinComponent) [[unlikely]]
 		{
 			const Aabb aabbWorld = computeAabb(*info.m_node);
-			info.updateSceneBounds(aabbWorld.getMin().xyz(), aabbWorld.getMax().xyz());
+			info.updateSceneBounds(aabbWorld.getMin().xyz, aabbWorld.getMax().xyz);
 		}
 
 		// Update the GPU scene AABBs
@@ -196,7 +196,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			for(RenderingTechnique t : EnumBitsIterable<RenderingTechnique, RenderingTechniqueBit>(mtl.getRenderingTechniques()))
 			{
 				const GpuSceneRenderableBoundingVolume gpuVolume = initGpuSceneRenderableBoundingVolume(
-					aabbWorld.getMin().xyz(), aabbWorld.getMax().xyz(), m_gpuSceneRenderable.getIndex(), m_renderStateBucketIndices[t].get());
+					aabbWorld.getMin().xyz, aabbWorld.getMax().xyz, m_gpuSceneRenderable.getIndex(), m_renderStateBucketIndices[t].get());
 
 				switch(t)
 				{
@@ -261,7 +261,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			if(diffuseRelatedMtlVar->getDataType() >= ShaderVariableDataType::kTextureFirst
 			   && diffuseRelatedMtlVar->getDataType() <= ShaderVariableDataType::kTextureLast)
 			{
-				averageDiffuse = diffuseRelatedMtlVar->getValue<ImageResourcePtr>()->getAverageColor().xyz();
+				averageDiffuse = diffuseRelatedMtlVar->getValue<ImageResourcePtr>()->getAverageColor().xyz;
 			}
 			else if(diffuseRelatedMtlVar->getDataType() == ShaderVariableDataType::kVec3)
 			{
@@ -270,7 +270,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			else if(diffuseRelatedMtlVar->getDataType() == ShaderVariableDataType::kU32 && diffuseRelatedMtlVar->tryGetImageResource())
 			{
 				// Bindless texture
-				averageDiffuse = diffuseRelatedMtlVar->tryGetImageResource()->getAverageColor().xyz();
+				averageDiffuse = diffuseRelatedMtlVar->tryGetImageResource()->getAverageColor().xyz;
 			}
 			else
 			{
@@ -318,8 +318,8 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		}
 		gpuRenderable.m_uuid = SceneGraph::getSingleton().getNewUuid();
 
-		const UVec3 u3(averageDiffuse.xyz().clamp(0.0f, 1.0f) * 255.0f);
-		gpuRenderable.m_diffuseColor = ((u3.x() << 16u) | (u3.y() << 8u) | u3.z()) & 0xFFFFFFF;
+		const UVec3 u3(averageDiffuse.xyz.clamp(0.0f, 1.0f) * 255.0f);
+		gpuRenderable.m_diffuseColor = ((u3.x << 16u) | (u3.y << 8u) | u3.z) & 0xFFFFFFF;
 		gpuRenderable.m_sceneNodeUuid = info.m_node->getUuid();
 
 		m_gpuSceneRenderable.uploadToGpuScene(gpuRenderable);
@@ -328,7 +328,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 	// Update scene bounds
 	{
 		const Aabb aabbWorld = computeAabb(*info.m_node);
-		info.updateSceneBounds(aabbWorld.getMin().xyz(), aabbWorld.getMax().xyz());
+		info.updateSceneBounds(aabbWorld.getMin().xyz, aabbWorld.getMax().xyz);
 	}
 
 	// Update the buckets
@@ -397,7 +397,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			else
 			{
 				const GpuSceneRenderableBoundingVolume gpuVolume = initGpuSceneRenderableBoundingVolume(
-					aabbWorld.getMin().xyz(), aabbWorld.getMax().xyz(), m_gpuSceneRenderable.getIndex(), m_renderStateBucketIndices[t].get());
+					aabbWorld.getMin().xyz, aabbWorld.getMax().xyz, m_gpuSceneRenderable.getIndex(), m_renderStateBucketIndices[t].get());
 
 				switch(t)
 				{
@@ -438,7 +438,7 @@ void MaterialComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 
 			const U32 bucketIdx = 0;
 			const GpuSceneRenderableBoundingVolume gpuVolume =
-				initGpuSceneRenderableBoundingVolume(aabbWorld.getMin().xyz(), aabbWorld.getMax().xyz(), m_gpuSceneRenderable.getIndex(), bucketIdx);
+				initGpuSceneRenderableBoundingVolume(aabbWorld.getMin().xyz, aabbWorld.getMax().xyz, m_gpuSceneRenderable.getIndex(), bucketIdx);
 
 			m_gpuSceneRenderableAabbRt.uploadToGpuScene(gpuVolume);
 		}

+ 2 - 2
AnKi/Scene/Components/ParticleEmitter2Component.cpp

@@ -316,8 +316,8 @@ void ParticleEmitter2Component::update(SceneComponentUpdateInfo& info, Bool& upd
 		if(m_geomType == ParticleGeometryType::kMeshComponent)
 		{
 			const MeshResource& meshr = m_meshComponent->getMeshResource();
-			emitter.m_particleAabbMin = meshr.getBoundingShape().getMin().xyz();
-			emitter.m_particleAabbMax = meshr.getBoundingShape().getMax().xyz();
+			emitter.m_particleAabbMin = meshr.getBoundingShape().getMin().xyz;
+			emitter.m_particleAabbMax = meshr.getBoundingShape().getMax().xyz;
 		}
 		else
 		{

+ 1 - 1
AnKi/Scene/Components/PlayerControllerComponent.cpp

@@ -14,7 +14,7 @@ PlayerControllerComponent::PlayerControllerComponent(SceneNode* node)
 	: SceneComponent(node, kClassType)
 {
 	PhysicsPlayerControllerInitInfo init;
-	init.m_initialPosition = node->getWorldTransform().getOrigin().xyz();
+	init.m_initialPosition = node->getWorldTransform().getOrigin().xyz;
 	m_player = PhysicsWorld::getSingleton().newPlayerController(init);
 	m_player->setUserData(this);
 

+ 7 - 7
AnKi/Scene/Components/ReflectionProbeComponent.cpp

@@ -15,7 +15,7 @@ namespace anki {
 ReflectionProbeComponent::ReflectionProbeComponent(SceneNode* node)
 	: SceneComponent(node, kClassType)
 {
-	m_worldPos = node->getWorldTransform().getOrigin().xyz();
+	m_worldPos = node->getWorldTransform().getOrigin().xyz;
 	m_gpuSceneProbe.allocate();
 
 	TextureInitInfo texInit("ReflectionProbe");
@@ -49,8 +49,8 @@ void ReflectionProbeComponent::update(SceneComponentUpdateInfo& info, Bool& upda
 
 	if(updated) [[unlikely]]
 	{
-		m_worldPos = info.m_node->getWorldTransform().getOrigin().xyz();
-		m_halfSize = info.m_node->getWorldTransform().getScale().xyz();
+		m_worldPos = info.m_node->getWorldTransform().getOrigin().xyz;
+		m_halfSize = info.m_node->getWorldTransform().getScale().xyz;
 
 		// Upload to the GPU scene
 		GpuSceneReflectionProbe gpuProbe;
@@ -58,8 +58,8 @@ void ReflectionProbeComponent::update(SceneComponentUpdateInfo& info, Bool& upda
 		gpuProbe.m_cubeTexture = m_reflectionTexBindlessIndex;
 
 		const Aabb aabbWorld(-m_halfSize + m_worldPos, m_halfSize + m_worldPos);
-		gpuProbe.m_aabbMin = aabbWorld.getMin().xyz();
-		gpuProbe.m_aabbMax = aabbWorld.getMax().xyz();
+		gpuProbe.m_aabbMin = aabbWorld.getMin().xyz;
+		gpuProbe.m_aabbMax = aabbWorld.getMax().xyz;
 
 		gpuProbe.m_uuid = getUuid();
 		gpuProbe.m_componentArrayIndex = getArrayIndex();
@@ -70,8 +70,8 @@ void ReflectionProbeComponent::update(SceneComponentUpdateInfo& info, Bool& upda
 
 F32 ReflectionProbeComponent::getRenderRadius() const
 {
-	F32 effectiveDistance = max(m_halfSize.x(), m_halfSize.y());
-	effectiveDistance = max(effectiveDistance, m_halfSize.z());
+	F32 effectiveDistance = max(m_halfSize.x, m_halfSize.y);
+	effectiveDistance = max(effectiveDistance, m_halfSize.z);
 	effectiveDistance = max<F32>(effectiveDistance, g_cvarSceneProbeEffectiveDistance);
 	return effectiveDistance;
 }

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