Stefanos A [Sun, 3 Nov 2013 19:35:02 +0000 (20:35 +0100)]
More PrimitiveType->BeginMode overrides
Stefanos A [Sun, 3 Nov 2013 19:34:18 +0000 (20:34 +0100)]
Mino fix in debug output
ParameterCollection.ToString() adds parentheses around its output, so
Delegate.ToString() should avoid adding a second pair.
Stefanos A [Sun, 3 Nov 2013 19:33:14 +0000 (20:33 +0100)]
ES 3.0 contains both 2.0 and 3.0 bindings
This is in accordance to the upstream gl3.h for ES 3.0.
Stefanos A [Sun, 3 Nov 2013 19:32:47 +0000 (20:32 +0100)]
gles1 API contains both versions 1.0 and 1.1
Khronos no longer distinguishes between ES 1.0 and 1.1.
Stefanos A [Sun, 3 Nov 2013 19:32:10 +0000 (20:32 +0100)]
Take api version into account
XmlSpecReader will now respect version attributes and will avoid
inserting foreign tokens into the generated bindings.
Stefanos A [Sun, 3 Nov 2013 19:30:43 +0000 (20:30 +0100)]
Maintain api version information on converted signatures
Signatures were split into 4 APIs before (gl, glcore, gles1, gles2).
However, gles2 contains bindings for both version 2.0 and 3.0. The
version information is now maintained, which allows us to cut down on
the number of generated enumerations.
Stefanos A [Sun, 3 Nov 2013 19:28:57 +0000 (20:28 +0100)]
Improve debug output
Function parameters are now displayed during binding generation.
Stefanos A. [Sun, 3 Nov 2013 18:13:49 +0000 (19:13 +0100)]
Merge categories for redefined functions
Now that we support function overloads, it is safe to ignore functions
that are defined multiple times. We just merge their Category
properties if they are not identical.
Stefanos A [Sun, 3 Nov 2013 16:58:28 +0000 (17:58 +0100)]
Improved detection of deprecated tokens
Stefanos A. [Sun, 3 Nov 2013 15:11:39 +0000 (16:11 +0100)]
Added PrimitiveType <=> BeginMode overloads
Khronos renamed BeginMode to PrimitiveType starting with GL 4.4.
OpenTK now has overloads for both flavors.
Stefanos A. [Sun, 3 Nov 2013 15:09:11 +0000 (16:09 +0100)]
Allow overloads of the same function
It is now possible to define multiple overloads of the same function,
each with different parameters. This is extremely useful for
maintaining backwards compatibility in the face of the changes between
GL 4.3 and 4.4.
Stefanos A [Sun, 3 Nov 2013 11:43:50 +0000 (12:43 +0100)]
Updated to the latest gl4 specs and docs
Large code-drop from Khronos upstream.
Stefanos A [Sun, 3 Nov 2013 11:37:56 +0000 (12:37 +0100)]
Change debug commandline
The default commandline parameters will now automatically download and
convert the upstream gl.xml from the public Khronos repository.
Stefanos A [Sun, 3 Nov 2013 11:34:19 +0000 (12:34 +0100)]
Bindings for GL4.4, ES1.1, ES2.0 and ES3.0
The new bindings are based on the fresh gl.xml registry by the Khronos
group.
Stefanos A [Sun, 3 Nov 2013 11:33:17 +0000 (12:33 +0100)]
Added DebugProc for KHR_debug
Stefanos A [Sun, 3 Nov 2013 11:32:54 +0000 (12:32 +0100)]
Updated using the latest converter
Tokens are now sorted according to their value, exactly is in the
upstream gl.xml spec. Additionally, gles1 and gles2 now include the
pre-defined groups in the specification.
Stefanos A [Sun, 3 Nov 2013 11:19:49 +0000 (12:19 +0100)]
Enum groups are now added to all APIs
Enum groups are also referenced by OpenGL ES commands. They are now
added to all APIs by default.
Stefanos A. [Sun, 3 Nov 2013 11:17:09 +0000 (12:17 +0100)]
Trim elements when reading them
Sometimes elements in overrides.xml contain extra spaces due to typos,
which are quite difficult to track down. The XmlSpecReader can now
cope with that.
Stefanos A. [Sun, 3 Nov 2013 11:16:07 +0000 (12:16 +0100)]
Replace in-place instead of removing/readding
There is no reason to remove and readd a Constant in order to replace
it in a ConstantCollection. We can actually do that in-place.
Stefanos A. [Sun, 3 Nov 2013 11:15:08 +0000 (12:15 +0100)]
Enum tokens are now sorted
This only affects the in-memory representation - sorted tokens are
easier to debug.
Stefanos A. [Sun, 3 Nov 2013 11:14:13 +0000 (12:14 +0100)]
Use OpenTK.Graphics.OpenGL4 namespace for GL4.x
Stefanos A. [Sun, 3 Nov 2013 11:13:35 +0000 (12:13 +0100)]
DefaultOutputPath now matches OpenTK source tree
By default, generated bindings are placed in the source tree of
OpenTK. This can be overriden via a commandline switch.
Stefanos A. [Sun, 3 Nov 2013 11:12:39 +0000 (12:12 +0100)]
Improved debug output on high-order pointers
OpenTK does not currently support generating bindings for pointers of
order 3 or higher. No OpenGL or OpenGL ES API currently uses such
pointers, so we just issue a warning message if such an API is
encountered in the future.
Stefanos A. [Sun, 3 Nov 2013 11:10:52 +0000 (12:10 +0100)]
Added missing enums to gles2 profile
Fixed undefined reference in TextureCompareMode.COMPARE_REF_TO_TEXTURE
and added strongly-typed enums for KHR_debug.
Stefanos A. [Sun, 3 Nov 2013 01:25:15 +0000 (02:25 +0100)]
Corrected ShaderSource for gles2 and ARB
The length parameter should be an array of integers, one for each
string in the shader source. The string parameter does not need to be
translated.
Stefanos A. [Sun, 3 Nov 2013 00:44:31 +0000 (01:44 +0100)]
Added doc comment on ColorFormat.Empty.
Stefanos A [Sun, 3 Nov 2013 00:38:38 +0000 (01:38 +0100)]
Aligned release and debug configurations
Now release and debug configurations will build the same projects.
Stefanos A [Sun, 3 Nov 2013 00:29:32 +0000 (01:29 +0100)]
Added generators for ES 2.0 and 3.0
Stefanos A [Sun, 3 Nov 2013 00:28:46 +0000 (01:28 +0100)]
Updated license information
Stefanos A [Sun, 3 Nov 2013 00:28:01 +0000 (01:28 +0100)]
Cleaned up the generator constructors
Stefanos A [Sun, 3 Nov 2013 00:27:33 +0000 (01:27 +0100)]
Added missing newline
Methods are now separated by a single newline.
Stefanos A [Sun, 3 Nov 2013 00:27:10 +0000 (01:27 +0100)]
Do not override user defined output files
The generator will now change the default output files to match its
bindings (e.g. GL vs ES), but the user is now able to override this
option.
Stefanos A [Sun, 3 Nov 2013 00:25:47 +0000 (01:25 +0100)]
Added apiversion support
Stefanos A [Sun, 3 Nov 2013 00:25:27 +0000 (01:25 +0100)]
Added support for overriding default output files
This makes it possible to generate different output files when using
-mode:all to generate multiple bindings in the same run.
Stefanos A [Sun, 3 Nov 2013 00:24:31 +0000 (01:24 +0100)]
Added gles2; added missing fog groups
Stefanos A [Sun, 3 Nov 2013 00:24:02 +0000 (01:24 +0100)]
Added support for distinguishing between api versions
The registry reuses the "gles2" apiname for both OpenGL ES 2.0 and 3.0.
The generator will now use the apiversion attribute to distinguish
between the two APIs.
Stefanos A [Sun, 3 Nov 2013 00:22:44 +0000 (01:22 +0100)]
Convert "String *" to "String"
As a sideeffect of the group element definition, the parser will
convert a ptype of "const GLubyte *" with a group of "String" to
"String *", which is not the correct result. GLXmlParser will now
detect and fix this condition that affects the GetString function of
families.
Stefanos A [Sun, 3 Nov 2013 00:20:17 +0000 (01:20 +0100)]
Added GetOverridesPath method
GetOverridesPath encapsulates the code that retrieves an override enum
or function from overrides.xml. Additionally, it now supports names and
extensions with multiple values (e.g. extension="Core|Ext").
Stefanos A. [Sat, 2 Nov 2013 22:40:09 +0000 (23:40 +0100)]
Mark signatures.xml version
GLXmlParser now explicitly marks its output with version="2", while
the older .spec parsers produce version="1" signatures. The binding
generator uses the newer API to support multiple apinames in the same
file.
Stefanos A. [Sat, 2 Nov 2013 22:37:34 +0000 (23:37 +0100)]
Refactor apiname extraction
A dedicated function is now used for getting the apiname of an enum or command element. This reduces code duplication.
Stefanos A. [Fri, 1 Nov 2013 13:00:46 +0000 (14:00 +0100)]
Fixed newline and indentation behavior
Mono and .Net have a few minor differences in their StreamWriter
implementations. Added workarounds to produce identical output on all
platforms.
Stefanos A. [Fri, 1 Nov 2013 10:42:42 +0000 (11:42 +0100)]
Fixed infinite recursion issue.
Stefanos A. [Fri, 1 Nov 2013 08:29:42 +0000 (09:29 +0100)]
Regenerated bindings with the latest generator
The new bindings have improved enum documentation and fix an issue with
incorrect overloads in wrappers with generic parameters.
Stefanos A. [Fri, 1 Nov 2013 08:28:54 +0000 (09:28 +0100)]
Avoid singletons; allow -mode:all
Explicit Settings objects are now created for each generator. A new
-mode:all option has been added, which generates bindings for all APIs
in one go (useful for the post-GL4.4 specs, which collect all APIs in a
single file.)
Stefanos A. [Fri, 1 Nov 2013 08:27:46 +0000 (09:27 +0100)]
Avoid singletons; collect code generation
ISpecWriter implementations must now store explicit references to a
Settings object. Additionally, all code generation is now handled inside
the ISpecWriter implementation (it used to be scattered over all Type,
Parameter, etc classes resulting in unmaintainable spaghetti code.)
Stefanos A. [Fri, 1 Nov 2013 08:26:13 +0000 (09:26 +0100)]
Avoid singletons
A reference to a Settings instance must now be stored explicitly.
Stefanos A. [Fri, 1 Nov 2013 08:25:31 +0000 (09:25 +0100)]
Updated IBind implementations to avoid singletons
IBind implementations must now store explicit references to Settings,
GLTypes and CSTypes instances. This allows us to use multiple
configurations in the same process.
Stefanos A. [Fri, 1 Nov 2013 08:24:18 +0000 (09:24 +0100)]
Avoid singletons; collect all translation logic
FuncProcessor now implements all translation logic for types, parameters
and functions. This used to be scattered in the various classes (Type,
Parameter, etc) resulting in a rather disgusting spaghetti. Code
generation has been removed from FuncProcessor and is now handled by the
various language-specific ISpecWriter backends.
Stefanos A. [Fri, 1 Nov 2013 08:21:50 +0000 (09:21 +0100)]
Avoid singletons; improve ToString()
This is part of a long-due series of source cleanup patches. ToString()
is no longer used for code generation (code generation is handled by an
ISpecWriter instance.) Enum is no longer public. EnumCollection now
exposes its backing store through an interface, rather than a concrete
class (simpler to change backing store in the future.)
Stefanos A. [Fri, 1 Nov 2013 08:18:53 +0000 (09:18 +0100)]
Avoid singletons; improved ToString()
This is part of a long-due series of source cleanup patches. ToString()
is no longer used for code generation (this is handled by an ISpecWriter
implementation). This class is no longer public.
Stefanos A. [Fri, 1 Nov 2013 08:17:34 +0000 (09:17 +0100)]
Avoid singletons; logic in FuncProcessor
This is part of a long-due series of source cleanup patches. All
translation logic is now part of FuncProcessor. Code generation is now
handled by an ISpecWriter implementation. Minor improvements to
IEquatable and ToString() implementations. Reduced the surface of the
public API.
Stefanos A. [Fri, 1 Nov 2013 08:15:02 +0000 (09:15 +0100)]
Avoid singletons; Move logic to FuncProcessor
This is part of a long-due cleanup patch series. All translation logic
is now part of the FuncProcessor. Language-specific code generation is
now part of the ISpecWriter, not the delegate class. Implemented the
IEquatable interface.
Stefanos A. [Fri, 1 Nov 2013 08:13:06 +0000 (09:13 +0100)]
Avoid singletons; Translate*() in FuncProcessor
This is part of a long-due source cleanup series. All Translate*()
methods are now part of the FuncProcessor. Additionally, ToString() has
been improved and the IEquatable interface is now implemented.
ParameterCollection now has better control of when its cache should be
rebuilt.
Stefanos A. [Fri, 1 Nov 2013 08:10:46 +0000 (09:10 +0100)]
Avoid singletons; Translate*() in FuncProcessor
This is part of a long-due source cleanup operation. GLTypes and CSTypes
are no longer global singletons, but must now be accessed through an
IBind instance. All Translate*() methods are now part of the
FuncProcessor. ToString() has been improved and the IEquatable interface
is now explicitly implemented.
Stefanos A. [Fri, 1 Nov 2013 08:07:34 +0000 (09:07 +0100)]
Settings is no longer a singleton
Multiple Settings instances can now be created and used in the same
process.
Stefanos A. [Fri, 1 Nov 2013 08:06:49 +0000 (09:06 +0100)]
Settings, GLTypes and CSTypes are now in IBind
Settings, GLTypes and CSTypes are no longer global singletons. Instead,
explicit instances must be stored in the IBind implementation. This
allows us to use multiple configurations in the same process.
Stefanos A. [Fri, 1 Nov 2013 08:03:36 +0000 (09:03 +0100)]
Avoid singleton Settings; make internal
Utilities.Keywords now accepts an explicit parameter, instead of
accessing Settings directly. This allows us to use multiple
configurations in the same process.
Additionally, the Utilities class is no longer public (the Bind project
is not meant to be consumed as a dll.)
Stefanos A. [Fri, 1 Nov 2013 08:01:35 +0000 (09:01 +0100)]
Avoid singleton Settings. Allow v1 signatures
A Settings object is now passed directly as a parameter, in order to
support different configurations in the same process. The XmlSpecReader
can now distinguish between, and support both, pre-GL4.4 and post-GL4.4
specs.
Stefanos A. [Fri, 1 Nov 2013 07:59:20 +0000 (08:59 +0100)]
Avoid using singletons
The IBind generator and the Settings class are now passed directly as
parameters. This allows us to run multiple generators in a single
process.
Stefanos A. [Fri, 1 Nov 2013 07:57:44 +0000 (08:57 +0100)]
Improved multiline output
This lets us compose and print multiline strings without manually
adjusting indentation on each line.
Stefanos A. [Wed, 30 Oct 2013 23:20:59 +0000 (00:20 +0100)]
Remove deprecated elements from glcore
Deprecated elements are marked as such in the compatibility profile and
are completely absent from the core profile. This is in-line with the
new glcore headers from Khronos.
Stefanos A. [Wed, 30 Oct 2013 23:20:05 +0000 (00:20 +0100)]
Warn on function redefinition
A function redefinition usually stems from a bug in the OpenGL specs, or
a bug in the spec converter. The binding generator now logs a warning,
instead of crashing, when a redefinition is encountered.
Stefanos A. [Wed, 30 Oct 2013 23:18:45 +0000 (00:18 +0100)]
Renamed gloverrides.xml to overrides.xml
This aligns the name of the OpenGL overrides file with that of the
OpenGL|ES implementations.
Stefanos A. [Wed, 30 Oct 2013 23:18:07 +0000 (00:18 +0100)]
Cleaned up Generator class tree
This significantly reduces the amount of duplicated code between
Generator implementations.
Stefanos A. [Tue, 29 Oct 2013 18:35:35 +0000 (19:35 +0100)]
Improve sorting; remove enum-function distinction
Both enums and functions are now stored under a single <add> element.
Their ordering is now maintained by sorting over all possible
attributes.
Stefanos A. [Tue, 29 Oct 2013 08:32:28 +0000 (09:32 +0100)]
Corrected apiname xpath lookup
Stefanos A. [Tue, 29 Oct 2013 08:32:09 +0000 (09:32 +0100)]
Explicitly merge functions
Some functions are part of multiple features or extensions. For
documentation purposes, we need to correctly merge their attributes.
Stefanos A. [Mon, 28 Oct 2013 13:28:57 +0000 (14:28 +0100)]
More line ending troubles...
Stefanos A. [Mon, 28 Oct 2013 13:15:58 +0000 (14:15 +0100)]
Allow comparison of function elements
This allows us to store both enums and functions in the same tree.
Stefanos A. [Mon, 28 Oct 2013 13:15:17 +0000 (14:15 +0100)]
Stable sort and correct extension names
Use a stable sort for generated elements, in order to make the generated
file work better with version control. Extension names are now extracted
directly from function names - solves issues with functions that are
defined in multiple extensions.
Stefanos A [Mon, 28 Oct 2013 13:12:23 +0000 (14:12 +0100)]
Add apiname parameter to ISpecReader
This allows us to reuse the same ISpecReader implementation to parse
different APIs (GL and GLES).
Stefanos A. [Mon, 28 Oct 2013 13:11:16 +0000 (14:11 +0100)]
Re-added PixelInternalFormat
GL4.4 renamed PixelInternalFormat to InternalFormat. The missing tokens
are now re-added, since a lot of functions depend on them. Additionally,
a number of 'open' <use> elements now define a specific enum reference.
This is not necessary, but is good for documentation purposes.
Stefanos A. [Mon, 28 Oct 2013 13:08:55 +0000 (14:08 +0100)]
Sort tokens within an enum
This allows us to keep a specific ordering regardless of the token order
in the input file (much friendlier for source control!)
Stefanos A. [Mon, 28 Oct 2013 13:07:45 +0000 (14:07 +0100)]
Simplifed Constant.Reference resolution
Instead of recursing, we use a simple do..while loop to resolve the
transitive reference of a constant. If there is a loop at any point, we
stop and use a brute force search over all tokens. If this still fails
to resolve the reference, then we report this reference as unresolved.
Stefanos A. [Sun, 27 Oct 2013 22:47:52 +0000 (23:47 +0100)]
Multi-API support for XML spec parser
The XML spec parser now generates signatures for multiple APIs (gl,
glcore, gles1, gles2). Additionally, it supports per-token deprecation
attributes.
Stefanos A. [Sun, 27 Oct 2013 16:35:36 +0000 (17:35 +0100)]
Made IsFlagsCollection read-write
The decision whether an Enum is a flags collection is now made either by
the spec reader or the enum processor (not the Enum class itself.)
Stefanos A. [Sun, 27 Oct 2013 00:35:53 +0000 (02:35 +0200)]
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).
Stefanos A. [Sat, 26 Oct 2013 23:32:08 +0000 (01:32 +0200)]
Fixed the DebugProc signatures.
The various DebugProc* delegates now conform to their specifications.
Stefanos A. [Sat, 26 Oct 2013 23:31:20 +0000 (01:31 +0200)]
Regenerated using latest generator.
Stefanos A. [Sat, 26 Oct 2013 23:30:45 +0000 (01:30 +0200)]
Moved more transformations into the *Processor classes.
An EnumProcessor or FuncProcessor instance is now required in order to
call their Translate*() methods. A number of transformations that
relied on calling the static methods have now been moved inside the
processor classes.
Stefanos A [Sat, 26 Oct 2013 23:25:29 +0000 (01:25 +0200)]
Read extension list from xml spec; new acronyms.
Instead of hardcoding a list of extensions, extensions are now read
directly from the signatures.xml file. Acronyms for new texture
formats are now listed.
Stefanos A. [Sat, 26 Oct 2013 23:24:04 +0000 (01:24 +0200)]
Improved extension detection in .spec parser.
Instead of using a hardcoded list of extensions, the parser will now
use a regex to detect extension names. This gives better results on
new specs without manual editing.
Stefanos A. [Fri, 25 Oct 2013 22:07:49 +0000 (00:07 +0200)]
Functions are now categorized correctly according to their extensions.
Stefanos A. [Fri, 25 Oct 2013 22:07:00 +0000 (00:07 +0200)]
Fixed the parsing of extensions.
Stefanos A. [Fri, 25 Oct 2013 14:43:43 +0000 (16:43 +0200)]
MASK_COHERENT_BIT should be MAP_COHERENT_BIT
Stefanos A. [Fri, 25 Oct 2013 14:31:26 +0000 (16:31 +0200)]
Trim the final endline regardless of operating system.
Fixes differences between bindings generated on Windows and Linux/Mac.
Stefanos A. [Fri, 25 Oct 2013 14:30:50 +0000 (16:30 +0200)]
The last parameter of GL.ShaderSource should be an array.
Stefanos A. [Fri, 25 Oct 2013 14:30:20 +0000 (16:30 +0200)]
Fixed ShaderSource and VertexArrayFogCoordOffsetEXT parameters.
ShaderSource is supposed to accept an array of string lengths as the
last parameter. The count="1" statement in the registry is wrong.
GL.VertexArrayFogCoordOffsetEXT is supposed to receive a
FogPointerType.
Stefanos A. [Fri, 25 Oct 2013 14:10:51 +0000 (16:10 +0200)]
Corrected the values of the GL_NEXT_BUFFER_NV and
GL_SKIP_COMPONENTS_*_NV extensions.
Stefanos A. [Fri, 25 Oct 2013 06:57:33 +0000 (08:57 +0200)]
Check the existence of a Constant reference using the
Constant.Reference property, instead of the first character of
Constant.Value. Fixes values that are negative numbers.
Stefanos A. [Fri, 25 Oct 2013 06:55:12 +0000 (08:55 +0200)]
Strip struct and const identifiers from the output. This matches the
old .spec files.
Group attributes in parameters no longer overwrite the pointer order
or const-ness of the parameter.
Stefanos A. [Fri, 25 Oct 2013 06:52:34 +0000 (08:52 +0200)]
Allow spaces in pointer types (e.g. "GLchar * *").
Added todo for string->String translation that is overwritten
immediately.
Stefanos A. [Fri, 25 Oct 2013 06:48:24 +0000 (08:48 +0200)]
Fixed translation of GLchar** (should be string[], not string). Added
diagnostic message in case of higher-order pointer parameters that
will currently generate incorrect bindings.
Stefanos A. [Fri, 25 Oct 2013 06:47:17 +0000 (08:47 +0200)]
Added DEBUGPROCKHR for the KHR_debug extension. Added
CompressedTextureARB that is encountered in the new gl.xml registry.
Stefanos A. [Fri, 25 Oct 2013 06:45:02 +0000 (08:45 +0200)]
Fixed implementation of IsValue. Improved the handling of value
(number) parameters.
Stefanos A. [Thu, 24 Oct 2013 20:42:12 +0000 (22:42 +0200)]
Added support for overriding the element count of an array parameter.
Stefanos A. [Thu, 24 Oct 2013 18:56:28 +0000 (20:56 +0200)]
Improved grouping of enumerations. Fixed missing extension
enumerations.
Stefanos A [Thu, 24 Oct 2013 16:49:38 +0000 (18:49 +0200)]
Don't crash on non-numeric element counts.
Stefanos A. [Thu, 24 Oct 2013 16:46:58 +0000 (18:46 +0200)]
Improved diagnostic message in case of a circular definition.
Stefanos A. [Thu, 24 Oct 2013 16:42:52 +0000 (18:42 +0200)]
Return type should be defined in the "type" attribute of the returns
element.