Browse Source

Some code style refactoring #13

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
0c625413c6

+ 3 - 12
AnKi/Scene/CameraNode.cpp

@@ -60,17 +60,8 @@ void CameraNode::initCommon(FrustumType frustumType)
 	// Frustum component
 	FrustumComponent* frc = newComponent<FrustumComponent>();
 	frc->setFrustumType(frustumType);
-	const FrustumComponentVisibilityTestFlag visibilityFlags =
-		FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS | FrustumComponentVisibilityTestFlag::LIGHT_COMPONENTS
-		| FrustumComponentVisibilityTestFlag::LENS_FLARE_COMPONENTS
-		| FrustumComponentVisibilityTestFlag::REFLECTION_PROBES | FrustumComponentVisibilityTestFlag::REFLECTION_PROXIES
-		| FrustumComponentVisibilityTestFlag::OCCLUDERS | FrustumComponentVisibilityTestFlag::DECALS
-		| FrustumComponentVisibilityTestFlag::FOG_DENSITY_COMPONENTS
-		| FrustumComponentVisibilityTestFlag::GLOBAL_ILLUMINATION_PROBES | FrustumComponentVisibilityTestFlag::EARLY_Z
-		| FrustumComponentVisibilityTestFlag::ALL_SHADOWS_ENABLED
-		| FrustumComponentVisibilityTestFlag::GENERIC_COMPUTE_JOB_COMPONENTS
-		| FrustumComponentVisibilityTestFlag::UI_COMPONENTS | FrustumComponentVisibilityTestFlag::SKYBOX;
-	frc->setEnabledVisibilityTests(visibilityFlags);
+	frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kAll
+								   ^ FrustumComponentVisibilityTestFlag::kAllRayTracing);
 	frc->setLodDistance(0, getConfig().getLod0MaxDistance());
 	frc->setLodDistance(1, getConfig().getLod1MaxDistance());
 	frc->setShadowCascadeCount(getConfig().getSceneShadowCascadeCount());
@@ -81,7 +72,7 @@ void CameraNode::initCommon(FrustumType frustumType)
 	{
 		FrustumComponent* rtFrustumComponent = newComponent<FrustumComponent>();
 		rtFrustumComponent->setFrustumType(FrustumType::kOrthographic);
-		rtFrustumComponent->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::RAY_TRACING_SHADOWS);
+		rtFrustumComponent->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kRayTracingShadows);
 
 		const F32 dist = getConfig().getSceneRayTracingExtendedFrustumDistance();
 

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

@@ -36,14 +36,13 @@ Error DecalComponent::setLayer(CString texAtlasFname, CString texAtlasSubtexName
 	ANKI_CHECK(l.m_atlas->getSubImageInfo(texAtlasSubtexName, &l.m_uv[0]));
 
 	// Add a border to the UVs to avoid complex shader logic
-	if(l.m_atlas->getSubImageMargin() < ATLAS_SUB_IMAGE_MARGIN)
+	if(l.m_atlas->getSubImageMargin() < kAtlasSubImageMargin)
 	{
-		ANKI_SCENE_LOGE("Need image atlas with margin at least %u", ATLAS_SUB_IMAGE_MARGIN);
+		ANKI_SCENE_LOGE("Need image atlas with margin at least %u", kAtlasSubImageMargin);
 		return Error::kUserData;
 	}
 
-	const Vec2 marginf =
-		F32(ATLAS_SUB_IMAGE_MARGIN / 2) / Vec2(F32(l.m_atlas->getWidth()), F32(l.m_atlas->getHeight()));
+	const Vec2 marginf = F32(kAtlasSubImageMargin / 2) / Vec2(F32(l.m_atlas->getWidth()), F32(l.m_atlas->getHeight()));
 	const Vec2 minUv = l.m_uv.xy() - marginf;
 	const Vec2 sizeUv = (l.m_uv.zw() - l.m_uv.xy()) + 2.0f * marginf;
 	l.m_uv = Vec4(minUv.x(), minUv.y(), minUv.x() + sizeUv.x(), minUv.y() + sizeUv.y());

+ 22 - 22
AnKi/Scene/Components/DecalComponent.h

@@ -21,7 +21,7 @@ class DecalComponent : public SceneComponent
 	ANKI_SCENE_COMPONENT(DecalComponent)
 
 public:
-	static constexpr U32 ATLAS_SUB_IMAGE_MARGIN = 16;
+	static constexpr U32 kAtlasSubImageMargin = 16;
 
 	DecalComponent(SceneNode* node);
 
@@ -29,12 +29,12 @@ public:
 
 	Error setDiffuseDecal(CString texAtlasFname, CString texAtlasSubtexName, F32 blendFactor)
 	{
-		return setLayer(texAtlasFname, texAtlasSubtexName, blendFactor, LayerType::DIFFUSE);
+		return setLayer(texAtlasFname, texAtlasSubtexName, blendFactor, LayerType::kDiffuse);
 	}
 
 	Error setSpecularRoughnessDecal(CString texAtlasFname, CString texAtlasSubtexName, F32 blendFactor)
 	{
-		return setLayer(texAtlasFname, texAtlasSubtexName, blendFactor, LayerType::SPECULAR_ROUGHNESS);
+		return setLayer(texAtlasFname, texAtlasSubtexName, blendFactor, LayerType::kSpecularRoughness);
 	}
 
 	/// Update the internal structures.
@@ -81,37 +81,37 @@ public:
 
 	void getDiffuseAtlasInfo(Vec4& uv, TexturePtr& tex, F32& blendFactor) const
 	{
-		uv = m_layers[LayerType::DIFFUSE].m_uv;
-		tex = m_layers[LayerType::DIFFUSE].m_atlas->getTexture();
-		blendFactor = m_layers[LayerType::DIFFUSE].m_blendFactor;
+		uv = m_layers[LayerType::kDiffuse].m_uv;
+		tex = m_layers[LayerType::kDiffuse].m_atlas->getTexture();
+		blendFactor = m_layers[LayerType::kDiffuse].m_blendFactor;
 	}
 
 	void getSpecularRoughnessAtlasInfo(Vec4& uv, TexturePtr& tex, F32& blendFactor) const
 	{
-		uv = m_layers[LayerType::SPECULAR_ROUGHNESS].m_uv;
-		if(m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas)
+		uv = m_layers[LayerType::kSpecularRoughness].m_uv;
+		if(m_layers[LayerType::kSpecularRoughness].m_atlas)
 		{
-			tex = m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getTexture();
+			tex = m_layers[LayerType::kSpecularRoughness].m_atlas->getTexture();
 		}
 		else
 		{
 			tex.reset(nullptr);
 		}
-		blendFactor = m_layers[LayerType::SPECULAR_ROUGHNESS].m_blendFactor;
+		blendFactor = m_layers[LayerType::kSpecularRoughness].m_blendFactor;
 	}
 
 	void setupDecalQueueElement(DecalQueueElement& el)
 	{
-		el.m_diffuseAtlas = (m_layers[LayerType::DIFFUSE].m_atlas)
-								? m_layers[LayerType::DIFFUSE].m_atlas->getTextureView().get()
+		el.m_diffuseAtlas = (m_layers[LayerType::kDiffuse].m_atlas)
+								? m_layers[LayerType::kDiffuse].m_atlas->getTextureView().get()
 								: nullptr;
-		el.m_specularRoughnessAtlas = (m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas)
-										  ? m_layers[LayerType::SPECULAR_ROUGHNESS].m_atlas->getTextureView().get()
+		el.m_specularRoughnessAtlas = (m_layers[LayerType::kSpecularRoughness].m_atlas)
+										  ? m_layers[LayerType::kSpecularRoughness].m_atlas->getTextureView().get()
 										  : nullptr;
-		el.m_diffuseAtlasUv = m_layers[LayerType::DIFFUSE].m_uv;
-		el.m_specularRoughnessAtlasUv = m_layers[LayerType::SPECULAR_ROUGHNESS].m_uv;
-		el.m_diffuseAtlasBlendFactor = m_layers[LayerType::DIFFUSE].m_blendFactor;
-		el.m_specularRoughnessAtlasBlendFactor = m_layers[LayerType::SPECULAR_ROUGHNESS].m_blendFactor;
+		el.m_diffuseAtlasUv = m_layers[LayerType::kDiffuse].m_uv;
+		el.m_specularRoughnessAtlasUv = m_layers[LayerType::kSpecularRoughness].m_uv;
+		el.m_diffuseAtlasBlendFactor = m_layers[LayerType::kDiffuse].m_blendFactor;
+		el.m_specularRoughnessAtlasBlendFactor = m_layers[LayerType::kSpecularRoughness].m_blendFactor;
 		el.m_textureMatrix = m_biasProjViewMat;
 		el.m_obbCenter = m_obb.getCenter().xyz();
 		el.m_obbExtend = m_obb.getExtend().xyz();
@@ -126,9 +126,9 @@ public:
 private:
 	enum class LayerType : U8
 	{
-		DIFFUSE,
-		SPECULAR_ROUGHNESS,
-		COUNT
+		kDiffuse,
+		kSpecularRoughness,
+		kCount
 	};
 
 	class Layer
@@ -140,7 +140,7 @@ private:
 	};
 
 	SceneNode* m_node = nullptr;
-	Array<Layer, U(LayerType::COUNT)> m_layers;
+	Array<Layer, U(LayerType::kCount)> m_layers;
 	Mat4 m_biasProjViewMat = Mat4::getIdentity();
 	Vec3 m_boxSize = Vec3(1.0f);
 	Transform m_trf = Transform::getIdentity();

+ 5 - 5
AnKi/Scene/Components/FrustumComponent.cpp

@@ -155,15 +155,15 @@ void FrustumComponent::fillCoverageBufferCallback(void* userData, F32* depthValu
 
 void FrustumComponent::setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag bits)
 {
-	m_flags = FrustumComponentVisibilityTestFlag::NONE;
+	m_flags = FrustumComponentVisibilityTestFlag::kNone;
 	m_flags |= bits;
 
 #if ANKI_ENABLE_ASSERTIONS
-	if(!!(m_flags & FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS)
-	   || !!(m_flags & FrustumComponentVisibilityTestFlag::SHADOW_CASTERS))
+	if(!!(m_flags & FrustumComponentVisibilityTestFlag::kRenderComponents)
+	   || !!(m_flags & FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents))
 	{
-		if((m_flags & FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS)
-		   == (m_flags & FrustumComponentVisibilityTestFlag::SHADOW_CASTERS))
+		if((m_flags & FrustumComponentVisibilityTestFlag::kRenderComponents)
+		   == (m_flags & FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents))
 		{
 			ANKI_ASSERT(0 && "Cannot have them both");
 		}

+ 28 - 32
AnKi/Scene/Components/FrustumComponent.h

@@ -22,37 +22,33 @@ namespace anki {
 /// Flags that affect visibility tests.
 enum class FrustumComponentVisibilityTestFlag : U32
 {
-	NONE = 0,
-	RENDER_COMPONENTS = 1 << 0,
-	LIGHT_COMPONENTS = 1 << 1,
-	LENS_FLARE_COMPONENTS = 1 << 2,
-	SHADOW_CASTERS = 1 << 3, ///< Render components that cast shadow
-	POINT_LIGHT_SHADOWS_ENABLED = 1 << 4,
-	SPOT_LIGHT_SHADOWS_ENABLED = 1 << 5,
-	REFLECTION_PROBES = 1 << 8,
-	REFLECTION_PROXIES = 1 << 9,
-	OCCLUDERS = 1 << 10,
-	DECALS = 1 << 11,
-	FOG_DENSITY_COMPONENTS = 1 << 12,
-	GLOBAL_ILLUMINATION_PROBES = 1 << 13,
-	EARLY_Z = 1 << 14,
-	GENERIC_COMPUTE_JOB_COMPONENTS = 1 << 15,
-	RAY_TRACING_SHADOWS = 1 << 16,
-	RAY_TRACING_GI = 1 << 17,
-	RAY_TRACING_REFLECTIONS = 1 << 18,
-	RAY_TRACING_PATH_TRACING = 1 << 19,
-	UI_COMPONENTS = 1 << 20,
-	SKYBOX = 1 << 21,
-
-	ALL = RENDER_COMPONENTS | LIGHT_COMPONENTS | LENS_FLARE_COMPONENTS | SHADOW_CASTERS | POINT_LIGHT_SHADOWS_ENABLED
-		  | SPOT_LIGHT_SHADOWS_ENABLED | REFLECTION_PROBES | REFLECTION_PROXIES | OCCLUDERS | DECALS
-		  | FOG_DENSITY_COMPONENTS | GLOBAL_ILLUMINATION_PROBES | EARLY_Z | GENERIC_COMPUTE_JOB_COMPONENTS
-		  | RAY_TRACING_SHADOWS | RAY_TRACING_GI | RAY_TRACING_REFLECTIONS | RAY_TRACING_PATH_TRACING | UI_COMPONENTS
-		  | SKYBOX,
-
-	ALL_SHADOWS_ENABLED = POINT_LIGHT_SHADOWS_ENABLED | SPOT_LIGHT_SHADOWS_ENABLED,
-
-	ALL_RAY_TRACING = RAY_TRACING_SHADOWS | RAY_TRACING_GI | RAY_TRACING_REFLECTIONS | RAY_TRACING_PATH_TRACING
+	kNone = 0,
+	kRenderComponents = 1 << 0,
+	kShadowCasterRenderComponents = 1 << 1, ///< Render components that cast shadow
+	kLights = 1 << 2,
+	kLensFlares = 1 << 3,
+	kReflectionProbes = 1 << 4,
+	kOccluders = 1 << 5,
+	kDecals = 1 << 6,
+	kFogDensityVolumes = 1 << 7,
+	kGlobalIlluminationProbes = 1 << 8,
+	kGenericComputeJobs = 1 << 9,
+	kRayTracingShadows = 1 << 10,
+	kRayTracingGi = 1 << 11,
+	kRayTracingReflections = 1 << 12,
+	kRayTracingPathTracing = 1 << 13,
+	kUi = 1 << 14,
+	kSkybox = 1 << 15,
+	kEarlyZ = 1 << 16,
+	kPointLightShadowsEnabled = 1 << 17,
+	kSpotLightShadowsEnabled = 1 << 18,
+
+	kAll = kRenderComponents | kShadowCasterRenderComponents | kLights | kLensFlares | kReflectionProbes | kOccluders
+		   | kDecals | kFogDensityVolumes | kGlobalIlluminationProbes | kGenericComputeJobs | kRayTracingShadows
+		   | kRayTracingGi | kRayTracingReflections | kRayTracingPathTracing | kUi | kSkybox | kEarlyZ
+		   | kPointLightShadowsEnabled | kSpotLightShadowsEnabled,
+
+	kAllRayTracing = kRayTracingShadows | kRayTracingGi | kRayTracingReflections | kRayTracingPathTracing,
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(FrustumComponentVisibilityTestFlag)
 
@@ -461,7 +457,7 @@ private:
 		U32 m_depthMapHeight = 0;
 	} m_coverageBuff; ///< Coverage buffer for extra visibility tests.
 
-	FrustumComponentVisibilityTestFlag m_flags = FrustumComponentVisibilityTestFlag::NONE;
+	FrustumComponentVisibilityTestFlag m_flags = FrustumComponentVisibilityTestFlag::kNone;
 	Bool m_shapeMarkedForUpdate : 1;
 	Bool m_trfMarkedForUpdate : 1;
 

+ 4 - 4
AnKi/Scene/GlobalIlluminationProbeNode.cpp

@@ -116,7 +116,7 @@ GlobalIlluminationProbeNode::GlobalIlluminationProbeNode(SceneGraph* scene, CStr
 		const F32 tempEffectiveDistance = 1.0f;
 		frc->setPerspective(zNear, tempEffectiveDistance, ang, ang);
 		frc->setWorldTransform(m_cubeFaceTransforms[i]);
-		frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
+		frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kNone);
 		frc->setEffectiveShadowDistance(getConfig().getSceneReflectionProbeShadowEffectiveDistance());
 		frc->setShadowCascadeCount(1);
 	}
@@ -181,11 +181,11 @@ Error GlobalIlluminationProbeNode::frameUpdate([[maybe_unused]] Second prevUpdat
 	// Check the reflection probe component and if it's marked for rendering enable the frustum components
 	const GlobalIlluminationProbeComponent& gic = getFirstComponentOfType<GlobalIlluminationProbeComponent>();
 
-	constexpr FrustumComponentVisibilityTestFlag frustumTestFlags =
-		FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS | FrustumComponentVisibilityTestFlag::LIGHT_COMPONENTS;
+	constexpr FrustumComponentVisibilityTestFlag kFrustumFlags =
+		FrustumComponentVisibilityTestFlag::kRenderComponents | FrustumComponentVisibilityTestFlag::kLights;
 
 	const FrustumComponentVisibilityTestFlag testFlags =
-		(gic.getMarkedForRendering()) ? frustumTestFlags : FrustumComponentVisibilityTestFlag::NONE;
+		(gic.getMarkedForRendering()) ? kFrustumFlags : FrustumComponentVisibilityTestFlag::kNone;
 
 	iterateComponentsOfType<FrustumComponent>([testFlags](FrustumComponent& frc) {
 		frc.setEnabledVisibilityTests(testFlags);

+ 3 - 3
AnKi/Scene/LightNode.cpp

@@ -87,11 +87,11 @@ void LightNode::frameUpdateCommon()
 	iterateComponentsOfType<FrustumComponent>([&](FrustumComponent& frc) {
 		if(castsShadow)
 		{
-			frc.setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::SHADOW_CASTERS);
+			frc.setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents);
 		}
 		else
 		{
-			frc.setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
+			frc.setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kNone);
 		}
 	});
 }
@@ -241,7 +241,7 @@ SpotLightNode::SpotLightNode(SceneGraph* scene, CString name)
 
 	FrustumComponent* fr = newComponent<FrustumComponent>();
 	fr->setFrustumType(FrustumType::kPerspective);
-	fr->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
+	fr->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kNone);
 
 	newComponent<OnFrustumUpdatedFeedbackComponent>();
 

+ 3 - 3
AnKi/Scene/ReflectionProbeNode.cpp

@@ -106,7 +106,7 @@ ReflectionProbeNode::ReflectionProbeNode(SceneGraph* scene, CString name)
 		frc->setFrustumType(FrustumType::kPerspective);
 		frc->setPerspective(CLUSTER_OBJECT_FRUSTUM_NEAR_PLANE, 10.0f, ang, ang);
 		frc->setWorldTransform(m_frustumTransforms[i]);
-		frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
+		frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::kNone);
 		frc->setEffectiveShadowDistance(getConfig().getSceneReflectionProbeShadowEffectiveDistance());
 		frc->setShadowCascadeCount(1);
 	}
@@ -172,10 +172,10 @@ Error ReflectionProbeNode::frameUpdate([[maybe_unused]] Second prevUpdateTime, [
 	const ReflectionProbeComponent& reflc = getFirstComponentOfType<ReflectionProbeComponent>();
 
 	constexpr FrustumComponentVisibilityTestFlag frustumTestFlags =
-		FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS | FrustumComponentVisibilityTestFlag::LIGHT_COMPONENTS;
+		FrustumComponentVisibilityTestFlag::kRenderComponents | FrustumComponentVisibilityTestFlag::kLights;
 
 	const FrustumComponentVisibilityTestFlag testFlags =
-		reflc.getMarkedForRendering() ? frustumTestFlags : FrustumComponentVisibilityTestFlag::NONE;
+		reflc.getMarkedForRendering() ? frustumTestFlags : FrustumComponentVisibilityTestFlag::kNone;
 
 	iterateComponentsOfType<FrustumComponent>([testFlags](FrustumComponent& frc) {
 		frc.setEnabledVisibilityTests(testFlags);

+ 29 - 37
AnKi/Scene/Visibility.cpp

@@ -86,7 +86,7 @@ void VisibilityContext::submitNewWork(const FrustumComponent& frc, const Frustum
 	ANKI_TRACE_SCOPED_EVENT(SCENE_VIS_SUBMIT_WORK);
 
 	// Check enabled and make sure that the results are null (this can happen on multiple on circular viewing)
-	if(ANKI_UNLIKELY(frc.getEnabledVisibilityTests() == FrustumComponentVisibilityTestFlag::NONE))
+	if(ANKI_UNLIKELY(frc.getEnabledVisibilityTests() == FrustumComponentVisibilityTestFlag::kNone))
 	{
 		return;
 	}
@@ -142,7 +142,7 @@ void VisibilityContext::submitNewWork(const FrustumComponent& frc, const Frustum
 
 	// Software rasterizer task
 	ThreadHiveSemaphore* prepareRasterizerSem = nullptr;
-	if(!!(frc.getEnabledVisibilityTests() & FrustumComponentVisibilityTestFlag::OCCLUDERS) && frc.hasCoverageBuffer())
+	if(!!(frc.getEnabledVisibilityTests() & FrustumComponentVisibilityTestFlag::kOccluders) && frc.hasCoverageBuffer())
 	{
 		// Gather triangles task
 		ThreadHiveTask fillDepthTask =
@@ -154,7 +154,7 @@ void VisibilityContext::submitNewWork(const FrustumComponent& frc, const Frustum
 		prepareRasterizerSem = fillDepthTask.m_signalSemaphore;
 	}
 
-	if(!!(frc.getEnabledVisibilityTests() & FrustumComponentVisibilityTestFlag::OCCLUDERS))
+	if(!!(frc.getEnabledVisibilityTests() & FrustumComponentVisibilityTestFlag::kOccluders))
 	{
 		rqueue.m_fillCoverageBufferCallback = FrustumComponent::fillCoverageBufferCallback;
 		rqueue.m_fillCoverageBufferCallbackUserData = static_cast<void*>(const_cast<FrustumComponent*>(&frc));
@@ -268,8 +268,8 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 	ANKI_TRACE_SCOPED_EVENT(SCENE_VIS_TEST);
 
 	const FrustumComponent& testedFrc = *m_frcCtx->m_frc;
-	const FrustumComponentVisibilityTestFlag enabledVisibilityTests = testedFrc.getEnabledVisibilityTests();
-	ANKI_ASSERT(enabledVisibilityTests != FrustumComponentVisibilityTestFlag::NONE);
+	const FrustumComponentVisibilityTestFlag frustumFlags = testedFrc.getEnabledVisibilityTests();
+	ANKI_ASSERT(frustumFlags != FrustumComponentVisibilityTestFlag::kNone);
 	ANKI_ASSERT(m_frcCtx->m_primaryFrustum);
 	const FrustumComponent& primaryFrc = *m_frcCtx->m_primaryFrustum;
 
@@ -279,8 +279,8 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 	Timestamp& timestamp = m_frcCtx->m_queueViews[taskId].m_timestamp;
 	timestamp = testedNode.getComponentMaxTimestamp();
 
-	const Bool wantsEarlyZ = !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::EARLY_Z)
-							 && m_frcCtx->m_visCtx->m_earlyZDist > 0.0f;
+	const Bool wantsEarlyZ =
+		!!(frustumFlags & FrustumComponentVisibilityTestFlag::kEarlyZ) && m_frcCtx->m_visCtx->m_earlyZDist > 0.0f;
 
 	// Iterate
 	RenderQueueView& result = m_frcCtx->m_queueViews[taskId];
@@ -300,51 +300,45 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 		Bool wantNode = false;
 
 		const RenderComponent* rc = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::RENDER_COMPONENTS)
-					&& getComponent(node, rc);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kRenderComponents) && getComponent(node, rc);
 
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::SHADOW_CASTERS)
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents)
 					&& getComponent(node, rc) && !!(rc->getFlags() & RenderComponentFlag::CASTS_SHADOW);
 
 		const RenderComponent* rtRc = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::ALL_RAY_TRACING)
-					&& getComponent(node, rtRc) && rtRc->getSupportsRayTracing();
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kAllRayTracing) && getComponent(node, rtRc)
+					&& rtRc->getSupportsRayTracing();
 
 		const LightComponent* lc = nullptr;
-		wantNode |=
-			!!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::LIGHT_COMPONENTS) && getComponent(node, lc);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kLights) && getComponent(node, lc);
 
 		const LensFlareComponent* lfc = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::LENS_FLARE_COMPONENTS)
-					&& getComponent(node, lfc);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kLensFlares) && getComponent(node, lfc);
 
 		const ReflectionProbeComponent* reflc = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::REFLECTION_PROBES)
-					&& getComponent(node, reflc);
+		wantNode |=
+			!!(frustumFlags & FrustumComponentVisibilityTestFlag::kReflectionProbes) && getComponent(node, reflc);
 
 		DecalComponent* decalc = nullptr;
-		wantNode |=
-			!!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::DECALS) && getComponent(node, decalc);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kDecals) && getComponent(node, decalc);
 
 		const FogDensityComponent* fogc = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::FOG_DENSITY_COMPONENTS)
-					&& getComponent(node, fogc);
+		wantNode |=
+			!!(frustumFlags & FrustumComponentVisibilityTestFlag::kFogDensityVolumes) && getComponent(node, fogc);
 
 		GlobalIlluminationProbeComponent* giprobec = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::GLOBAL_ILLUMINATION_PROBES)
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kGlobalIlluminationProbes)
 					&& getComponent(node, giprobec);
 
 		GenericGpuComputeJobComponent* computec = nullptr;
-		wantNode |= !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::GENERIC_COMPUTE_JOB_COMPONENTS)
-					&& getComponent(node, computec);
+		wantNode |=
+			!!(frustumFlags & FrustumComponentVisibilityTestFlag::kGenericComputeJobs) && getComponent(node, computec);
 
 		UiComponent* uic = nullptr;
-		wantNode |=
-			!!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::UI_COMPONENTS) && getComponent(node, uic);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kUi) && getComponent(node, uic);
 
 		SkyboxComponent* skyboxc = nullptr;
-		wantNode |=
-			!!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::SKYBOX) && getComponent(node, skyboxc);
+		wantNode |= !!(frustumFlags & FrustumComponentVisibilityTestFlag::kSkybox) && getComponent(node, skyboxc);
 
 		if(ANKI_UNLIKELY(!wantNode))
 		{
@@ -430,8 +424,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				PointLightQueueElement* el = result.m_pointLights.newElement(alloc);
 				lc->setupPointLightQueueElement(*el);
 
-				if(castsShadow
-				   && !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::POINT_LIGHT_SHADOWS_ENABLED))
+				if(castsShadow && !!(frustumFlags & FrustumComponentVisibilityTestFlag::kPointLightShadowsEnabled))
 				{
 					RenderQueue* a = alloc.newArray<RenderQueue>(6);
 					nextQueues = WeakArray<RenderQueue>(a, 6);
@@ -455,8 +448,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				SpotLightQueueElement* el = result.m_spotLights.newElement(alloc);
 				lc->setupSpotLightQueueElement(*el);
 
-				if(castsShadow
-				   && !!(enabledVisibilityTests & FrustumComponentVisibilityTestFlag::SPOT_LIGHT_SHADOWS_ENABLED))
+				if(castsShadow && !!(frustumFlags & FrustumComponentVisibilityTestFlag::kSpotLightShadowsEnabled))
 				{
 					RenderQueue* a = alloc.newInstance<RenderQueue>();
 					nextQueues = WeakArray<RenderQueue>(a, 1);
@@ -514,7 +506,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				for(U32 i = 0; i < cascadeCount; ++i)
 				{
 					cascadeFrustumComponents[i].setEnabledVisibilityTests(
-						FrustumComponentVisibilityTestFlag::SHADOW_CASTERS);
+						FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents);
 					Bool updated;
 					SceneComponentUpdateInfo scUpdateInfo(0.0, 1.0);
 					scUpdateInfo.m_node = &node;
@@ -695,8 +687,8 @@ void CombineResultsTask::combine()
 
 #undef ANKI_VIS_COMBINE
 
-	const Bool isShadowFrustum =
-		!!(m_frcCtx->m_frc->getEnabledVisibilityTests() & FrustumComponentVisibilityTestFlag::SHADOW_CASTERS);
+	const Bool isShadowFrustum = !!(m_frcCtx->m_frc->getEnabledVisibilityTests()
+									& FrustumComponentVisibilityTestFlag::kShadowCasterRenderComponents);
 
 	// Sort some of the arrays
 	if(!isShadowFrustum)
@@ -856,7 +848,7 @@ void SceneGraph::doVisibilityTests(SceneNode& fsn, SceneGraph& scene, RenderQueu
 	{
 		// This is the frustum for RT.
 		ANKI_ASSERT(
-			!(extendedFrustum->getEnabledVisibilityTests() & ~FrustumComponentVisibilityTestFlag::ALL_RAY_TRACING));
+			!(extendedFrustum->getEnabledVisibilityTests() & ~FrustumComponentVisibilityTestFlag::kAllRayTracing));
 
 		rqueue.m_rayTracingQueue = scene.getFrameAllocator().newInstance<RenderQueue>();
 		ctx.submitNewWork(*extendedFrustum, mainFrustum, *rqueue.m_rayTracingQueue, hive);