mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 07:55:42 +00:00
Added timing information in GL.LoadAll()
This commit is contained in:
parent
58bad52607
commit
dfaaaf582f
|
@ -202,19 +202,10 @@ namespace OpenTK.OpenGL
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static Delegate GetDelegate(string name, Type signature)
|
public static Delegate GetDelegate(string name, Type signature)
|
||||||
{
|
{
|
||||||
Delegate d;
|
MethodInfo m = importsClass.GetMethod(name.Substring(2), BindingFlags.Static | BindingFlags.NonPublic);
|
||||||
|
return
|
||||||
if (importsClass.GetMethod(name.Substring(2), BindingFlags.NonPublic | BindingFlags.Static) != null)
|
Utilities.GetExtensionDelegate(name, signature) ??
|
||||||
{
|
(m != null ? Delegate.CreateDelegate(signature, m) : null);
|
||||||
d = Utilities.GetExtensionDelegate(name, signature) ??
|
|
||||||
Delegate.CreateDelegate(signature, typeof(Imports), name.Substring(2));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
d = Utilities.GetExtensionDelegate(name, signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
return d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -237,10 +228,14 @@ namespace OpenTK.OpenGL
|
||||||
public static void LoadAll()
|
public static void LoadAll()
|
||||||
{
|
{
|
||||||
FieldInfo[] v = delegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
|
FieldInfo[] v = delegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
|
||||||
|
|
||||||
int supported = 0;
|
int supported = 0;
|
||||||
|
|
||||||
Debug.Print("Will now try to load all {0} opengl functions.", v.Length);
|
Debug.Print("Will now try to load all {0} opengl functions.", v.Length);
|
||||||
|
|
||||||
|
System.Diagnostics.Stopwatch time = new System.Diagnostics.Stopwatch();
|
||||||
|
time.Reset();
|
||||||
|
time.Start();
|
||||||
|
|
||||||
foreach (FieldInfo f in v)
|
foreach (FieldInfo f in v)
|
||||||
{
|
{
|
||||||
Delegate d = GetDelegate(f.Name, f.FieldType);
|
Delegate d = GetDelegate(f.Name, f.FieldType);
|
||||||
|
@ -251,7 +246,11 @@ namespace OpenTK.OpenGL
|
||||||
|
|
||||||
f.SetValue(null, d);
|
f.SetValue(null, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Stop();
|
||||||
|
Trace.WriteLine(String.Format("OpenGL extensions loaded in {0} milliseconds.", time.ElapsedMilliseconds));
|
||||||
Debug.Print("Total supported functions: {0}.", supported);
|
Debug.Print("Total supported functions: {0}.", supported);
|
||||||
|
time.Reset();
|
||||||
|
|
||||||
AvailableExtensions.Clear();
|
AvailableExtensions.Clear();
|
||||||
rebuildExtensionList = true;
|
rebuildExtensionList = true;
|
||||||
|
|
Loading…
Reference in a new issue