mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0023081: This is desirable to retrieve GPU memory information from graphic driver
Added Graphic3d_GraphicDriver::MemoryInfo() function. Added vfps command to estimate average frame rate of 3D Viewer Simplified vdrawsphere command Removed turnVbo and performance measurements from vdrawsphere. Added vvbo command to control VBO usage flag. Added vmemgpu command to display GPU memory info from graphic driver
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <OSD_MemInfo.hxx>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -419,6 +420,58 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
//function : dmeminfo
|
||||
//purpose :
|
||||
//==============================================================================
|
||||
|
||||
static int dmeminfo (Draw_Interpretor& theDI,
|
||||
Standard_Integer theArgNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
OSD_MemInfo aMemInfo;
|
||||
if (theArgNb <= 1)
|
||||
{
|
||||
theDI << aMemInfo.ToString();
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (Standard_Integer anIter = 1; anIter < theArgNb; ++anIter)
|
||||
{
|
||||
TCollection_AsciiString anArg (theArgVec[anIter]);
|
||||
anArg.LowerCase();
|
||||
if (anArg == "virt" || anArg == "v")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemVirtual)) << " ";
|
||||
}
|
||||
else if (anArg == "wset" || anArg == "w")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemWorkingSet)) << " ";
|
||||
}
|
||||
else if (anArg == "wsetpeak")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemWorkingSetPeak)) << " ";
|
||||
}
|
||||
else if (anArg == "swap")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemSwapUsage)) << " ";
|
||||
}
|
||||
else if (anArg == "swappeak")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemSwapUsagePeak)) << " ";
|
||||
}
|
||||
else if (anArg == "private")
|
||||
{
|
||||
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemPrivate)) << " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Unknown argument '" << theArgVec[anIter] << "'!\n";
|
||||
}
|
||||
}
|
||||
theDI << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Draw::BasicCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
@@ -443,4 +496,8 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
|
||||
theCommands.Add("mallochook",
|
||||
"debug memory allocation/deallocation, w/o args for help",
|
||||
__FILE__, mallochook, g);
|
||||
theCommands.Add ("meminfo",
|
||||
"meminfo [virt|v] [wset|w] [wsetpeak] [swap] [swappeak] [private]"
|
||||
" : memory counters for this process",
|
||||
__FILE__, dmeminfo, g);
|
||||
}
|
||||
|
Reference in New Issue
Block a user