Browse Source

Some renaming

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
7b19330e72

+ 6 - 6
AnKi/Core/App.cpp

@@ -132,8 +132,8 @@ void App::cleanup()
 	m_physics = nullptr;
 	deleteInstance(m_mainPool, m_stagingMem);
 	m_stagingMem = nullptr;
-	deleteInstance(m_mainPool, m_vertexMem);
-	m_vertexMem = nullptr;
+	deleteInstance(m_mainPool, m_unifiedGometryMemPool);
+	m_unifiedGometryMemPool = nullptr;
 	deleteInstance(m_mainPool, m_threadHive);
 	m_threadHive = nullptr;
 	deleteInstance(m_mainPool, m_maliHwCounters);
@@ -277,8 +277,8 @@ Error App::initInternal(AllocAlignedCallback allocCb, void* allocCbUserData)
 	//
 	// GPU mem
 	//
-	m_vertexMem = newInstance<VertexGpuMemoryPool>(m_mainPool);
-	ANKI_CHECK(m_vertexMem->init(&m_mainPool, m_gr, *m_config));
+	m_unifiedGometryMemPool = newInstance<UnifiedGeometryMemoryPool>(m_mainPool);
+	ANKI_CHECK(m_unifiedGometryMemPool->init(&m_mainPool, m_gr, *m_config));
 
 	m_stagingMem = newInstance<StagingGpuMemoryPool>(m_mainPool);
 	ANKI_CHECK(m_stagingMem->init(m_gr, *m_config));
@@ -315,7 +315,7 @@ Error App::initInternal(AllocAlignedCallback allocCb, void* allocCbUserData)
 	rinit.m_gr = m_gr;
 	rinit.m_physics = m_physics;
 	rinit.m_resourceFs = m_resourceFs;
-	rinit.m_vertexMemory = m_vertexMem;
+	rinit.m_unifiedGometryMemoryPool = m_unifiedGometryMemPool;
 	rinit.m_config = m_config;
 	rinit.m_allocCallback = m_mainPool.getAllocationCallback();
 	rinit.m_allocCallbackData = m_mainPool.getAllocationCallbackUserData();
@@ -509,7 +509,7 @@ Error App::mainLoop()
 
 				const GrManagerStats grStats = m_gr->getStats();
 				BuddyAllocatorBuilderStats vertMemStats;
-				m_vertexMem->getMemoryStats(vertMemStats);
+				m_unifiedGometryMemPool->getMemoryStats(vertMemStats);
 
 				in.m_gpuDeviceMemoryAllocated = grStats.m_deviceMemoryAllocated;
 				in.m_gpuDeviceMemoryInUse = grStats.m_deviceMemoryInUse;

+ 2 - 2
AnKi/Core/App.h

@@ -26,7 +26,7 @@ class ScriptManager;
 class ResourceManager;
 class ResourceFilesystem;
 class StagingGpuMemoryPool;
-class VertexGpuMemoryPool;
+class UnifiedGeometryMemoryPool;
 class UiManager;
 class UiQueueElement;
 class RenderQueue;
@@ -146,7 +146,7 @@ private:
 	ThreadHive* m_threadHive = nullptr;
 	GrManager* m_gr = nullptr;
 	MaliHwCounters* m_maliHwCounters = nullptr;
-	VertexGpuMemoryPool* m_vertexMem = nullptr;
+	UnifiedGeometryMemoryPool* m_unifiedGometryMemPool = nullptr;
 	StagingGpuMemoryPool* m_stagingMem = nullptr;
 	PhysicsWorld* m_physics = nullptr;
 	ResourceFilesystem* m_resourceFs = nullptr;

+ 4 - 4
AnKi/Core/GpuMemoryPools.cpp

@@ -10,12 +10,12 @@
 
 namespace anki {
 
-VertexGpuMemoryPool::~VertexGpuMemoryPool()
+UnifiedGeometryMemoryPool::~UnifiedGeometryMemoryPool()
 {
 	// Do nothing
 }
 
-Error VertexGpuMemoryPool::init(HeapMemoryPool* pool, GrManager* gr, const ConfigSet& cfg)
+Error UnifiedGeometryMemoryPool::init(HeapMemoryPool* pool, GrManager* gr, const ConfigSet& cfg)
 {
 	ANKI_ASSERT(pool && gr);
 	m_gr = gr;
@@ -43,7 +43,7 @@ Error VertexGpuMemoryPool::init(HeapMemoryPool* pool, GrManager* gr, const Confi
 	return Error::kNone;
 }
 
-Error VertexGpuMemoryPool::allocate(PtrSize size, U32 alignment, PtrSize& offset)
+Error UnifiedGeometryMemoryPool::allocate(PtrSize size, U32 alignment, PtrSize& offset)
 {
 	U32 offset32;
 	const Bool success = m_buddyAllocator.allocate(size, alignment, offset32);
@@ -62,7 +62,7 @@ Error VertexGpuMemoryPool::allocate(PtrSize size, U32 alignment, PtrSize& offset
 	return Error::kNone;
 }
 
-void VertexGpuMemoryPool::free(PtrSize size, U32 alignment, PtrSize offset)
+void UnifiedGeometryMemoryPool::free(PtrSize size, U32 alignment, PtrSize offset)
 {
 	m_buddyAllocator.free(U32(offset), size, alignment);
 }

+ 5 - 5
AnKi/Core/GpuMemoryPools.h

@@ -19,16 +19,16 @@ class ConfigSet;
 /// @{
 
 /// Manages vertex and index memory for the whole application.
-class VertexGpuMemoryPool
+class UnifiedGeometryMemoryPool
 {
 public:
-	VertexGpuMemoryPool() = default;
+	UnifiedGeometryMemoryPool() = default;
 
-	VertexGpuMemoryPool(const VertexGpuMemoryPool&) = delete; // Non-copyable
+	UnifiedGeometryMemoryPool(const UnifiedGeometryMemoryPool&) = delete; // Non-copyable
 
-	~VertexGpuMemoryPool();
+	~UnifiedGeometryMemoryPool();
 
-	VertexGpuMemoryPool& operator=(const VertexGpuMemoryPool&) = delete; // Non-copyable
+	UnifiedGeometryMemoryPool& operator=(const UnifiedGeometryMemoryPool&) = delete; // Non-copyable
 
 	Error init(HeapMemoryPool* pool, GrManager* gr, const ConfigSet& cfg);
 

+ 3 - 3
AnKi/Gr/Vulkan/Pipeline.cpp

@@ -381,13 +381,13 @@ const VkGraphicsPipelineCreateInfo& PipelineStateTracker::updatePipelineCreateIn
 	dynCi.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
 
 	// Almost all state is dynamic. Depth bias is static
-	static constexpr Array<VkDynamicState, 9> DYN = {
+	static constexpr Array<VkDynamicState, 9> kDyn = {
 		{VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, VK_DYNAMIC_STATE_BLEND_CONSTANTS,
 		 VK_DYNAMIC_STATE_DEPTH_BOUNDS, VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, VK_DYNAMIC_STATE_STENCIL_WRITE_MASK,
 		 VK_DYNAMIC_STATE_STENCIL_REFERENCE, VK_DYNAMIC_STATE_LINE_WIDTH, VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR}};
 
-	dynCi.dynamicStateCount = DYN.getSize();
-	dynCi.pDynamicStates = &DYN[0];
+	dynCi.dynamicStateCount = kDyn.getSize();
+	dynCi.pDynamicStates = &kDyn[0];
 	ci.pDynamicState = &dynCi;
 
 	// The rest

+ 7 - 6
AnKi/Resource/MeshResource.cpp

@@ -61,13 +61,14 @@ MeshResource::~MeshResource()
 
 	if(m_vertexBuffersOffset != kMaxPtrSize)
 	{
-		getManager().getVertexGpuMemory().free(m_vertexBuffersSize, 4, m_vertexBuffersOffset);
+		getManager().getUnifiedGeometryMemoryPool().free(m_vertexBuffersSize, 4, m_vertexBuffersOffset);
 	}
 
 	if(m_indexBufferOffset != kMaxPtrSize)
 	{
 		const PtrSize indexBufferSize = PtrSize(m_indexCount) * ((m_indexType == IndexType::kU32) ? 4 : 2);
-		getManager().getVertexGpuMemory().free(indexBufferSize, getIndexSize(m_indexType), m_indexBufferOffset);
+		getManager().getUnifiedGeometryMemoryPool().free(indexBufferSize, getIndexSize(m_indexType),
+														 m_indexBufferOffset);
 	}
 }
 
@@ -123,8 +124,8 @@ Error MeshResource::load(const ResourceFilename& filename, Bool async)
 	m_indexType = header.m_indexType;
 
 	const PtrSize indexBufferSize = PtrSize(m_indexCount) * ((m_indexType == IndexType::kU32) ? 4 : 2);
-	ANKI_CHECK(
-		getManager().getVertexGpuMemory().allocate(indexBufferSize, getIndexSize(m_indexType), m_indexBufferOffset));
+	ANKI_CHECK(getManager().getUnifiedGeometryMemoryPool().allocate(indexBufferSize, getIndexSize(m_indexType),
+																	m_indexBufferOffset));
 
 	//
 	// Vertex stuff
@@ -143,7 +144,7 @@ Error MeshResource::load(const ResourceFilename& filename, Bool async)
 		m_vertexBuffersSize += m_vertexCount * m_vertexBufferInfos[i].m_stride;
 	}
 
-	ANKI_CHECK(getManager().getVertexGpuMemory().allocate(m_vertexBuffersSize, 4, m_vertexBuffersOffset));
+	ANKI_CHECK(getManager().getUnifiedGeometryMemoryPool().allocate(m_vertexBuffersSize, 4, m_vertexBuffersOffset));
 
 	// Readjust the individual offset now that we have a global offset
 	for(U32 i = 0; i < header.m_vertexBufferCount; ++i)
@@ -168,7 +169,7 @@ Error MeshResource::load(const ResourceFilename& filename, Bool async)
 	// Other
 	m_aabb.setMin(header.m_aabbMin);
 	m_aabb.setMax(header.m_aabbMax);
-	m_vertexBuffer = getManager().getVertexGpuMemory().getVertexBuffer();
+	m_vertexBuffer = getManager().getUnifiedGeometryMemoryPool().getVertexBuffer();
 
 	//
 	// Clear the buffers

+ 1 - 1
AnKi/Resource/ResourceManager.cpp

@@ -46,7 +46,7 @@ Error ResourceManager::init(ResourceManagerInitInfo& init)
 	m_physics = init.m_physics;
 	m_fs = init.m_resourceFs;
 	m_config = init.m_config;
-	m_vertexMem = init.m_vertexMemory;
+	m_unifiedGometryMemoryPool = init.m_unifiedGometryMemoryPool;
 
 	m_pool.init(init.m_allocCallback, init.m_allocCallbackData, "Resources");
 	m_tmpPool.init(init.m_allocCallback, init.m_allocCallbackData, 10_MB);

+ 6 - 6
AnKi/Resource/ResourceManager.h

@@ -21,7 +21,7 @@ class AsyncLoader;
 class ResourceManagerModel;
 class ShaderCompilerCache;
 class ShaderProgramResourceSystem;
-class VertexGpuMemoryPool;
+class UnifiedGeometryMemoryPool;
 
 /// @addtogroup resource
 /// @{
@@ -95,7 +95,7 @@ public:
 	PhysicsWorld* m_physics = nullptr;
 	ResourceFilesystem* m_resourceFs = nullptr;
 	ConfigSet* m_config = nullptr;
-	VertexGpuMemoryPool* m_vertexMemory = nullptr;
+	UnifiedGeometryMemoryPool* m_unifiedGometryMemoryPool = nullptr;
 	AllocAlignedCallback m_allocCallback = 0;
 	void* m_allocCallbackData = nullptr;
 };
@@ -201,10 +201,10 @@ public:
 		return *m_shaderProgramSystem;
 	}
 
-	VertexGpuMemoryPool& getVertexGpuMemory()
+	UnifiedGeometryMemoryPool& getUnifiedGeometryMemoryPool()
 	{
-		ANKI_ASSERT(m_vertexMem);
-		return *m_vertexMem;
+		ANKI_ASSERT(m_unifiedGometryMemoryPool);
+		return *m_unifiedGometryMemoryPool;
 	}
 
 	const ConfigSet& getConfig() const
@@ -222,7 +222,7 @@ private:
 	mutable StackMemoryPool m_tmpPool; ///< Same as above.
 	AsyncLoader* m_asyncLoader = nullptr; ///< Async loading thread
 	ShaderProgramResourceSystem* m_shaderProgramSystem = nullptr;
-	VertexGpuMemoryPool* m_vertexMem = nullptr;
+	UnifiedGeometryMemoryPool* m_unifiedGometryMemoryPool = nullptr;
 	U64 m_uuid = 0;
 	U64 m_loadRequestCount = 0;
 	TransferGpuAllocator* m_transferGpuAlloc = nullptr;

+ 1 - 1
AnKi/Shaders/Include/MeshTypes.h

@@ -22,7 +22,7 @@ const U32 kRegularVertexStreamCount = 6u;
 #if __cplusplus
 inline constexpr Array<Format, kRegularVertexStreamCount> kRegularVertexStreamFormats = {
 	Format::kR32R32G32B32_Sfloat, Format::kR8G8B8A8_Snorm, Format::kR8G8B8A8_Snorm,
-	Format::R32G32_Sfloat,        Format::kR8G8B8A8_Uint,  Format::R8G8B8A8_Snorm};
+	Format::kR32G32_Sfloat,       Format::kR8G8B8A8_Uint,  Format::kR8G8B8A8_Snorm};
 #endif
 
 // For particles