Space Engineers
|
Provides profiling capability More...
Public Member Functions | |
void | GetAutocommit (ref bool val) |
void | SetAutocommit (bool val) |
void | Commit ([CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | Draw ([CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | StartProfilingBlock (string blockName=null, float customValue=0, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | EndProfilingBlock (float customValue=0, MyTimeSpan?customTime=null, string timeFormat=null, string valueFormat=null, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | GPU_StartProfilingBlock (string blockName=null, float customValue=0, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | GPU_EndProfilingBlock (float customValue=0, MyTimeSpan?customTime=null, string timeFormat=null, string valueFormat=null, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | StartNextBlock (string name, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | InitMemoryHack (string name) |
void | ProfileCustomValue (string name, float value, MyTimeSpan?customTime=null, string timeFormat=null, string valueFormat=null, [CallerMemberName] string member="", [CallerLineNumber] int line=0, [CallerFilePath] string file="") |
void | SetLevel (int index) |
void | Dump () |
Static Public Member Functions | |
static MyProfiler | CreateProfiler (string name, string axisName=null, bool memoryProfiling=false) |
Creates new profiler which can be used to profile anything (e.g. network stats). More... | |
static List< MyProfilerBlock > | GetSortedChildren (int frameToSortBy) |
static MyProfilerBlock | FindBlockByIndex (int index) |
static MyProfilerBlock | FindBlockByMax (int frameIndex, int lastValidFrame) |
static void | HandleInput (RenderProfilerCommand command, int index) |
static MyProfiler | GetProfilerAtIndex (int index) |
Public Attributes | |
const string | PerformanceProfilingSymbol = VRage.MyCompilationSymbols.PerformanceProfiling ? "WINDOWS" : "__RANDOM_UNDEFINED_PROFILING_SYMBOL__" |
const bool | MemoryProfiling = VRage.MyCompilationSymbols.ProfileWorkingSetMemory |
Static Public Attributes | |
static bool | Paused = false |
static Action< int > | GetProfilerFromServer |
static Action< int > | SaveProfilerToFile |
static Action< int > | LoadProfilerFromFile |
static int | ServerSelectedIndex |
static bool | IsProfilerFromServer |
Protected Member Functions | |
abstract void | Draw (MyProfiler drawProfiler, int lastFrameIndex, int frameToDraw) |
Static Protected Member Functions | |
static Color | IndexToColor (int index) |
static bool | IsValidIndex (int frameIndex, int lastValidFrame) |
static float | FindMaxWrap (float[] data, int lower, int upper, int lastValidFrame, out int maxIndex) |
Protected Attributes | |
StringBuilder | m_text = new StringBuilder(100) |
Static Protected Attributes | |
static RenderProfilerSortingOrder | m_sortingOrder = RenderProfilerSortingOrder.MillisecondsLastFrame |
Sorting order will sort the listed elements in the profiler by the specified ProfilerSortingOrder More... | |
static MyDrawArea | m_milisecondsGraphScale = new MyDrawArea(0.49f, 0, (2 - 0.51f) / 2, 0.9f, 25) |
static MyDrawArea | m_memoryGraphScale = new MyDrawArea(0.49f, 0, (2 - 0.51f) / 2, 0.6f, 0.001f) |
static Color[] | m_colors |
static MyProfilerBlock | m_fpsBlock |
static float | m_fpsPctg |
static List< MyProfiler > | m_threadProfilers = new List<MyProfiler>(16) |
static MyProfiler | m_selectedProfiler |
static bool | m_enabled = false |
static int | m_selectedFrame = 0 |
static int | m_levelLimit = -1 |
static bool | m_useCustomFrame = false |
static int | m_frameLocalArea = MyProfiler.MAX_FRAMES |
Properties | |
static bool | ProfilerProcessingEnabled [get] |
static bool | ProfilerVisible [get] |
Returns true when profiler is visible. More... | |
static MyProfiler | SelectedProfiler [get, set] |
static int | SelectedIndex [get] |
Provides profiling capability
Non-locking way of render profiler is used. Each thread has it's own profiler is ThreadStatic variable. Data for each profiling block are of two kinds: Immediate (current frame being profiled) and History (previous finished frames) Start/End locking is not necessary, because Start/Stop uses only immediate data and nothing else uses it at the moment. Commit is only other place which uses Immediate data, but it must be called from same thead, no racing condition. Draw and Commit both uses History data, and both can be called from different thread, so there's lock. This way everything runs with no waiting, unless Draw obtains lock in which case Commit wait for Draw to finish (Start/End is still exact).
For threads which does not call commit (background workers, parallel tasks), mechanism which calls commit automatically after each top level End should be added. This way each task will be one "frame" on display
Definition at line 122 of file MyRenderProfiler.cs.
|
inline |
Definition at line 701 of file MyRenderProfiler.cs.
|
inlinestatic |
Creates new profiler which can be used to profile anything (e.g. network stats).
Definition at line 241 of file MyRenderProfiler.cs.
|
inline |
Definition at line 717 of file MyRenderProfiler.cs.
|
protectedpure virtual |
Implemented in VRageRender.Profiler.MyRenderProfilerRendering.
|
inline |
Definition at line 806 of file MyRenderProfiler.cs.
|
inline |
Definition at line 748 of file MyRenderProfiler.cs.
|
inlinestatic |
Definition at line 290 of file MyRenderProfiler.cs.
|
inlinestatic |
Definition at line 309 of file MyRenderProfiler.cs.
|
inlinestaticprotected |
Definition at line 671 of file MyRenderProfiler.cs.
|
inline |
Definition at line 691 of file MyRenderProfiler.cs.
|
inlinestatic |
Definition at line 832 of file MyRenderProfiler.cs.
|
inlinestatic |
Definition at line 255 of file MyRenderProfiler.cs.
|
inline |
Definition at line 760 of file MyRenderProfiler.cs.
|
inline |
Definition at line 754 of file MyRenderProfiler.cs.
|
inlinestatic |
Definition at line 331 of file MyRenderProfiler.cs.
|
inlinestaticprotected |
Definition at line 154 of file MyRenderProfiler.cs.
|
inline |
Definition at line 773 of file MyRenderProfiler.cs.
|
inlinestaticprotected |
Definition at line 302 of file MyRenderProfiler.cs.
|
inline |
Definition at line 779 of file MyRenderProfiler.cs.
|
inline |
Definition at line 696 of file MyRenderProfiler.cs.
|
inline |
Definition at line 798 of file MyRenderProfiler.cs.
|
inline |
Definition at line 767 of file MyRenderProfiler.cs.
|
inline |
Definition at line 742 of file MyRenderProfiler.cs.
|
static |
Definition at line 174 of file MyRenderProfiler.cs.
|
static |
Definition at line 229 of file MyRenderProfiler.cs.
|
static |
Definition at line 176 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 149 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 221 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 164 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 165 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 225 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 223 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 147 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 146 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 222 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 208 of file MyRenderProfiler.cs.
|
staticprotected |
Sorting order will sort the listed elements in the profiler by the specified ProfilerSortingOrder
Definition at line 127 of file MyRenderProfiler.cs.
|
protected |
Definition at line 159 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 206 of file MyRenderProfiler.cs.
|
staticprotected |
Definition at line 224 of file MyRenderProfiler.cs.
const bool VRage.Profiler.MyRenderProfiler.MemoryProfiling = VRage.MyCompilationSymbols.ProfileWorkingSetMemory |
Definition at line 162 of file MyRenderProfiler.cs.
|
static |
Definition at line 172 of file MyRenderProfiler.cs.
const string VRage.Profiler.MyRenderProfiler.PerformanceProfilingSymbol = VRage.MyCompilationSymbols.PerformanceProfiling ? "WINDOWS" : "__RANDOM_UNDEFINED_PROFILING_SYMBOL__" |
Definition at line 129 of file MyRenderProfiler.cs.
|
static |
Definition at line 175 of file MyRenderProfiler.cs.
|
static |
Definition at line 228 of file MyRenderProfiler.cs.
|
staticget |
Definition at line 134 of file MyRenderProfiler.cs.
|
staticget |
Returns true when profiler is visible.
Definition at line 142 of file MyRenderProfiler.cs.
|
staticget |
Definition at line 217 of file MyRenderProfiler.cs.
|
staticgetset |
Definition at line 211 of file MyRenderProfiler.cs.