mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Show active HW buffers in profiler
This commit is contained in:
		@@ -61,8 +61,8 @@ struct SFrameStats {
 | 
			
		||||
	u32 PrimitivesDrawn = 0;
 | 
			
		||||
	//! Number of hardware buffers uploaded (new or updated)
 | 
			
		||||
	u32 HWBuffersUploaded = 0;
 | 
			
		||||
	//! Sum of uploaded hardware buffer size
 | 
			
		||||
	u32 HWBuffersUploadedSize = 0;
 | 
			
		||||
	//! Number of active hardware buffers
 | 
			
		||||
	u32 HWBuffersActive = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
//! Interface to driver which is able to perform 2d and 3d graphics functions.
 | 
			
		||||
 
 | 
			
		||||
@@ -1161,6 +1161,8 @@ void CNullDriver::updateAllHardwareBuffers()
 | 
			
		||||
				deleteHardwareBuffer(Link);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	FrameStats.HWBuffersActive = HWBufferList.size();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CNullDriver::deleteHardwareBuffer(SHWBufferLink *HWBuffer)
 | 
			
		||||
 
 | 
			
		||||
@@ -588,7 +588,7 @@ protected:
 | 
			
		||||
	inline void accountHWBufferUpload(u32 size)
 | 
			
		||||
	{
 | 
			
		||||
		FrameStats.HWBuffersUploaded++;
 | 
			
		||||
		FrameStats.HWBuffersUploadedSize += size;
 | 
			
		||||
		(void)size;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	inline bool getWriteZBuffer(const SMaterial &material) const
 | 
			
		||||
 
 | 
			
		||||
@@ -1706,8 +1706,8 @@ void Game::updateProfilers(const RunStats &stats, const FpsControl &draw_times,
 | 
			
		||||
	if (stats2.Drawcalls > 0)
 | 
			
		||||
		g_profiler->avg("Irr: primitives per drawcall",
 | 
			
		||||
			stats2.PrimitivesDrawn / float(stats2.Drawcalls));
 | 
			
		||||
	g_profiler->avg("Irr: buffers uploaded", stats2.HWBuffersUploaded);
 | 
			
		||||
	g_profiler->avg("Irr: buffers uploaded (bytes)", stats2.HWBuffersUploadedSize);
 | 
			
		||||
	g_profiler->avg("Irr: HW buffers uploaded", stats2.HWBuffersUploaded);
 | 
			
		||||
	g_profiler->avg("Irr: HW buffers active", stats2.HWBuffersActive);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Game::updateStats(RunStats *stats, const FpsControl &draw_times,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user