Improve override lookup for extension functions.

Function overrides are now looked up in the following order: specific
name (e.g. ProgramParameteriARB), extensionless name (e.g.
ProgramParameteri) and generic mame (e.g. ProgramParameter). This
improves the override resolution for functions with multiple extension
forms (core, ext, arb, etc).
This commit is contained in:
Stefanos A. 2013-10-27 02:35:53 +02:00
parent 816f1e5c7f
commit 2444ccf082
5 changed files with 17 additions and 15 deletions

View file

@ -140,11 +140,13 @@ namespace Bind
static XPathNavigator GetFuncOverride(XPathNavigator nav, Delegate d)
{
string trimmed_name = GetTrimmedName(d);
string ext = d.Extension;
string trimmed_name = GetTrimmedName(d);
string extensionless_name = GetTrimmedExtension(d.Name, ext);
var function_override =
nav.SelectSingleNode(String.Format(Path, d.Name, ext)) ??
nav.SelectSingleNode(String.Format(Path, extensionless_name, ext)) ??
nav.SelectSingleNode(String.Format(Path, trimmed_name, ext));
return function_override;
}

View file

@ -21695,13 +21695,13 @@ namespace OpenTK.Graphics.OpenGL
/// </param>
[AutoGenerated(Category = "ARB_geometry_shader4", Version = "3.0", EntryPoint = "glProgramParameteriARB")]
public static
void ProgramParameter(Int32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value)
void ProgramParameter(Int32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glProgramParameteriARB((UInt32)program, (OpenTK.Graphics.OpenGL.ProgramParameterPName)pname, (Int32)value);
Delegates.glProgramParameteriARB((UInt32)program, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)pname, (Int32)value);
#if DEBUG
}
#endif
@ -21729,13 +21729,13 @@ namespace OpenTK.Graphics.OpenGL
[System.CLSCompliant(false)]
[AutoGenerated(Category = "ARB_geometry_shader4", Version = "3.0", EntryPoint = "glProgramParameteriARB")]
public static
void ProgramParameter(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value)
void ProgramParameter(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glProgramParameteriARB((UInt32)program, (OpenTK.Graphics.OpenGL.ProgramParameterPName)pname, (Int32)value);
Delegates.glProgramParameteriARB((UInt32)program, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)pname, (Int32)value);
#if DEBUG
}
#endif
@ -150080,13 +150080,13 @@ namespace OpenTK.Graphics.OpenGL
/// </param>
[AutoGenerated(Category = "EXT_geometry_shader4", Version = "2.0", EntryPoint = "glProgramParameteriEXT")]
public static
void ProgramParameter(Int32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value)
void ProgramParameter(Int32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glProgramParameteriEXT((UInt32)program, (OpenTK.Graphics.OpenGL.ProgramParameterPName)pname, (Int32)value);
Delegates.glProgramParameteriEXT((UInt32)program, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)pname, (Int32)value);
#if DEBUG
}
#endif
@ -150114,13 +150114,13 @@ namespace OpenTK.Graphics.OpenGL
[System.CLSCompliant(false)]
[AutoGenerated(Category = "EXT_geometry_shader4", Version = "2.0", EntryPoint = "glProgramParameteriEXT")]
public static
void ProgramParameter(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value)
void ProgramParameter(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value)
{
#if DEBUG
using (new ErrorHelper(GraphicsContext.CurrentContext))
{
#endif
Delegates.glProgramParameteriEXT((UInt32)program, (OpenTK.Graphics.OpenGL.ProgramParameterPName)pname, (Int32)value);
Delegates.glProgramParameteriEXT((UInt32)program, (OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb)pname, (Int32)value);
#if DEBUG
}
#endif

View file

@ -4535,10 +4535,10 @@ namespace OpenTK.Graphics.OpenGL
internal extern static void ProgramParameteri(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glProgramParameteriARB", ExactSpelling = true)]
internal extern static void ProgramParameteriARB(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
internal extern static void ProgramParameteriARB(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glProgramParameteriEXT", ExactSpelling = true)]
internal extern static void ProgramParameteriEXT(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
internal extern static void ProgramParameteriEXT(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value);
[System.Security.SuppressUnmanagedCodeSecurity()]
[System.Runtime.InteropServices.DllImport(GL.Library, EntryPoint = "glProgramParameters4dvNV", ExactSpelling = true)]
internal extern static unsafe void ProgramParameters4dvNV(OpenTK.Graphics.OpenGL.AssemblyProgramTargetArb target, UInt32 index, Int32 count, Double* v);

View file

@ -4533,10 +4533,10 @@ namespace OpenTK.Graphics.OpenGL
internal delegate void ProgramParameteri(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
internal static ProgramParameteri glProgramParameteri;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void ProgramParameteriARB(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
internal delegate void ProgramParameteriARB(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value);
internal static ProgramParameteriARB glProgramParameteriARB;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal delegate void ProgramParameteriEXT(UInt32 program, OpenTK.Graphics.OpenGL.ProgramParameterPName pname, Int32 value);
internal delegate void ProgramParameteriEXT(UInt32 program, OpenTK.Graphics.OpenGL.AssemblyProgramParameterArb pname, Int32 value);
internal static ProgramParameteriEXT glProgramParameteriEXT;
[System.Security.SuppressUnmanagedCodeSecurity()]
internal unsafe delegate void ProgramParameters4dvNV(OpenTK.Graphics.OpenGL.AssemblyProgramTargetArb target, UInt32 index, Int32 count, Double* v);

View file

@ -27416,7 +27416,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.Arb.GetProgram, GL.Arb.GetProgramString, GL.NV.GetProgramParameter, GL.NV.GetTrackMatrix
/// Used in GL.Arb.GetProgram, GL.Arb.GetProgramString, GL.Arb.ProgramParameter, GL.Ext.ProgramParameter, GL.NV.GetProgramParameter, GL.NV.GetTrackMatrix
/// </summary>
public enum AssemblyProgramParameterArb : int
{
@ -49118,7 +49118,7 @@ namespace OpenTK.Graphics.OpenGL
}
/// <summary>
/// Used in GL.Arb.ProgramParameter, GL.ProgramParameter, GL.Ext.ProgramParameter
/// Used in GL.ProgramParameter
/// </summary>
public enum ProgramParameterPName : int
{