Selaa lähdekoodia

Restructure the config options in order to avoid compilers optimizing out unused global variables

Panagiotis Christopoulos Charitos 5 vuotta sitten
vanhempi
sitoutus
6e9eab1798

+ 0 - 7
src/anki/core/App.cpp

@@ -34,13 +34,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(width, 1280, 16, 16 * 1024, "Width")
-ANKI_REGISTER_CONFIG_OPTION(height, 768, 16, 16 * 1024, "Height")
-ANKI_REGISTER_CONFIG_OPTION(core_mainThreadCount, max(2u, getCpuCoresCount() / 2u), 2u, 1024u)
-ANKI_REGISTER_CONFIG_OPTION(core_displayStats, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(core_clearCaches, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(window_fullscreen, 0, 0, 1)
-
 #if ANKI_OS_ANDROID
 /// The one and only android hack
 android_app* gAndroidApp = nullptr;

+ 16 - 0
src/anki/core/ConfigDefs.h

@@ -0,0 +1,16 @@
+// Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+ANKI_CONFIG_OPTION(core_uniformPerFrameMemorySize, 16_MB, 1_MB, 1_GB)
+ANKI_CONFIG_OPTION(core_storagePerFrameMemorySize, 16_MB, 1_MB, 1_GB)
+ANKI_CONFIG_OPTION(core_vertexPerFrameMemorySize, 10_MB, 1_MB, 1_GB)
+ANKI_CONFIG_OPTION(core_textureBufferPerFrameMemorySize, 1_MB, 1_MB, 1_GB)
+
+ANKI_CONFIG_OPTION(width, 1280, 16, 16 * 1024, "Width")
+ANKI_CONFIG_OPTION(height, 768, 16, 16 * 1024, "Height")
+ANKI_CONFIG_OPTION(core_mainThreadCount, max(2u, getCpuCoresCount() / 2u), 2u, 1024u)
+ANKI_CONFIG_OPTION(core_displayStats, 0, 0, 1)
+ANKI_CONFIG_OPTION(core_clearCaches, 0, 0, 1)
+ANKI_CONFIG_OPTION(window_fullscreen, 0, 0, 1)

+ 35 - 29
src/anki/core/ConfigSet.cpp

@@ -8,6 +8,10 @@
 #include <anki/util/Logger.h>
 #include <anki/util/File.h>
 
+// Used by the config options
+#include <anki/util/System.h>
+#include <anki/renderer/ClusterBin.h>
+
 namespace anki
 {
 
@@ -59,6 +63,14 @@ public:
 ConfigSet::ConfigSet()
 {
 	m_alloc = HeapAllocator<U8>(allocAligned, nullptr);
+
+#define ANKI_CONFIG_OPTION(name, ...) newOption(ANKI_STRINGIZE(name), __VA_ARGS__);
+#include <anki/core/ConfigDefs.h>
+#include <anki/resource/ConfigDefs.h>
+#include <anki/renderer/ConfigDefs.h>
+#include <anki/scene/ConfigDefs.h>
+#include <anki/gr/ConfigDefs.h>
+#undef ANKI_CONFIG_OPTION
 }
 
 ConfigSet::~ConfigSet()
@@ -181,39 +193,35 @@ void ConfigSet::newOptionInternal(CString optionName, U64 value, U64 minValue, U
 
 void ConfigSet::set(CString optionName, CString value)
 {
-	Option* o = tryFind(optionName);
-	ANKI_ASSERT(o);
-	ANKI_ASSERT(o->m_type == Option::STRING);
-	o->m_str.destroy(m_alloc);
-	o->m_str.create(m_alloc, value);
+	Option& o = find(optionName);
+	ANKI_ASSERT(o.m_type == Option::STRING);
+	o.m_str.destroy(m_alloc);
+	o.m_str.create(m_alloc, value);
 }
 
 void ConfigSet::setInternal(CString optionName, F64 value)
 {
-	Option* o = tryFind(optionName);
-	ANKI_ASSERT(o);
-	ANKI_ASSERT(o->m_type == Option::FLOAT);
-	ANKI_ASSERT(value >= o->m_minFloat);
-	ANKI_ASSERT(value <= o->m_maxFloat);
-	o->m_float = value;
+	Option& o = find(optionName);
+	ANKI_ASSERT(o.m_type == Option::FLOAT);
+	ANKI_ASSERT(value >= o.m_minFloat);
+	ANKI_ASSERT(value <= o.m_maxFloat);
+	o.m_float = value;
 }
 
 void ConfigSet::setInternal(CString optionName, U64 value)
 {
-	Option* o = tryFind(optionName);
-	ANKI_ASSERT(o);
-	ANKI_ASSERT(o->m_type == Option::UNSIGNED);
-	ANKI_ASSERT(value >= o->m_minUnsigned);
-	ANKI_ASSERT(value <= o->m_maxUnsigned);
-	o->m_unsigned = value;
+	Option& o = find(optionName);
+	ANKI_ASSERT(o.m_type == Option::UNSIGNED);
+	ANKI_ASSERT(value >= o.m_minUnsigned);
+	ANKI_ASSERT(value <= o.m_maxUnsigned);
+	o.m_unsigned = value;
 }
 
 F64 ConfigSet::getNumberF64(CString optionName) const
 {
-	const Option* option = tryFind(optionName);
-	ANKI_ASSERT(option);
-	ANKI_ASSERT(option->m_type == Option::FLOAT);
-	return option->m_float;
+	const Option& option = find(optionName);
+	ANKI_ASSERT(option.m_type == Option::FLOAT);
+	return option.m_float;
 }
 
 F32 ConfigSet::getNumberF32(CString optionName) const
@@ -223,10 +231,9 @@ F32 ConfigSet::getNumberF32(CString optionName) const
 
 U64 ConfigSet::getNumberU64(CString optionName) const
 {
-	const Option* option = tryFind(optionName);
-	ANKI_ASSERT(option);
-	ANKI_ASSERT(option->m_type == Option::UNSIGNED);
-	return option->m_unsigned;
+	const Option& option = find(optionName);
+	ANKI_ASSERT(option.m_type == Option::UNSIGNED);
+	return option.m_unsigned;
 }
 
 U32 ConfigSet::getNumberU32(CString optionName) const
@@ -271,10 +278,9 @@ Bool ConfigSet::getBool(CString optionName) const
 
 CString ConfigSet::getString(CString optionName) const
 {
-	const Option* o = tryFind(optionName);
-	ANKI_ASSERT(o);
-	ANKI_ASSERT(o->m_type == Option::STRING);
-	return o->m_str.toCString();
+	const Option& o = find(optionName);
+	ANKI_ASSERT(o.m_type == Option::STRING);
+	return o.m_str.toCString();
 }
 
 Error ConfigSet::loadFromFile(CString filename)

+ 45 - 41
src/anki/core/ConfigSet.h

@@ -34,33 +34,65 @@ public:
 
 	/// @name Set the value of an option.
 	/// @{
-	void set(CString optionName, CString value);
+	void set(CString option, CString value);
 
 	template<typename T, ANKI_ENABLE(std::is_integral<T>::value)>
-	void set(CString optionName, T value)
+	void set(CString option, T value)
 	{
-		setInternal(optionName, U64(value));
+		setInternal(option, U64(value));
 	}
 
 	template<typename T, ANKI_ENABLE(std::is_floating_point<T>::value)>
-	void set(CString optionName, T value)
+	void set(CString option, T value)
 	{
-		setInternal(optionName, F64(value));
+		setInternal(option, F64(value));
 	}
 	/// @}
 
 	/// @name Find an option and return its value.
 	/// @{
-	F64 getNumberF64(CString optionName) const;
-	F32 getNumberF32(CString optionName) const;
-	U64 getNumberU64(CString optionName) const;
-	U32 getNumberU32(CString optionName) const;
-	U16 getNumberU16(CString optionName) const;
-	U8 getNumberU8(CString optionName) const;
-	Bool getBool(CString optionName) const;
-	CString getString(CString optionName) const;
+	F64 getNumberF64(CString option) const;
+	F32 getNumberF32(CString option) const;
+	U64 getNumberU64(CString option) const;
+	U32 getNumberU32(CString option) const;
+	U16 getNumberU16(CString option) const;
+	U8 getNumberU8(CString option) const;
+	Bool getBool(CString option) const;
+	CString getString(CString option) const;
 	/// @}
 
+	ANKI_USE_RESULT Error loadFromFile(CString filename);
+
+	ANKI_USE_RESULT Error saveToFile(CString filename) const;
+
+	ANKI_USE_RESULT Error setFromCommandLineArguments(U32 cmdLineArgsCount, char* cmdLineArgs[]);
+
+private:
+	class Option;
+
+	HeapAllocator<U8> m_alloc;
+	List<Option> m_options;
+
+	Option* tryFind(CString name);
+	const Option* tryFind(CString name) const;
+
+	Option& find(CString name)
+	{
+		Option* o = tryFind(name);
+		ANKI_ASSERT(o && "Couldn't find config option");
+		return *o;
+	}
+
+	const Option& find(CString name) const
+	{
+		const Option* o = tryFind(name);
+		ANKI_ASSERT(o && "Couldn't find config option");
+		return *o;
+	}
+
+	void setInternal(CString option, F64 value);
+	void setInternal(CString option, U64 value);
+
 	/// @name Create new options.
 	/// @{
 	void newOption(CString optionName, CString value, CString helpMsg);
@@ -78,40 +110,12 @@ public:
 	}
 	/// @}
 
-	ANKI_USE_RESULT Error loadFromFile(CString filename);
-
-	ANKI_USE_RESULT Error saveToFile(CString filename) const;
-
-	ANKI_USE_RESULT Error setFromCommandLineArguments(U32 cmdLineArgsCount, char* cmdLineArgs[]);
-
-private:
-	class Option;
-
-	HeapAllocator<U8> m_alloc;
-	List<Option> m_options;
-
-	Option* tryFind(CString name);
-	const Option* tryFind(CString name) const;
-
-	void setInternal(CString optionName, F64 value);
-	void setInternal(CString optionName, U64 value);
-
 	void newOptionInternal(CString optionName, U64 value, U64 minValue, U64 maxValue, CString helpMsg);
 	void newOptionInternal(CString optionName, F64 value, F64 minValue, F64 maxValue, CString helpMsg);
 };
 
 /// The default config set. Copy that to your own to override.
 using DefaultConfigSet = Singleton<ConfigSet>;
-
-/// This macro registers a config option. Have it on .cpp files.
-#define ANKI_REGISTER_CONFIG_OPTION(name, ...) \
-	struct ANKI_CONCATENATE(ConfigSet, name) \
-	{ \
-		ANKI_CONCATENATE(ConfigSet, name)() \
-		{ \
-			DefaultConfigSet::get().newOption(#name, __VA_ARGS__); \
-		} \
-	} ANKI_CONCATENATE(g_ConfigSet, name);
 /// @}
 
 } // end namespace anki

+ 0 - 5
src/anki/core/StagingGpuMemoryManager.cpp

@@ -11,11 +11,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(core_uniformPerFrameMemorySize, 16_MB, 1_MB, 1_GB)
-ANKI_REGISTER_CONFIG_OPTION(core_storagePerFrameMemorySize, 16_MB, 1_MB, 1_GB)
-ANKI_REGISTER_CONFIG_OPTION(core_vertexPerFrameMemorySize, 10_MB, 1_MB, 1_GB)
-ANKI_REGISTER_CONFIG_OPTION(core_textureBufferPerFrameMemorySize, 1_MB, 1_MB, 1_GB)
-
 StagingGpuMemoryManager::~StagingGpuMemoryManager()
 {
 	m_gr->finish();

+ 13 - 0
src/anki/gr/ConfigDefs.h

@@ -0,0 +1,13 @@
+// Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+ANKI_CONFIG_OPTION(gr_debugContext, 0, 0, 1)
+ANKI_CONFIG_OPTION(gr_vsync, 0, 0, 1)
+ANKI_CONFIG_OPTION(gr_debugMarkers, 0, 0, 1)
+
+// Vulkan
+ANKI_CONFIG_OPTION(gr_diskShaderCacheMaxSize, 128_MB, 1_MB, 1_GB)
+ANKI_CONFIG_OPTION(gr_vkminor, 1, 1, 1)
+ANKI_CONFIG_OPTION(gr_vkmajor, 1, 1, 1)

+ 0 - 7
src/anki/gr/vulkan/GrManagerImpl.cpp

@@ -16,13 +16,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(gr_debugContext, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(gr_vsync, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(gr_debugMarkers, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(gr_diskShaderCacheMaxSize, 128_MB, 1_MB, 1_GB)
-ANKI_REGISTER_CONFIG_OPTION(gr_vkminor, 1, 1, 1)
-ANKI_REGISTER_CONFIG_OPTION(gr_vkmajor, 1, 1, 1)
-
 GrManagerImpl::~GrManagerImpl()
 {
 	// FIRST THING: wait for the GPU

+ 0 - 3
src/anki/renderer/Bloom.cpp

@@ -13,9 +13,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_bloomThreshold, 2.5, 0.0, 256.0)
-ANKI_REGISTER_CONFIG_OPTION(r_bloomScale, 2.5, 0.0, 256.0)
-
 Bloom::Bloom(Renderer* r)
 	: RendererObject(r)
 {

+ 0 - 2
src/anki/renderer/ClusterBin.cpp

@@ -13,8 +13,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_avgObjectsPerCluster, 16, 16, 256)
-
 /// Get a view space point.
 static Vec4 unproject(const F32 zVspace, const Vec2& ndc, const Vec4& unprojParams)
 {

+ 53 - 0
src/anki/renderer/ConfigDefs.h

@@ -0,0 +1,53 @@
+// Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+ANKI_CONFIG_OPTION(r_lodDistance0, 20.0, 1.0, MAX_F64, "Distance that will be used to calculate the LOD 0")
+ANKI_CONFIG_OPTION(r_lodDistance1, 40.0, 2.0, MAX_F64, "Distance that will be used to calculate the LOD 1")
+ANKI_CONFIG_OPTION(r_clusterSizeX, 32, 1, 256)
+ANKI_CONFIG_OPTION(r_clusterSizeY, 26, 1, 256)
+ANKI_CONFIG_OPTION(r_clusterSizeZ, 32, 1, 256)
+ANKI_CONFIG_OPTION(r_textureAnisotropy, 8, 1, 16)
+
+ANKI_CONFIG_OPTION(r_renderingQuality, 1.0, 0.5, 1.0, "A factor over the requested renderingresolution")
+
+ANKI_CONFIG_OPTION(r_volumetricLightingAccumulationClusterFractionXY, 4, 1, 16)
+ANKI_CONFIG_OPTION(r_volumetricLightingAccumulationClusterFractionZ, 4, 1, 16)
+ANKI_CONFIG_OPTION(r_volumetricLightingAccumulationFinalClusterInZ, 26, 1, 256)
+
+ANKI_CONFIG_OPTION(r_ssrMaxSteps, 64, 1, 2048)
+ANKI_CONFIG_OPTION(r_ssrHistoryBlendFactor, 0.3, 0.0, MAX_F64)
+
+ANKI_CONFIG_OPTION(r_shadowMappingTileResolution, 128, 16, 2048)
+ANKI_CONFIG_OPTION(r_shadowMappingTileCountPerRowOrColumn, 16, 1, 256)
+ANKI_CONFIG_OPTION(r_shadowMappingScratchTileCountX,
+	4 * (MAX_SHADOW_CASCADES + 2),
+	1u,
+	256u,
+	"Number of tiles of the scratch buffer in X")
+ANKI_CONFIG_OPTION(r_shadowMappingScratchTileCountY, 4, 1, 256, "Number of tiles of the scratch buffer in Y")
+ANKI_CONFIG_OPTION(r_shadowMappingLightLodDistance0, 10.0, 1.0, MAX_F64)
+ANKI_CONFIG_OPTION(r_shadowMappingLightLodDistance1, 20.0, 2.0, MAX_F64)
+
+ANKI_CONFIG_OPTION(r_probeReflectionResolution, 128, 4, 2048)
+ANKI_CONFIG_OPTION(r_probeReflectionIrradianceResolution, 16, 4, 2048)
+ANKI_CONFIG_OPTION(r_probeRefectionlMaxSimultaneousProbeCount, 32, 4, 256)
+ANKI_CONFIG_OPTION(r_probeReflectionShadowMapResolution, 64, 4, 2048)
+
+ANKI_CONFIG_OPTION(r_lensFlareMaxSpritesPerFlare, 8, 4, 256)
+ANKI_CONFIG_OPTION(r_lensFlareMaxFlares, 16, 8, 256)
+
+ANKI_CONFIG_OPTION(r_giTileResolution, 32, 4, 2048)
+ANKI_CONFIG_OPTION(r_giShadowMapResolution, 128, 4, 2048)
+ANKI_CONFIG_OPTION(r_giMaxCachedProbes, 16, 4, 2048)
+ANKI_CONFIG_OPTION(r_giMaxVisibleProbes, 8, 1, 256)
+
+ANKI_CONFIG_OPTION(r_motionBlurSamples, 32, 1, 2048)
+
+ANKI_CONFIG_OPTION(r_dbgEnabled, 0, 0, 1)
+
+ANKI_CONFIG_OPTION(r_avgObjectsPerCluster, 16, 16, 256)
+
+ANKI_CONFIG_OPTION(r_bloomThreshold, 2.5, 0.0, 256.0)
+ANKI_CONFIG_OPTION(r_bloomScale, 2.5, 0.0, 256.0)

+ 0 - 2
src/anki/renderer/Dbg.cpp

@@ -18,8 +18,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_dbgEnabled, 0, 0, 1)
-
 Dbg::Dbg(Renderer* r)
 	: RendererObject(r)
 {

+ 0 - 2
src/anki/renderer/FinalComposite.cpp

@@ -21,8 +21,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_motionBlurSamples, 32, 1, 2048)
-
 FinalComposite::FinalComposite(Renderer* r)
 	: RendererObject(r)
 {

+ 0 - 5
src/anki/renderer/GlobalIllumination.cpp

@@ -14,11 +14,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_giTileResolution, 32, 4, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_giShadowMapResolution, 128, 4, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_giMaxCachedProbes, 16, 4, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_giMaxVisibleProbes, 8, 1, 256)
-
 /// Given a cell index compute its world position.
 static Vec3 computeProbeCellPosition(U32 cellIdx, const GlobalIlluminationProbeQueueElement& probe)
 {

+ 0 - 3
src/anki/renderer/LensFlare.cpp

@@ -14,9 +14,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_lensFlareMaxSpritesPerFlare, 8, 4, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_lensFlareMaxFlares, 16, 8, 256)
-
 LensFlare::~LensFlare()
 {
 }

+ 0 - 2
src/anki/renderer/MainRenderer.cpp

@@ -20,8 +20,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_renderingQuality, 1.0, 0.5, 1.0, "A factor over the requested renderingresolution")
-
 MainRenderer::MainRenderer()
 {
 }

+ 0 - 5
src/anki/renderer/ProbeReflections.cpp

@@ -16,11 +16,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_probeReflectionResolution, 128, 4, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_probeReflectionIrradianceResolution, 16, 4, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_probeRefectionlMaxSimultaneousProbeCount, 32, 4, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_probeReflectionShadowMapResolution, 64, 4, 2048)
-
 ProbeReflections::ProbeReflections(Renderer* r)
 	: RendererObject(r)
 	, m_lightShading(r)

+ 0 - 7
src/anki/renderer/Renderer.cpp

@@ -36,13 +36,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_lodDistance0, 20.0, 1.0, MAX_F64, "Distance that will be used to calculate the LOD 0")
-ANKI_REGISTER_CONFIG_OPTION(r_lodDistance1, 40.0, 2.0, MAX_F64, "Distance that will be used to calculate the LOD 1")
-ANKI_REGISTER_CONFIG_OPTION(r_clusterSizeX, 32, 1, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_clusterSizeY, 26, 1, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_clusterSizeZ, 32, 1, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_textureAnisotropy, 8, 1, 16)
-
 Renderer::Renderer()
 	: m_sceneDrawer(this)
 {

+ 0 - 11
src/anki/renderer/ShadowMapping.cpp

@@ -13,17 +13,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingTileResolution, 128, 16, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingTileCountPerRowOrColumn, 16, 1, 256)
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingScratchTileCountX,
-	4 * (MAX_SHADOW_CASCADES + 2),
-	1u,
-	256u,
-	"Number of tiles of the scratch buffer in X")
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingScratchTileCountY, 4, 1, 256, "Number of tiles of the scratch buffer in Y")
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingLightLodDistance0, 10.0, 1.0, MAX_F64)
-ANKI_REGISTER_CONFIG_OPTION(r_shadowMappingLightLodDistance1, 20.0, 2.0, MAX_F64)
-
 class ShadowMapping::Scratch::WorkItem
 {
 public:

+ 0 - 3
src/anki/renderer/Ssr.cpp

@@ -15,9 +15,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_ssrMaxSteps, 64, 1, 2048)
-ANKI_REGISTER_CONFIG_OPTION(r_ssrHistoryBlendFactor, 0.3, 0.0, MAX_F64)
-
 Ssr::~Ssr()
 {
 }

+ 0 - 4
src/anki/renderer/VolumetricLightingAccumulation.cpp

@@ -13,10 +13,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(r_volumetricLightingAccumulationClusterFractionXY, 4, 1, 16)
-ANKI_REGISTER_CONFIG_OPTION(r_volumetricLightingAccumulationClusterFractionZ, 4, 1, 16)
-ANKI_REGISTER_CONFIG_OPTION(r_volumetricLightingAccumulationFinalClusterInZ, 26, 1, 256)
-
 VolumetricLightingAccumulation::VolumetricLightingAccumulation(Renderer* r)
 	: RendererObject(r)
 {

+ 9 - 0
src/anki/resource/ConfigDefs.h

@@ -0,0 +1,9 @@
+// Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+ANKI_CONFIG_OPTION(rsrc_maxTextureSize, 1024u * 1024u, 4u, MAX_U32)
+ANKI_CONFIG_OPTION(rsrc_dumpShaderSources, 0, 0, 1)
+ANKI_CONFIG_OPTION(rsrc_dataPaths, ".", "The engine loads assets only in from these paths. Separate them with :")
+ANKI_CONFIG_OPTION(rsrc_transferScratchMemorySize, 256_MB, 1_MB, 4_GB)

+ 0 - 6
src/anki/resource/ResourceManager.cpp

@@ -23,12 +23,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(rsrc_maxTextureSize, 1024u * 1024u, 4u, MAX_U32)
-ANKI_REGISTER_CONFIG_OPTION(rsrc_dumpShaderSources, 0, 0, 1)
-ANKI_REGISTER_CONFIG_OPTION(
-	rsrc_dataPaths, ".", "The engine loads assets only in from these paths. Separate them with :")
-ANKI_REGISTER_CONFIG_OPTION(rsrc_transferScratchMemorySize, 256_MB, 1_MB, 4_GB)
-
 ResourceManager::ResourceManager()
 {
 }

+ 10 - 0
src/anki/scene/ConfigDefs.h

@@ -0,0 +1,10 @@
+// Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+ANKI_CONFIG_OPTION(
+	scene_earlyZDistance, 10.0, 0.0, MAX_F64, "Objects with distance lower than that will be used in early Z")
+ANKI_CONFIG_OPTION(scene_reflectionProbeEffectiveDistance, 256.0, 1.0, MAX_F64, "How far reflection probes can look")
+ANKI_CONFIG_OPTION(
+	scene_reflectionProbeShadowEffectiveDistance, 32.0, 1.0, MAX_F64, "How far to render shadows for reflection probes")

+ 0 - 7
src/anki/scene/SceneGraph.cpp

@@ -19,13 +19,6 @@
 namespace anki
 {
 
-ANKI_REGISTER_CONFIG_OPTION(
-	scene_earlyZDistance, 10.0, 0.0, MAX_F64, "Objects with distance lower than that will be used in early Z")
-ANKI_REGISTER_CONFIG_OPTION(
-	scene_reflectionProbeEffectiveDistance, 256.0, 1.0, MAX_F64, "How far reflection probes can look")
-ANKI_REGISTER_CONFIG_OPTION(
-	scene_reflectionProbeShadowEffectiveDistance, 32.0, 1.0, MAX_F64, "How far to render shadows for reflection probes")
-
 const U NODE_UPDATE_BATCH = 10;
 
 class SceneGraph::UpdateSceneNodesCtx