Improve the parsing of the <proto> XML element
Include all text from the param element, in the order it appears in the xml
document, as part of the formal parameter declaration
This is needed to correctly handle the XML description added in svn r27498 of
glPathGlyphIndexRangeNV()'s baseAndCount parameter of type GLuint[2]
This fixes the way the parameter declaration is generated so it is in the
correct form 'GLuint baseAndCount_[2]' and not 'GLuint baseAndCount[2]_'
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Factor out duplicated code used in parsing of the <proto> XML element in the
code generator
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This fixes a problem when using Khronos registry data since the change of
2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to
GL_ARB_imaging.
If shim generation considers all features, no shims are generated for
glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore as
shims are only generated for GL version <=1.2), then emission for GL_ARB_imaging
is skipped as they have already been emitted.
Also improve feature name matching so it is exact, not on an initial substring,
so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc'
aren't matched by 'GL_ARB_texture_compression'.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Just generate the WGL wrappers we need, rather than for everything in wgl.xml
This avoids generating a lot of unused wrappers, and also avoids compilation
requiring a wglext.h at least as new as wgl.xml
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
v1: Rewrite by Marc Haesen of the WGL wrapper function generation script to use
Khronos group XML.
v2: Remove -dispatchheader option, since dispatch.h doesn't exist anymore, use
the private glapi interface to construct the GL dispatch table for the native
WGL thunks.
v3:
Rewrite to generate shims for the OpenGL 1.2.1 (GL 1.2 + GL_ARB_imaging
+GL_ARB_multitexture + GL_ARB_texture_compression(?)) functions the server links
directly with rather than libGL.
These shims dispatch to either the mesa GL DLL, or a thunking DLL containing
cdecl-to-stcall wrapper functions for the native GL DLL.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Fix some of the warnings in generated gl wrapper code:
- glWinResolveHelper takes a const char * argument
- ensure formal parameter names don't collide with reserved names or shadow
global declarations (e.g. near, far, index (from string.h), remainder (from
math.h), pointer (from Xdefs.h) by postpending a '_'.
generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *'
[repeated many times]
generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow]
generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
[repeated many times]
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix the code generator for the dispatch table initialization after
the whitespace/coding style changes to glx/dispatch.h
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Create a new dispatch table rather than modifying the existing one
struct _glapi_table is not a complete type after including glapi.h, so we use
glapi_get_dispatch_table_size() to determine it's size (alternatively, we could
include glapitable.h, to complete the type)
This could possibly be written to use _glapi_create_table_from_handle() instead, but
that requires making all the wrapper functions exports
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Add a suitable cast to the generated code for glWinSetupDispatchTable()
so it doesn't generate screeds of warnings
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
A rewrite of the XWin DDX AIGLX code to actually make it do something useful again
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>