Commit Graph

27 Commits

Author SHA1 Message Date
Eric Engestrom f1eae2f8bb python: drop python2 support
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
2021-08-14 21:44:32 +00:00
Jesse Natalie 92f1b6bad5 glapi: Undefine MemoryBarrier
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8661>
2021-01-28 18:35:13 +00:00
Dylan Baker 8e3696137f remove final imports.h and imports.c bits
This moves the fi_types to a new mesa_private.h and removes the
imports.c file. The vast majority of this patch is just removing
pound includes of imports.h and fixing up the recursive includes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
2020-04-21 11:09:04 -07:00
Marek Olšák e5339fe4a4 Move compiler.h and imports.h/c from src/mesa/main into src/util
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
2020-03-27 21:00:09 +00:00
Mathieu Bridon 0f7b18fa0d python: Use the print function
In Python 2, `print` was a statement, but it became a function in
Python 3.

Using print functions everywhere makes the script compatible with Python
versions >= 2.6, including Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-06 10:04:22 -07:00
Emil Velikov c7616ac069 gl_table.py: add extern C guard for the generated glapitable.h
The header can be included from C++, hence contents should have
appropriate notation.

Cc: mesa-stable@lists.freedesktop.org
Cc: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-11-27 19:23:05 +00:00
Emil Velikov edb7165b25 gl_table.py: always regenerate the complete struct _glapi_table
Currently we would generate a partial one as we do non-shared glapi.
At the same time since it's local, we don't care that much if we have a
few extra bytes of space in the table.

Drop the guard, which allows us to simplify both build system and code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-04 18:12:07 +01:00
Emil Velikov 68c38b2431 mapi/gen: remove shebang from python scripts
All of those should be executed $PYTHON2/python2 [or equivalent] hence
why they are missing the execute bit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-10 14:12:47 +00:00
Emil Velikov ec16bb62ac glapi: gl_table.py: remove unused variable 'es'
None of the three build systems ever set it, as such we can clear things
up a bit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-06-23 16:56:50 +01:00
Jose Fonseca b787f48ed2 glapi: Avoid argparse type argument for API XML input files.
argparse type is a nice type saver for simple data types, but it doesn't
look a good fit for the input XML file:

- Certain implementations of argparse (particularly python 2.7.3's)
  invoke the type constructor for the default argument even when an
  option is passed in the command line.  Causing `No such file or
  directory: 'gl_API.xml'` when the current dir is not
  src/mapi/glapi/gen.

- The parser takes multiple arguments.  This is currently worked around
  using lambdas, but that unnecessarily complex and hard to read.
  Furthermore it's odd to have a side-effect as heavy as parsing XML
  happening deep inside the argument parsing.

https://bugs.freedesktop.org/show_bug.cgi?id=90600

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-05-26 15:26:03 +01:00
Dylan Baker cf718cc964 glapi: gl_table.py: replace getopt with argparse.
This results in slightly less code, but code that is much more readable.
It has the advantage of putting everything together in one place, all of
the code is self documenting, help messages are auto-generated, choices
are automatically enforced, and the syntax is much less C like, taking
advantage of python features and idioms.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2015-05-22 11:31:27 -07:00
Dylan Baker b6298c7a71 glapi: gl_table.py: Fix some low hanging style issues
Making the tools shut up about worthless errors so you can see real ones
is very useful

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2015-05-22 11:31:27 -07:00
Brian Paul c6e00b6f6c glapi: no longer emit #include "mfeatures.h" in generated files
None of the symbols in mfeatures.h are used anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-17 17:33:40 -06:00
Brian Paul 0bcced7716 glapi: remove FEATURE_remap_table test (it's always defined)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-04-17 17:33:39 -06:00
Paul Berry e378cd77bc glapi: Use GLES information from XML rather than gles_api.py.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry 99802519b4 glapi: Reformat python code generation scripts to use 4-space indentation.
This brings us into accordance with the official Python style guide
(http://www.python.org/dev/peps/pep-0008/#indentation).

To preserve the indentation of the c code that is generated by these
scripts, I've avoided re-indenting triple-quoted strings (unless those
strings appear to be docstrings).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-10 11:19:14 -07:00
Ian Romanick d9f899bb93 glapi: Prevent accidental use of lies w/shared-glapi
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick af50f3bf44 glapi/glx: Generate dispatch.h so that the xserver can use it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Brian Paul 919c835835 glapi: s/INLINE/inline/ for dispatch.h file 2011-11-30 06:57:36 -07:00
Chia-I Wu 5076561b35 glapi: use gl_and_es_API.xml to generate GLES headers
glapi/gen-es/ defines two sets of GLAPI XMLs for OpenGL ES 1.1
(es1_API.xml) and 2.0 (es2_API.xml) respectively.  They are used to
generate dispatch.h and remap_helper.h for GLES.  Together with
gl_and_es_API.xml, we have to maintain three sets of GLAPI XMLs.

This commit makes dispatch.h and remap_helper.h for GLES be generated
from gl_and_es_API.xml.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:57 +08:00
Chia-I Wu 4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Thierry Reding 5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
José Fonseca 075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
Chia-I Wu 07b85457d9 glapi: Merge glapioffsets.h into glapidispath.h.
Move defines in glapioffsets.h to glapidispatch.h.  Rename
_gloffset_FIRST_DYNAMIC to _gloffset_COUNT, which is equal to the number
of entries in _glapi_table.

Consistently use SET_by_offset, GET_by_offset, CALL_by_offset, and
_gloffset_* to recursively define all SET/GET/CALL macros.
2010-10-27 11:07:29 +08:00
Chia-I Wu 296adbd545 glapi: Move to src/mapi/.
Move glapi to src/mapi/{glapi,es1api,es2api}.
2010-05-07 10:41:11 +08:00
Renamed from src/mesa/glapi/gen/gl_table.py (Browse further)