Browse Source

Some code style refactoring #12

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
3421d30a2c

+ 8 - 8
AnKi/Physics/Common.h

@@ -79,14 +79,14 @@ using PhysicsTriggerPtr = PhysicsPtr<PhysicsTrigger>;
 /// Material types.
 enum class PhysicsMaterialBit : U64
 {
-	NONE = 0,
-	STATIC_GEOMETRY = 1 << 0,
-	DYNAMIC_GEOMETRY = 1 << 1,
-	TRIGGER = 1 << 2,
-	PLAYER = 1 << 3,
-	PARTICLE = 1 << 4,
-
-	ALL = kMaxU64
+	kNone = 0,
+	kStaticGeometry = 1 << 0,
+	kDynamicGeometry = 1 << 1,
+	kTrigger = 1 << 2,
+	kPlayer = 1 << 3,
+	kParticle = 1 << 4,
+
+	kAll = kMaxU64
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PhysicsMaterialBit)
 

+ 4 - 4
AnKi/Physics/PhysicsBody.cpp

@@ -10,7 +10,7 @@
 namespace anki {
 
 PhysicsBody::PhysicsBody(PhysicsWorld* world, const PhysicsBodyInitInfo& init)
-	: PhysicsFilteredObject(CLASS_TYPE, world)
+	: PhysicsFilteredObject(kClassType, world)
 {
 	ANKI_ASSERT(init.m_mass >= 0.0f);
 
@@ -38,12 +38,12 @@ PhysicsBody::PhysicsBody(PhysicsWorld* world, const PhysicsBodyInitInfo& init)
 	m_body->setUserPointer(static_cast<PhysicsObject*>(this));
 
 	// Other
-	setMaterialGroup((dynamic) ? PhysicsMaterialBit::DYNAMIC_GEOMETRY : PhysicsMaterialBit::STATIC_GEOMETRY);
+	setMaterialGroup((dynamic) ? PhysicsMaterialBit::kDynamicGeometry : PhysicsMaterialBit::kStaticGeometry);
 
-	PhysicsMaterialBit collidesWith = PhysicsMaterialBit::ALL;
+	PhysicsMaterialBit collidesWith = PhysicsMaterialBit::kAll;
 	if(!dynamic)
 	{
-		collidesWith &= ~PhysicsMaterialBit::STATIC_GEOMETRY;
+		collidesWith &= ~PhysicsMaterialBit::kStaticGeometry;
 	}
 	setMaterialMask(collidesWith);
 	setTransform(init.m_transform);

+ 1 - 1
AnKi/Physics/PhysicsBody.h

@@ -26,7 +26,7 @@ public:
 /// Rigid body.
 class PhysicsBody : public PhysicsFilteredObject
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::BODY)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kBody)
 
 public:
 	const Transform& getTransform() const

+ 6 - 6
AnKi/Physics/PhysicsCollisionShape.cpp

@@ -9,7 +9,7 @@
 namespace anki {
 
 PhysicsSphere::PhysicsSphere(PhysicsWorld* world, F32 radius)
-	: PhysicsCollisionShape(world, ShapeType::SPHERE)
+	: PhysicsCollisionShape(world, ShapeType::kSphere)
 {
 	m_sphere.init(radius);
 	m_sphere->setMargin(getWorld().getCollisionMargin());
@@ -22,7 +22,7 @@ PhysicsSphere::~PhysicsSphere()
 }
 
 PhysicsBox::PhysicsBox(PhysicsWorld* world, const Vec3& extend)
-	: PhysicsCollisionShape(world, ShapeType::BOX)
+	: PhysicsCollisionShape(world, ShapeType::kBox)
 {
 	m_box.init(toBt(extend));
 	m_box->setMargin(getWorld().getCollisionMargin());
@@ -36,7 +36,7 @@ PhysicsBox::~PhysicsBox()
 
 PhysicsTriangleSoup::PhysicsTriangleSoup(PhysicsWorld* world, ConstWeakArray<Vec3> positions,
 										 ConstWeakArray<U32> indices, Bool convex)
-	: PhysicsCollisionShape(world, ShapeType::TRI_MESH)
+	: PhysicsCollisionShape(world, ShapeType::kTrimesh)
 {
 	if(!convex)
 	{
@@ -63,7 +63,7 @@ PhysicsTriangleSoup::PhysicsTriangleSoup(PhysicsWorld* world, ConstWeakArray<Vec
 	}
 	else
 	{
-		m_type = ShapeType::CONVEX; // Fake the type
+		m_type = ShapeType::kConvex; // Fake the type
 
 		m_convex.init(&positions[0][0], I32(positions.getSize()), U32(sizeof(Vec3)));
 		m_convex->setMargin(getWorld().getCollisionMargin());
@@ -73,7 +73,7 @@ PhysicsTriangleSoup::PhysicsTriangleSoup(PhysicsWorld* world, ConstWeakArray<Vec
 
 PhysicsTriangleSoup::~PhysicsTriangleSoup()
 {
-	if(m_type == ShapeType::TRI_MESH)
+	if(m_type == ShapeType::kTrimesh)
 	{
 		m_triMesh.m_dynamic.destroy();
 		m_triMesh.m_static.destroy();
@@ -81,7 +81,7 @@ PhysicsTriangleSoup::~PhysicsTriangleSoup()
 	}
 	else
 	{
-		ANKI_ASSERT(m_type == ShapeType::CONVEX);
+		ANKI_ASSERT(m_type == ShapeType::kConvex);
 		m_convex.destroy();
 	}
 }

+ 14 - 14
AnKi/Physics/PhysicsCollisionShape.h

@@ -17,7 +17,7 @@ namespace anki {
 /// The base of all collision shapes.
 class PhysicsCollisionShape : public PhysicsObject
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::COLLISION_SHAPE)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kCollisionShape)
 
 public:
 	ANKI_INTERNAL const btCollisionShape* getBtShape(Bool forDynamicBodies = false) const
@@ -33,10 +33,10 @@ public:
 protected:
 	enum class ShapeType : U8
 	{
-		BOX,
-		SPHERE,
-		CONVEX,
-		TRI_MESH
+		kBox,
+		kSphere,
+		kConvex,
+		kTrimesh
 	};
 
 	class TriMesh
@@ -58,7 +58,7 @@ protected:
 	ShapeType m_type;
 
 	PhysicsCollisionShape(PhysicsWorld* world, ShapeType type)
-		: PhysicsObject(CLASS_TYPE, world)
+		: PhysicsObject(kClassType, world)
 		, m_type(type)
 	{
 	}
@@ -67,13 +67,13 @@ protected:
 	{
 		switch(m_type)
 		{
-		case ShapeType::BOX:
+		case ShapeType::kBox:
 			return m_box.get();
-		case ShapeType::SPHERE:
+		case ShapeType::kSphere:
 			return m_sphere.get();
-		case ShapeType::CONVEX:
+		case ShapeType::kConvex:
 			return m_convex.get();
-		case ShapeType::TRI_MESH:
+		case ShapeType::kTrimesh:
 			if(forDynamicBodies)
 			{
 				return m_triMesh.m_dynamic.get();
@@ -100,7 +100,7 @@ protected:
 /// Sphere collision shape.
 class PhysicsSphere final : public PhysicsCollisionShape
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::COLLISION_SHAPE)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kCollisionShape)
 
 private:
 	PhysicsSphere(PhysicsWorld* world, F32 radius);
@@ -111,7 +111,7 @@ private:
 /// Box collision shape.
 class PhysicsBox final : public PhysicsCollisionShape
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::COLLISION_SHAPE)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kCollisionShape)
 
 private:
 	PhysicsBox(PhysicsWorld* world, const Vec3& extend);
@@ -122,7 +122,7 @@ private:
 /// Convex hull collision shape.
 class PhysicsConvexHull final : public PhysicsCollisionShape
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::COLLISION_SHAPE)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kCollisionShape)
 
 private:
 	PhysicsConvexHull(PhysicsWorld* world, const Vec3* positions, U32 positionsCount, U32 positionsStride);
@@ -133,7 +133,7 @@ private:
 /// Static triangle mesh shape.
 class PhysicsTriangleSoup final : public PhysicsCollisionShape
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::COLLISION_SHAPE)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kCollisionShape)
 
 private:
 	ClassWrapper<btTriangleMesh> m_mesh;

+ 4 - 4
AnKi/Physics/PhysicsJoint.cpp

@@ -10,7 +10,7 @@
 namespace anki {
 
 PhysicsJoint::PhysicsJoint(PhysicsWorld* world, JointType type)
-	: PhysicsObject(CLASS_TYPE, world)
+	: PhysicsObject(kClassType, world)
 	, m_type(type)
 {
 }
@@ -26,7 +26,7 @@ void PhysicsJoint::unregisterFromWorld()
 }
 
 PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos)
-	: PhysicsJoint(world, JointType::P2P)
+	: PhysicsJoint(world, JointType::kP2P)
 {
 	m_bodyA = bodyA;
 	m_p2p.init(*m_bodyA->getBtBody(), toBt(relPos));
@@ -35,7 +35,7 @@ PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBod
 
 PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPosA,
 												 PhysicsBodyPtr bodyB, const Vec3& relPosB)
-	: PhysicsJoint(world, JointType::P2P)
+	: PhysicsJoint(world, JointType::kP2P)
 {
 	ANKI_ASSERT(bodyA != bodyB);
 	m_bodyA = bodyA;
@@ -51,7 +51,7 @@ PhysicsPoint2PointJoint::~PhysicsPoint2PointJoint()
 }
 
 PhysicsHingeJoint::PhysicsHingeJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos, const Vec3& axis)
-	: PhysicsJoint(world, JointType::HINGE)
+	: PhysicsJoint(world, JointType::kHinge)
 {
 	m_bodyA = bodyA;
 	m_hinge.init(*m_bodyA->getBtBody(), toBt(relPos), toBt(axis));

+ 7 - 7
AnKi/Physics/PhysicsJoint.h

@@ -16,7 +16,7 @@ namespace anki {
 /// Joint base class. Joints connect two (or a single one) rigid bodies together.
 class PhysicsJoint : public PhysicsObject
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::JOINT)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kJoint)
 
 public:
 	/// Set the breaking impulse.
@@ -49,8 +49,8 @@ protected:
 
 	enum class JointType : U8
 	{
-		P2P,
-		HINGE,
+		kP2P,
+		kHinge,
 	};
 
 	JointType m_type;
@@ -74,9 +74,9 @@ protected:
 	{
 		switch(m_type)
 		{
-		case JointType::P2P:
+		case JointType::kP2P:
 			return m_p2p.get();
-		case JointType::HINGE:
+		case JointType::kHinge:
 			return m_hinge.get();
 		default:
 			ANKI_ASSERT(0);
@@ -88,7 +88,7 @@ protected:
 /// Point to point joint.
 class PhysicsPoint2PointJoint : public PhysicsJoint
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::JOINT)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kJoint)
 
 private:
 	PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos);
@@ -102,7 +102,7 @@ private:
 /// Hinge joint.
 class PhysicsHingeJoint : public PhysicsJoint
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::JOINT)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kJoint)
 
 private:
 	PhysicsHingeJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos, const Vec3& axis);

+ 18 - 18
AnKi/Physics/PhysicsObject.h

@@ -16,17 +16,17 @@ namespace anki {
 /// Type of the physics object.
 enum class PhysicsObjectType : U8
 {
-	COLLISION_SHAPE,
-	JOINT,
-	BODY,
-	PLAYER_CONTROLLER,
-	TRIGGER,
-
-	COUNT,
-	FIRST = 0,
-	LAST = COUNT - 1,
-	FIRST_FILTERED = BODY,
-	LAST_FILTERED = TRIGGER,
+	kCollisionShape,
+	kJoint,
+	kBody,
+	kPlayerController,
+	kTrigger,
+
+	kCount,
+	kFirst = 0,
+	kLast = kCount - 1,
+	kFirstFiltered = kBody,
+	kLastFiltered = kTrigger,
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PhysicsObjectType)
 
@@ -39,7 +39,7 @@ ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PhysicsObjectType)
 #define ANKI_PHYSICS_OBJECT(type) \
 	ANKI_PHYSICS_OBJECT_FRIENDS \
 public: \
-	static constexpr PhysicsObjectType CLASS_TYPE = type; \
+	static constexpr PhysicsObjectType kClassType = type; \
 \
 private:
 
@@ -156,8 +156,8 @@ public:
 
 	static Bool classof(const PhysicsObject* obj)
 	{
-		return obj->getType() >= PhysicsObjectType::FIRST_FILTERED
-			   && obj->getType() <= PhysicsObjectType::LAST_FILTERED;
+		return obj->getType() >= PhysicsObjectType::kFirstFiltered
+			   && obj->getType() <= PhysicsObjectType::kLastFiltered;
 	}
 
 	/// Get the material(s) this object belongs.
@@ -197,13 +197,13 @@ public:
 	}
 
 private:
-	PhysicsMaterialBit m_materialGroup = PhysicsMaterialBit::ALL;
-	PhysicsMaterialBit m_materialMask = PhysicsMaterialBit::ALL;
+	PhysicsMaterialBit m_materialGroup = PhysicsMaterialBit::kAll;
+	PhysicsMaterialBit m_materialMask = PhysicsMaterialBit::kAll;
 
 	PhysicsBroadPhaseFilterCallback* m_filter = nullptr;
 
-	static constexpr U32 MAX_TRIGGER_FILTERED_PAIRS = 4;
-	Array<PhysicsTriggerFilteredPair*, MAX_TRIGGER_FILTERED_PAIRS> m_triggerFilteredPairs = {};
+	static constexpr U32 kMaxTriggerFilteredPairs = 4;
+	Array<PhysicsTriggerFilteredPair*, kMaxTriggerFilteredPairs> m_triggerFilteredPairs = {};
 };
 /// @}
 

+ 3 - 3
AnKi/Physics/PhysicsPlayerController.cpp

@@ -9,7 +9,7 @@
 namespace anki {
 
 PhysicsPlayerController::PhysicsPlayerController(PhysicsWorld* world, const PhysicsPlayerControllerInitInfo& init)
-	: PhysicsFilteredObject(CLASS_TYPE, world)
+	: PhysicsFilteredObject(kClassType, world)
 {
 	const btTransform trf = toBt(Transform(init.m_position.xyz0(), Mat3x4::getIdentity(), 1.0f));
 
@@ -19,8 +19,8 @@ PhysicsPlayerController::PhysicsPlayerController(PhysicsWorld* world, const Phys
 	m_ghostObject->setWorldTransform(trf);
 	m_ghostObject->setCollisionShape(m_convexShape.get());
 	m_ghostObject->setUserPointer(static_cast<PhysicsObject*>(this));
-	setMaterialGroup(PhysicsMaterialBit::PLAYER);
-	setMaterialMask(PhysicsMaterialBit::ALL);
+	setMaterialGroup(PhysicsMaterialBit::kPlayer);
+	setMaterialMask(PhysicsMaterialBit::kAll);
 
 	m_controller.init(m_ghostObject.get(), m_convexShape.get(), init.m_stepHeight, btVector3(0, 1, 0));
 

+ 1 - 1
AnKi/Physics/PhysicsPlayerController.h

@@ -28,7 +28,7 @@ public:
 /// A player controller that walks the world.
 class PhysicsPlayerController final : public PhysicsFilteredObject
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::PLAYER_CONTROLLER)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kPlayerController)
 
 public:
 	// Update the state machine

+ 3 - 3
AnKi/Physics/PhysicsTrigger.cpp

@@ -11,7 +11,7 @@
 namespace anki {
 
 PhysicsTrigger::PhysicsTrigger(PhysicsWorld* world, PhysicsCollisionShapePtr shape)
-	: PhysicsFilteredObject(CLASS_TYPE, world)
+	: PhysicsFilteredObject(kClassType, world)
 {
 	m_shape = shape;
 
@@ -24,8 +24,8 @@ PhysicsTrigger::PhysicsTrigger(PhysicsWorld* world, PhysicsCollisionShapePtr sha
 
 	m_ghostShape->setUserPointer(static_cast<PhysicsObject*>(this));
 
-	setMaterialGroup(PhysicsMaterialBit::TRIGGER);
-	setMaterialMask(PhysicsMaterialBit::ALL ^ PhysicsMaterialBit::STATIC_GEOMETRY);
+	setMaterialGroup(PhysicsMaterialBit::kTrigger);
+	setMaterialMask(PhysicsMaterialBit::kAll ^ PhysicsMaterialBit::kStaticGeometry);
 }
 
 PhysicsTrigger::~PhysicsTrigger()

+ 1 - 1
AnKi/Physics/PhysicsTrigger.h

@@ -39,7 +39,7 @@ public:
 /// A trigger that uses a PhysicsShape and its purpose is to collect collision events.
 class PhysicsTrigger : public PhysicsFilteredObject
 {
-	ANKI_PHYSICS_OBJECT(PhysicsObjectType::TRIGGER)
+	ANKI_PHYSICS_OBJECT(PhysicsObjectType::kTrigger)
 
 public:
 	Transform getTransform() const

+ 4 - 4
AnKi/Physics/PhysicsWorld.cpp

@@ -60,8 +60,8 @@ public:
 		}
 
 		// Reject if they are both static
-		if(ANKI_UNLIKELY(fobj0->getMaterialGroup() == PhysicsMaterialBit::STATIC_GEOMETRY
-						 && fobj1->getMaterialGroup() == PhysicsMaterialBit::STATIC_GEOMETRY))
+		if(ANKI_UNLIKELY(fobj0->getMaterialGroup() == PhysicsMaterialBit::kStaticGeometry
+						 && fobj1->getMaterialGroup() == PhysicsMaterialBit::kStaticGeometry))
 		{
 			return false;
 		}
@@ -243,7 +243,7 @@ void PhysicsWorld::update(Second dt)
 	}
 
 	// Update the player controllers
-	for(PhysicsObject& obj : m_objectLists[PhysicsObjectType::PLAYER_CONTROLLER])
+	for(PhysicsObject& obj : m_objectLists[PhysicsObjectType::kPlayerController])
 	{
 		PhysicsPlayerController& playerController = static_cast<PhysicsPlayerController&>(obj);
 		playerController.moveToPositionForReal();
@@ -253,7 +253,7 @@ void PhysicsWorld::update(Second dt)
 	m_world->stepSimulation(F32(dt), 1, 1.0f / 60.0f);
 
 	// Process trigger contacts
-	for(PhysicsObject& trigger : m_objectLists[PhysicsObjectType::TRIGGER])
+	for(PhysicsObject& trigger : m_objectLists[PhysicsObjectType::kTrigger])
 	{
 		static_cast<PhysicsTrigger&>(trigger).processContacts();
 	}

+ 1 - 1
AnKi/Physics/PhysicsWorld.h

@@ -129,7 +129,7 @@ private:
 	ClassWrapper<btSequentialImpulseConstraintSolver> m_solver;
 	ClassWrapper<btDiscreteDynamicsWorld> m_world;
 
-	Array<IntrusiveList<PhysicsObject>, U(PhysicsObjectType::COUNT)> m_objectLists;
+	Array<IntrusiveList<PhysicsObject>, U(PhysicsObjectType::kCount)> m_objectLists;
 	IntrusiveList<PhysicsObject> m_markedForCreation;
 	IntrusiveList<PhysicsObject> m_markedForDeletion;
 	Mutex m_markedMtx; ///< Locks the above

+ 7 - 7
AnKi/Renderer/Dbg.h

@@ -35,38 +35,38 @@ public:
 
 	Bool getDepthTestEnabled() const
 	{
-		return m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+		return m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 	}
 
 	void setDepthTestEnabled(Bool enable)
 	{
-		m_debugDrawFlags.set(RenderQueueDebugDrawFlag::DEPTH_TEST_ON, enable);
+		m_debugDrawFlags.set(RenderQueueDebugDrawFlag::kDepthTestOn, enable);
 	}
 
 	void switchDepthTestEnabled()
 	{
-		m_debugDrawFlags.flip(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+		m_debugDrawFlags.flip(RenderQueueDebugDrawFlag::kDepthTestOn);
 	}
 
 	Bool getDitheredDepthTestEnabled() const
 	{
-		return m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON);
+		return m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn);
 	}
 
 	void setDitheredDepthTestEnabled(Bool enable)
 	{
-		m_debugDrawFlags.set(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON, enable);
+		m_debugDrawFlags.set(RenderQueueDebugDrawFlag::kDitheredDepthTestOn, enable);
 	}
 
 	void switchDitheredDepthTestEnabled()
 	{
-		m_debugDrawFlags.flip(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON);
+		m_debugDrawFlags.flip(RenderQueueDebugDrawFlag::kDitheredDepthTestOn);
 	}
 
 private:
 	RenderTargetDescription m_rtDescr;
 	FramebufferDescription m_fbDescr;
-	BitSet<U(RenderQueueDebugDrawFlag::COUNT), U32> m_debugDrawFlags = {false};
+	BitSet<U(RenderQueueDebugDrawFlag::kCount), U32> m_debugDrawFlags = {false};
 
 	class
 	{

+ 4 - 4
AnKi/Renderer/RenderQueue.h

@@ -29,9 +29,9 @@ public:
 /// Some options that can be used as hints in debug drawcalls.
 enum class RenderQueueDebugDrawFlag : U32
 {
-	DEPTH_TEST_ON,
-	DITHERED_DEPTH_TEST_ON,
-	COUNT
+	kDepthTestOn,
+	kDitheredDepthTestOn,
+	kCount
 };
 
 /// Context that contains variables for drawing and will be passed to RenderQueueDrawCallback.
@@ -44,7 +44,7 @@ public:
 	StagingGpuMemoryPool* m_stagingGpuAllocator ANKI_DEBUG_CODE(= nullptr);
 	StackAllocator<U8> m_frameAllocator;
 	Bool m_debugDraw; ///< If true the drawcall should be drawing some kind of debug mesh.
-	BitSet<U(RenderQueueDebugDrawFlag::COUNT), U32> m_debugDrawFlags = {false};
+	BitSet<U(RenderQueueDebugDrawFlag::kCount), U32> m_debugDrawFlags = {false};
 };
 
 /// Draw callback for drawing.

+ 21 - 21
AnKi/Renderer/Scale.cpp

@@ -53,34 +53,34 @@ Error Scale::init()
 	{
 		if(dlssQuality > 0 && getGrManager().getDeviceCapabilities().m_dlss)
 		{
-			m_upscalingMethod = UpscalingMethod::GR;
+			m_upscalingMethod = UpscalingMethod::kGr;
 		}
 		else if(fsrQuality > 0)
 		{
-			m_upscalingMethod = UpscalingMethod::FSR;
+			m_upscalingMethod = UpscalingMethod::kFsr;
 		}
 		else
 		{
-			m_upscalingMethod = UpscalingMethod::BILINEAR;
+			m_upscalingMethod = UpscalingMethod::kBilinear;
 		}
 	}
 	else
 	{
-		m_upscalingMethod = UpscalingMethod::NONE;
+		m_upscalingMethod = UpscalingMethod::kNone;
 	}
 
-	m_sharpenMethod = (needsSharpening) ? SharpenMethod::RCAS : SharpenMethod::NONE;
-	m_neeedsTonemapping = (m_upscalingMethod == UpscalingMethod::GR); // Because GR upscaling spits HDR
+	m_sharpenMethod = (needsSharpening) ? SharpenMethod::kRcas : SharpenMethod::kNone;
+	m_neeedsTonemapping = (m_upscalingMethod == UpscalingMethod::kGr); // Because GR upscaling spits HDR
 
-	static constexpr Array<const Char*, U32(UpscalingMethod::COUNT)> upscalingMethodNames = {"none", "bilinear",
-																							 "FSR 1.0", "DLSS 2"};
-	static constexpr Array<const Char*, U32(SharpenMethod::COUNT)> sharpenMethodNames = {"none", "RCAS"};
+	static constexpr Array<const Char*, U32(UpscalingMethod::kCount)> upscalingMethodNames = {"none", "bilinear",
+																							  "FSR 1.0", "DLSS 2"};
+	static constexpr Array<const Char*, U32(SharpenMethod::kCount)> sharpenMethodNames = {"none", "RCAS"};
 
 	ANKI_R_LOGV("Initializing upscaling. Upscaling method %s, sharpenning method %s",
 				upscalingMethodNames[U32(m_upscalingMethod)], sharpenMethodNames[U32(m_sharpenMethod)]);
 
 	// Scale programs
-	if(m_upscalingMethod == UpscalingMethod::BILINEAR)
+	if(m_upscalingMethod == UpscalingMethod::kBilinear)
 	{
 		const CString shaderFname =
 			(preferCompute) ? "ShaderBinaries/BlitCompute.ankiprogbin" : "ShaderBinaries/BlitRaster.ankiprogbin";
@@ -91,7 +91,7 @@ Error Scale::init()
 		m_scaleProg->getOrCreateVariant(variant);
 		m_scaleGrProg = variant->getProgram();
 	}
-	else if(m_upscalingMethod == UpscalingMethod::FSR)
+	else if(m_upscalingMethod == UpscalingMethod::kFsr)
 	{
 		const CString shaderFname =
 			(preferCompute) ? "ShaderBinaries/FsrCompute.ankiprogbin" : "ShaderBinaries/FsrRaster.ankiprogbin";
@@ -105,7 +105,7 @@ Error Scale::init()
 		m_scaleProg->getOrCreateVariant(variantInitInfo, variant);
 		m_scaleGrProg = variant->getProgram();
 	}
-	else if(m_upscalingMethod == UpscalingMethod::GR)
+	else if(m_upscalingMethod == UpscalingMethod::kGr)
 	{
 		GrUpscalerInitInfo inf;
 		inf.m_sourceTextureResolution = m_r->getInternalResolution();
@@ -117,7 +117,7 @@ Error Scale::init()
 	}
 
 	// Sharpen programs
-	if(m_sharpenMethod == SharpenMethod::RCAS)
+	if(m_sharpenMethod == SharpenMethod::kRcas)
 	{
 		ANKI_CHECK(getResourceManager().loadResource((preferCompute) ? "ShaderBinaries/FsrCompute.ankiprogbin"
 																	 : "ShaderBinaries/FsrRaster.ankiprogbin",
@@ -143,7 +143,7 @@ Error Scale::init()
 
 	// Descriptors
 	Format format;
-	if(m_upscalingMethod == UpscalingMethod::GR)
+	if(m_upscalingMethod == UpscalingMethod::kGr)
 	{
 		format = m_r->getHdrFormat();
 	}
@@ -178,7 +178,7 @@ Error Scale::init()
 
 void Scale::populateRenderGraph(RenderingContext& ctx)
 {
-	if(m_upscalingMethod == UpscalingMethod::NONE && m_sharpenMethod == SharpenMethod::NONE)
+	if(m_upscalingMethod == UpscalingMethod::kNone && m_sharpenMethod == SharpenMethod::kNone)
 	{
 		m_runCtx.m_upscaledTonemappedRt = m_r->getTemporalAA().getTonemappedRt();
 		m_runCtx.m_upscaledHdrRt = m_r->getTemporalAA().getHdrRt();
@@ -191,7 +191,7 @@ void Scale::populateRenderGraph(RenderingContext& ctx)
 	const Bool preferCompute = getConfig().getRPreferCompute();
 
 	// Step 1: Upscaling
-	if(m_upscalingMethod == UpscalingMethod::GR)
+	if(m_upscalingMethod == UpscalingMethod::kGr)
 	{
 		m_runCtx.m_upscaledHdrRt = rgraph.newRenderTarget(m_upscaleAndSharpenRtDescr);
 		m_runCtx.m_upscaledTonemappedRt = {};
@@ -212,7 +212,7 @@ void Scale::populateRenderGraph(RenderingContext& ctx)
 			runGrUpscaling(ctx, rgraphCtx);
 		});
 	}
-	else if(m_upscalingMethod == UpscalingMethod::FSR || m_upscalingMethod == UpscalingMethod::BILINEAR)
+	else if(m_upscalingMethod == UpscalingMethod::kFsr || m_upscalingMethod == UpscalingMethod::kBilinear)
 	{
 		m_runCtx.m_upscaledTonemappedRt = rgraph.newRenderTarget(m_upscaleAndSharpenRtDescr);
 		m_runCtx.m_upscaledHdrRt = {};
@@ -243,7 +243,7 @@ void Scale::populateRenderGraph(RenderingContext& ctx)
 	}
 	else
 	{
-		ANKI_ASSERT(m_upscalingMethod == UpscalingMethod::NONE);
+		ANKI_ASSERT(m_upscalingMethod == UpscalingMethod::kNone);
 		// Pretend that it got scaled
 		m_runCtx.m_upscaledTonemappedRt = m_r->getTemporalAA().getTonemappedRt();
 		m_runCtx.m_upscaledHdrRt = m_r->getTemporalAA().getHdrRt();
@@ -284,7 +284,7 @@ void Scale::populateRenderGraph(RenderingContext& ctx)
 	}
 
 	// Step 3: Sharpenning
-	if(m_sharpenMethod == SharpenMethod::RCAS)
+	if(m_sharpenMethod == SharpenMethod::kRcas)
 	{
 		m_runCtx.m_sharpenedRt = rgraph.newRenderTarget(m_upscaleAndSharpenRtDescr);
 		const RenderTargetHandle inRt = m_runCtx.m_tonemappedRt;
@@ -314,7 +314,7 @@ void Scale::populateRenderGraph(RenderingContext& ctx)
 	}
 	else
 	{
-		ANKI_ASSERT(m_sharpenMethod == SharpenMethod::NONE);
+		ANKI_ASSERT(m_sharpenMethod == SharpenMethod::kNone);
 		// Pretend that it's sharpened
 		m_runCtx.m_sharpenedRt = m_runCtx.m_tonemappedRt;
 	}
@@ -337,7 +337,7 @@ void Scale::runFsrOrBilinearScaling(RenderPassWorkContext& rgraphCtx)
 		rgraphCtx.bindImage(0, 2, outRt);
 	}
 
-	if(m_upscalingMethod == UpscalingMethod::FSR)
+	if(m_upscalingMethod == UpscalingMethod::kFsr)
 	{
 		class
 		{

+ 10 - 10
AnKi/Renderer/Scale.h

@@ -67,23 +67,23 @@ private:
 
 	enum class UpscalingMethod : U8
 	{
-		NONE,
-		BILINEAR,
-		FSR,
-		GR,
-		COUNT
+		kNone,
+		kBilinear,
+		kFsr,
+		kGr,
+		kCount
 	};
 
-	UpscalingMethod m_upscalingMethod = UpscalingMethod::NONE;
+	UpscalingMethod m_upscalingMethod = UpscalingMethod::kNone;
 
 	enum class SharpenMethod : U8
 	{
-		NONE,
-		RCAS,
-		COUNT
+		kNone,
+		kRcas,
+		kCount
 	};
 
-	SharpenMethod m_sharpenMethod = SharpenMethod::NONE;
+	SharpenMethod m_sharpenMethod = SharpenMethod::kNone;
 
 	Bool m_neeedsTonemapping = false;
 

+ 13 - 13
AnKi/Renderer/ShadowMapping.cpp

@@ -413,7 +413,7 @@ TileAllocatorResult ShadowMapping::allocateTilesAndScratchTiles(U64 lightUuid, U
 	ANKI_ASSERT(drawcallsCount);
 	ANKI_ASSERT(lods);
 
-	TileAllocatorResult res = TileAllocatorResult::ALLOCATION_FAILED;
+	TileAllocatorResult res = TileAllocatorResult::kAllocationFailed;
 
 	// Allocate atlas tiles first. They may be cached and that will affect how many scratch tiles we'll need
 	for(U i = 0; i < faceCount; ++i)
@@ -422,7 +422,7 @@ TileAllocatorResult ShadowMapping::allocateTilesAndScratchTiles(U64 lightUuid, U
 		res = m_atlas.m_tileAlloc.allocate(m_r->getGlobalTimestamp(), faceTimestamps[i], lightUuid, faceIndices[i],
 										   drawcallsCount[i], lods[i], tileRanges);
 
-		if(res == TileAllocatorResult::ALLOCATION_FAILED)
+		if(res == TileAllocatorResult::kAllocationFailed)
 		{
 			ANKI_R_LOGW("There is not enough space in the shadow atlas for more shadow maps. "
 						"Increase the RShadowMappingTileCountPerRowOrColumn or decrease the scene's shadow casters");
@@ -445,18 +445,18 @@ TileAllocatorResult ShadowMapping::allocateTilesAndScratchTiles(U64 lightUuid, U
 	// Allocate scratch tiles
 	for(U i = 0; i < faceCount; ++i)
 	{
-		if(subResults[i] == TileAllocatorResult::CACHED)
+		if(subResults[i] == TileAllocatorResult::kCached)
 		{
 			continue;
 		}
 
-		ANKI_ASSERT(subResults[i] == TileAllocatorResult::ALLOCATION_SUCCEEDED);
+		ANKI_ASSERT(subResults[i] == TileAllocatorResult::kAllocationSucceded);
 
 		Array<U32, 4> tileRanges;
 		res = m_scratch.m_tileAlloc.allocate(m_r->getGlobalTimestamp(), faceTimestamps[i], lightUuid, faceIndices[i],
 											 drawcallsCount[i], lods[i], tileRanges);
 
-		if(res == TileAllocatorResult::ALLOCATION_FAILED)
+		if(res == TileAllocatorResult::kAllocationFailed)
 		{
 			ANKI_R_LOGW("Don't have enough space in the scratch shadow mapping buffer. "
 						"If you see this message too often increase RShadowMappingScratchTileCountX/Y");
@@ -508,12 +508,12 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 		static Bool firstRun = true;
 		if(firstRun)
 		{
-			ANKI_ASSERT(res == TileAllocatorResult::ALLOCATION_SUCCEEDED);
+			ANKI_ASSERT(res == TileAllocatorResult::kAllocationSucceded);
 			firstRun = false;
 		}
 		else
 		{
-			ANKI_ASSERT(res == TileAllocatorResult::CACHED);
+			ANKI_ASSERT(res == TileAllocatorResult::kCached);
 		}
 #endif
 	}
@@ -560,7 +560,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 			|| allocateTilesAndScratchTiles(light.m_uuid, activeCascades, &timestamps[0], &cascadeIndices[0],
 											&drawcallCounts[0], &lods[0], &atlasViewports[0], &scratchViewports[0],
 											&subResults[0])
-				   == TileAllocatorResult::ALLOCATION_FAILED;
+				   == TileAllocatorResult::kAllocationFailed;
 
 		if(!allocationFailed)
 		{
@@ -647,7 +647,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 			|| allocateTilesAndScratchTiles(light.m_uuid, numOfFacesThatHaveDrawcalls, &timestamps[0], &faceIndices[0],
 											&drawcallCounts[0], &lods[0], &atlasViewports[0], &scratchViewports[0],
 											&subResults[0])
-				   == TileAllocatorResult::ALLOCATION_FAILED;
+				   == TileAllocatorResult::kAllocationFailed;
 
 		if(!allocationFailed)
 		{
@@ -673,7 +673,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 					light.m_shadowAtlasTileOffsets[face].x() = (F32(atlasViewport[0]) + 0.5f) / atlasResolution;
 					light.m_shadowAtlasTileOffsets[face].y() = (F32(atlasViewport[1]) + 0.5f) / atlasResolution;
 
-					if(subResults[numOfFacesThatHaveDrawcalls] != TileAllocatorResult::CACHED)
+					if(subResults[numOfFacesThatHaveDrawcalls] != TileAllocatorResult::kCached)
 					{
 						newScratchAndAtlasResloveRenderWorkItems(
 							atlasViewport, scratchViewport, blurAtlas, light.m_shadowRenderQueues[face],
@@ -712,7 +712,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 
 		// Allocate tiles
 		U32 faceIdx = 0;
-		TileAllocatorResult subResult = TileAllocatorResult::ALLOCATION_FAILED;
+		TileAllocatorResult subResult = TileAllocatorResult::kAllocationFailed;
 		UVec4 atlasViewport;
 		UVec4 scratchViewport;
 		const U32 localDrawcallCount = light.m_shadowRenderQueue->m_renderables.getSize();
@@ -726,7 +726,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 			|| allocateTilesAndScratchTiles(
 				   light.m_uuid, 1, &light.m_shadowRenderQueue->m_shadowRenderablesLastUpdateTimestamp, &faceIdx,
 				   &localDrawcallCount, &lod, &atlasViewport, &scratchViewport, &subResult)
-				   == TileAllocatorResult::ALLOCATION_FAILED;
+				   == TileAllocatorResult::kAllocationFailed;
 
 		if(!allocationFailed)
 		{
@@ -735,7 +735,7 @@ void ShadowMapping::processLights(RenderingContext& ctx, U32& threadCountForScra
 			// Update the texture matrix to point to the correct region in the atlas
 			light.m_textureMatrix = createSpotLightTextureMatrix(atlasViewport) * light.m_textureMatrix;
 
-			if(subResult != TileAllocatorResult::CACHED)
+			if(subResult != TileAllocatorResult::kCached)
 			{
 				newScratchAndAtlasResloveRenderWorkItems(atlasViewport, scratchViewport, blurAtlas,
 														 light.m_shadowRenderQueue, renderQueueElementsLod,

+ 3 - 3
AnKi/Renderer/TileAllocator.cpp

@@ -264,7 +264,7 @@ TileAllocatorResult TileAllocator::allocate(Timestamp crntTimestamp, Timestamp l
 
 				updateTileHierarchy(tile);
 
-				return (needsReRendering) ? TileAllocatorResult::ALLOCATION_SUCCEEDED : TileAllocatorResult::CACHED;
+				return (needsReRendering) ? TileAllocatorResult::kAllocationSucceded : TileAllocatorResult::kCached;
 			}
 		}
 	}
@@ -318,7 +318,7 @@ TileAllocatorResult TileAllocator::allocate(Timestamp crntTimestamp, Timestamp l
 	else
 	{
 		// Out of tiles
-		return TileAllocatorResult::ALLOCATION_FAILED;
+		return TileAllocatorResult::kAllocationFailed;
 	}
 
 	// Allocation succedded, need to do some bookkeeping
@@ -344,7 +344,7 @@ TileAllocatorResult TileAllocator::allocate(Timestamp crntTimestamp, Timestamp l
 	tileViewport = {allocatedTile.m_viewport[0], allocatedTile.m_viewport[1], allocatedTile.m_viewport[2],
 					allocatedTile.m_viewport[3]};
 
-	return TileAllocatorResult::ALLOCATION_SUCCEEDED;
+	return TileAllocatorResult::kAllocationSucceded;
 }
 
 void TileAllocator::invalidateCache(U64 lightUuid, U32 lightFace)

+ 3 - 3
AnKi/Renderer/TileAllocator.h

@@ -15,9 +15,9 @@ namespace anki {
 /// The result of a tile allocation.
 enum class TileAllocatorResult : U32
 {
-	CACHED, ///< The tile is cached. No need to re-render it.
-	ALLOCATION_FAILED, ///< No more available tiles.
-	ALLOCATION_SUCCEEDED ///< Allocation succeded but the tile needs update.
+	kCached, ///< The tile is cached. No need to re-render it.
+	kAllocationFailed, ///< No more available tiles.
+	kAllocationSucceded ///< Allocation succeded but the tile needs update.
 };
 
 /// Allocates tiles out of a tilemap suitable for shadow mapping.

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

@@ -90,7 +90,7 @@ void DecalComponent::draw(RenderQueueDrawContext& ctx) const
 
 	const Mat4 mvp = ctx.m_viewProjectionMatrix * Mat4(tsl, rot * nonUniScale, 1.0f);
 
-	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 	if(enableDepthTest)
 	{
 		ctx.m_commandBuffer->setDepthCompareOperation(CompareOperation::kLess);
@@ -102,13 +102,13 @@ void DecalComponent::draw(RenderQueueDrawContext& ctx) const
 
 	m_node->getSceneGraph().getDebugDrawer().drawCubes(
 		ConstWeakArray<Mat4>(&mvp, 1), Vec4(0.0f, 1.0f, 0.0f, 1.0f), 1.0f,
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f, *ctx.m_stagingGpuAllocator,
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
 		ctx.m_commandBuffer);
 
 	const Vec3 pos = m_obb.getCenter().xyz();
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&pos, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

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

@@ -41,7 +41,7 @@ void GlobalIlluminationProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	const Mat4 mvp = ctx.m_viewProjectionMatrix * Mat4(tsl.xyz1(), rot, 1.0f);
 
-	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 	if(enableDepthTest)
 	{
 		ctx.m_commandBuffer->setDepthCompareOperation(CompareOperation::kLess);
@@ -53,12 +53,12 @@ void GlobalIlluminationProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	m_node->getSceneGraph().getDebugDrawer().drawCubes(
 		ConstWeakArray<Mat4>(&mvp, 1), Vec4(0.729f, 0.635f, 0.196f, 1.0f), 1.0f,
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f, *ctx.m_stagingGpuAllocator,
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
 		ctx.m_commandBuffer);
 
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPosition, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

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

@@ -233,7 +233,7 @@ void GpuParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 
 		const Mat4 mvp = ctx.m_viewProjectionMatrix * Mat4(tsl.xyz1(), Mat3::getIdentity() * nonUniScale, 1.0f);
 
-		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 		if(enableDepthTest)
 		{
 			cmdb->setDepthCompareOperation(CompareOperation::kLess);
@@ -245,12 +245,12 @@ void GpuParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 
 		m_node->getSceneGraph().getDebugDrawer().drawCubes(
 			ConstWeakArray<Mat4>(&mvp, 1), Vec4(1.0f, 0.0f, 1.0f, 1.0f), 2.0f,
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f,
-			*ctx.m_stagingGpuAllocator, cmdb);
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
+			cmdb);
 
 		m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 			ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPosition, 1), Vec4(1.0f),
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgImage->getTextureView(),
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), m_dbgImage->getTextureView(),
 			ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 		// Restore state

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

@@ -224,7 +224,7 @@ void LightComponent::setupDirectionalLightQueueElement(const FrustumComponent& f
 
 void LightComponent::draw(RenderQueueDrawContext& ctx) const
 {
-	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 	if(enableDepthTest)
 	{
 		ctx.m_commandBuffer->setDepthCompareOperation(CompareOperation::kLess);
@@ -240,7 +240,7 @@ void LightComponent::draw(RenderQueueDrawContext& ctx) const
 	ImageResourcePtr imageResource = (m_type == LightComponentType::POINT) ? m_pointDebugImage : m_spotDebugImage;
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTexture(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, m_worldtransform.getOrigin().xyz(), color.xyz1(),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), imageResource->getTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), imageResource->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 6 - 6
AnKi/Scene/Components/ParticleEmitterComponent.cpp

@@ -135,8 +135,8 @@ public:
 		m_body = node->getSceneGraph().getPhysicsWorld().newInstance<PhysicsBody>(init);
 		m_body->setUserData(component);
 		m_body->activate(false);
-		m_body->setMaterialGroup(PhysicsMaterialBit::PARTICLE);
-		m_body->setMaterialMask(PhysicsMaterialBit::STATIC_GEOMETRY);
+		m_body->setMaterialGroup(PhysicsMaterialBit::kParticle);
+		m_body->setMaterialMask(PhysicsMaterialBit::kStaticGeometry);
 		m_body->setAngularFactor(Vec3(0.0f));
 	}
 
@@ -430,7 +430,7 @@ void ParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 
 		const Mat4 mvp = ctx.m_viewProjectionMatrix * Mat4(tsl.xyz1(), Mat3::getIdentity() * nonUniScale, 1.0f);
 
-		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 		if(enableDepthTest)
 		{
 			cmdb->setDepthCompareOperation(CompareOperation::kLess);
@@ -442,13 +442,13 @@ void ParticleEmitterComponent::draw(RenderQueueDrawContext& ctx) const
 
 		m_node->getSceneGraph().getDebugDrawer().drawCubes(
 			ConstWeakArray<Mat4>(&mvp, 1), Vec4(1.0f, 0.0f, 1.0f, 1.0f), 2.0f,
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f,
-			*ctx.m_stagingGpuAllocator, cmdb);
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
+			cmdb);
 
 		const Vec3 pos = m_transform.getOrigin().xyz();
 		m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 			ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&pos, 1), Vec4(1.0f),
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_dbgImage->getTextureView(),
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), m_dbgImage->getTextureView(),
 			ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 		// Restore state

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

@@ -43,7 +43,7 @@ void ReflectionProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	const Mat4 mvp = ctx.m_viewProjectionMatrix * Mat4(tsl.xyz1(), rot, 1.0f);
 
-	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+	const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 	if(enableDepthTest)
 	{
 		ctx.m_commandBuffer->setDepthCompareOperation(CompareOperation::kLess);
@@ -55,12 +55,12 @@ void ReflectionProbeComponent::draw(RenderQueueDrawContext& ctx) const
 
 	m_node->getSceneGraph().getDebugDrawer().drawCubes(
 		ConstWeakArray<Mat4>(&mvp, 1), Vec4(0.0f, 0.0f, 1.0f, 1.0f), 1.0f,
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f, *ctx.m_stagingGpuAllocator,
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
 		ctx.m_commandBuffer);
 
 	m_node->getSceneGraph().getDebugDrawer().drawBillboardTextures(
 		ctx.m_projectionMatrix, ctx.m_viewMatrix, ConstWeakArray<Vec3>(&m_worldPos, 1), Vec4(1.0f),
-		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), m_debugImage->getTextureView(),
+		ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), m_debugImage->getTextureView(),
 		ctx.m_sampler, Vec2(0.75f), *ctx.m_stagingGpuAllocator, ctx.m_commandBuffer);
 
 	// Restore state

+ 5 - 5
AnKi/Scene/ModelNode.cpp

@@ -307,7 +307,7 @@ void ModelNode::draw(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData
 			mvps[i] = ctx.m_viewProjectionMatrix * Mat4(tsl.xyz1(), Mat3::getIdentity() * nonUniScale, 1.0f);
 		}
 
-		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DEPTH_TEST_ON);
+		const Bool enableDepthTest = ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDepthTestOn);
 		if(enableDepthTest)
 		{
 			cmdb->setDepthCompareOperation(CompareOperation::kLess);
@@ -319,8 +319,8 @@ void ModelNode::draw(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData
 
 		getSceneGraph().getDebugDrawer().drawCubes(
 			ConstWeakArray<Mat4>(mvps, instanceCount), Vec4(1.0f, 0.0f, 1.0f, 1.0f), 2.0f,
-			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), 2.0f,
-			*ctx.m_stagingGpuAllocator, cmdb);
+			ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), 2.0f, *ctx.m_stagingGpuAllocator,
+			cmdb);
 
 		ctx.m_frameAllocator.deleteArray(mvps, instanceCount);
 
@@ -366,12 +366,12 @@ void ModelNode::draw(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData
 				ctx.m_viewProjectionMatrix * Mat4(getFirstComponentOfType<MoveComponent>().getWorldTransform());
 			getSceneGraph().getDebugDrawer().drawLines(
 				ConstWeakArray<Mat4>(&mvp, 1), Vec4(1.0f), 20.0f,
-				ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), lines,
+				ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), lines,
 				*ctx.m_stagingGpuAllocator, cmdb);
 
 			getSceneGraph().getDebugDrawer().drawLines(
 				ConstWeakArray<Mat4>(&mvp, 1), Vec4(0.7f, 0.7f, 0.7f, 1.0f), 5.0f,
-				ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::DITHERED_DEPTH_TEST_ON), chidlessLines,
+				ctx.m_debugDrawFlags.get(RenderQueueDebugDrawFlag::kDitheredDepthTestOn), chidlessLines,
 				*ctx.m_stagingGpuAllocator, cmdb);
 		}
 

+ 2 - 2
Samples/PhysicsPlayground/Main.cpp

@@ -123,7 +123,7 @@ Error MyApp::sampleExtraInit()
 		ANKI_CHECK(getSceneGraph().newSceneNode("player", player));
 		PlayerControllerComponent& pcomp = player->getFirstComponentOfType<PlayerControllerComponent>();
 		pcomp.moveToPosition(Vec3(0.0f, 2.5f, 0.0f));
-		pcomp.getPhysicsPlayerController()->setMaterialMask(PhysicsMaterialBit::STATIC_GEOMETRY);
+		pcomp.getPhysicsPlayerController()->setMaterialMask(PhysicsMaterialBit::kStaticGeometry);
 
 		player->addChild(&cam);
 	}
@@ -325,7 +325,7 @@ Error MyApp::userMainLoop(Bool& quit, [[maybe_unused]] Second elapsedTime)
 		Vec3 from = camTrf.getOrigin().xyz();
 		Vec3 to = from + -camTrf.getRotation().getZAxis() * 100.0f;
 
-		RayCast ray(from, to, PhysicsMaterialBit::ALL & (~PhysicsMaterialBit::PARTICLE));
+		RayCast ray(from, to, PhysicsMaterialBit::kAll & (~PhysicsMaterialBit::kParticle));
 		ray.m_firstHit = true;
 
 		getPhysicsWorld().rayCast(ray);

+ 13 - 13
Tests/Renderer/TileAllocator.cpp

@@ -23,47 +23,47 @@ ANKI_TEST(Renderer, TileAllocator)
 
 	// Allocate 1 med
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 1, 0, dcCount, 1, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 
 	// Allocate 3 big
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 2, 0, dcCount, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 3, 0, dcCount, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 4, 0, dcCount, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 
 	// Fail to allocate 1 big
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 5, 0, dcCount, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_FAILED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationFailed);
 
 	// Allocate 3 med
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 1, 1, dcCount, 1, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 1, 2, dcCount, 1, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 1, 3, dcCount, 1, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 
 	// Fail to allocate a small
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 6, 0, dcCount, 0, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_FAILED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationFailed);
 
 	// New frame
 	++crntTimestamp;
 
 	// Allocate 3 big again
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 2, 0, dcCount + 1, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 3, 0, dcCount, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::CACHED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kCached);
 	res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 4, 0, dcCount + 1, 2, viewport);
-	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+	ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 
 	// Allocate 16 small
 	for(U i = 0; i < 16; ++i)
 	{
 		res = talloc.allocate(crntTimestamp, lightTimestamp, lightUuid + 6 + i, 0, dcCount, 0, viewport);
-		ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
+		ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::kAllocationSucceded);
 	}
 }