Commit Graph

1452 Commits

Author SHA1 Message Date
Marek Olšák b5c58bbf6c glthread: add support for glCallLists, glPatchParameterfv
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 1668a93903 glthread: add support for glClearNamedFramebuffer, glMaterial, glPointParameter
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák b0a20e7531 glthread: add support for glFog, glLight, glLightModel, glTexEnv, glTexGen
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 59e96bc513 glthread: add support for TexParameteri and SamplerParameteri functions
It's straightfoward except that I had to hack the python scripts to add
"marshal_count", which behaves just like "count" except that "variable_param"
is ignored. ("variable_param" changes the behavior of "count", which I don't
want)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 108fdb54c6 glthread: replace custom ClearBuffer marshalling with generated one
If the count attribute contains "enum", the count is evaluated only once.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 88b5fb18b3 glthread: check the size of all variable params and clean up the code
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 358d923c8b glthread: handle complex pointer parameters and support GL functions with strings
The python changes add a local variable that computes the parameter size
only once.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák d00f36ac25 glthread: add/update count and marshal fields for many GL functions
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák fb95a4693f glthread: add GL_DRAW_INDIRECT_BUFFER tracking and generator support
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 30b6e82364 glthread: don't increment variable_data if it's the last variable-size param
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 19dc528bbf glthread: don't insert _mesa_post_marshal_hook into every function
Let the developer decide that in the python script.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák c920572f60 glthread: simplify repeated function sequences in marshal_generated.c
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 9dbf5ec9f7 glthread: use int instead of size_t where it's OK
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 19151e2605 glthread: inline _mesa_unmarshal_dispatch_cmd and convert the switch to a table
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák 245f9593b7 glthread: don't prefix variable_data with const
Not all variable data that is constant is declared with const, such as
glDeletePerfMonitorsAMD.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:14 +00:00
Marek Olšák d93f4faefb glthread: don't generate the sync fallback if the call size is not variable
marshal_generated.c is 12% smaller.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
2020-03-06 01:06:13 +00:00
Indrajit Kumar Das 18124d7278 glapi/copyimage: Implement CopyImageSubDataNV
Implement CopyImageSubDataNV from NV_copy_image spec.
This is derived out of the existing implementation of CopyImageSubData.
It differs from CopyImageSubData in accordance with the differences
laid down in the ARB_copy_image spec.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3649>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3649>
2020-02-24 16:31:06 +00:00
Gurchetan Singh b68ff2b873 glapi / teximage: implement EGLImageTargetTexStorageEXT
Check various parts of the EXT_EGL_image_storage spec, and add a
new vfunc for drivers implementing it.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2020-01-13 14:57:18 -08:00
Tapani Pälli 5d58fea660 mapi: add GetInteger64vEXT with EXT_disjoint_timer_query
From EXT_disjoint_timer_query spec:

   "Interaction: This extension adds GetInteger64vEXT if
    OpenGL ES 3.0 is not supported"

See https://github.com/KhronosGroup/OpenGL-Registry/issues/326.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-26 07:41:24 +02:00
Markus Wick f4c61d422d mesa/glthread: Implement ARB_multi_bind.
Signed-off-by: Markus Wick <markus@selfnet.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-22 15:29:07 -05:00
Markus Wick b1156ecdf2 mapi/glapi: Generate sizeof() helpers instead of fixed sizes.
Generating a source code with a fixed size leads to issues with plattform dependent types.
We either hard code 4 or 8 bytes there, and both are wrong on the other plattform.
So this patch solves this issue by generating eg sizeof(GLsizeiptr), which is valid both
on 32 and on 64 bit plattforms.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-11-21 22:52:55 -05:00
Timothy Arceri 906f1a2933 mesa: add ARB_shading_language_include stubs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
2019-11-20 05:05:55 +00:00
Pierre-Eric Pelloux-Prayer 1ef297645c mesa: add ARB_sparse_buffer NamedBufferPageCommitmentEXT function
The spec is unclear on how to handle the buffer argument so we reuse
the logic from the EXT_direct_state_access spec.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer 8b6d19413f mesa: add ARB_vertex_attrib_binding glVertexArray* functions
We can't simply alias ARB_direct_state_access functions because
those fail if the vao has never been bound before.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer bb2241bf06 mesa: implement ARB_texture_storage_multisample + EXT_dsa functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer a0d667036d mesa: add ARB_texture_buffer_range glTextureBufferRangeEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer b78e2a197a mesa: add ARB_instanced_arrays EXT_dsa function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer a807b8c0a8 mesa: add ARB_gpu_shader_fp64 selector-less functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer e3385eb0c1 mesa: add ARB_clear_buffer_object named functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:45 +01:00
Pierre-Eric Pelloux-Prayer 442fd3d007 mesa: add ARB_vertex_attrib_64bit VertexArrayVertexAttribLOffsetEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:44 +01:00
Pierre-Eric Pelloux-Prayer 8cfb3e4ee5 mesa: add ARB_framebuffer_no_attachments named functions
The wording in ARB_framebuffer_no_attachments and EXT_direct_state_access
is different.
In the former framebuffer names must have been generated using glGenFramebuffers
before using the named functions.
In the latter framebuffer names have no such constraints, so we can't use
the _mesa_lookup_framebuffer_dsa function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-19 08:49:44 +01:00
Eric Engestrom 2f652e0b36 meson: move the generic symbols check arguments to a common variable
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviwed-by: Dylan Baker <dylan@pnwbakers>
2019-11-05 20:30:47 +00:00
Eric Engestrom 2c4395e61c meson: add variable to control the symbols checks
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviwed-by: Dylan Baker <dylan@pnwbakers>
2019-11-05 20:12:32 +00:00
Dylan Baker ee4f1bc187 util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIAN
As requested by Tim.

This was generated with:
grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g

v2: - add this patch

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05 16:39:55 +00:00
Dylan Baker f9f60da813 util/u_endian: set PIPE_ARCH_*_ENDIAN to 1
This will allow it to be used as a drop in replacement for
_mesa_little_endian in a number of cases.

v2: - Always define PIPE_ARCH_LITTLE_ENDIAN and PIPE_ARCH_BIG_ENDIAN,
      define the one that reflects the host system to 1 and the other to 0
    - replace all uses of #ifdef, #ifndef, and #if defined() with #if
      and #if ! with PIPE_ARCH_*_ENDIAN

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05 16:39:55 +00:00
Pierre-Eric Pelloux-Prayer febedee4f6 mesa: add EXT_dsa glGetVertexArray* 4 functions
The implementation doesn't share much with get.c because:
  * the refactoring needed for get.c to not depend on ctx->Array.VAO would
    be quite large
  * glGetVertexArray* would still need to filter pname to only accept the one
    specified by the spec
  * these functions are getter, the implementation is trivial (the complexity
    is in the correct filtering of pname input)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-05 13:58:28 +01:00
Pierre-Eric Pelloux-Prayer 5adeff8033 mesa: add EXT_dsa EnableVertexArrayAttribEXT / DisableVertexArrayAttribEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-05 13:58:28 +01:00
Pierre-Eric Pelloux-Prayer f793a8663d mesa: add EXT_dsa glEnableVertexArrayEXT / glDisableVertexArrayEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-05 13:58:28 +01:00
Pierre-Eric Pelloux-Prayer a26bb93943 mesa: add EXT_dsa glVertexArray* functions declarations
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-11-05 13:58:28 +01:00
Tapani Pälli 4f8c86e6a5 mesa: enable ARB_gpu_shader_int64 in compat profile
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-10-30 14:37:27 +02:00
Lepton Wu 1abf05764b mapi: Improve the x86 tsd stubs performance.
This skips touching %ebx most times and it shows that glGetString performance
increased from 114M/s to 120M/s on my desktop.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-29 20:50:05 -07:00
Lepton Wu 41407d5e9f mapi: Inline call x86_current_tls.
This saves one return and a simple benchmark which calls glGetString
repeatedly on my desktop shows it improves calls per second from 123M
to 141M.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1997
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-29 17:18:06 -07:00
Lepton Wu b2b8639d8e mapi: Clean up entry_patch_public for x86 tls
Remove hard coded 16 and use entry_generate_or_patch to patch
public stubs. The generated code actually is sightly tighter
than before since the "nop" instructions before the final "jmp"
get removed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-29 17:18:06 -07:00
Lepton Wu 1fb75bee90 mapi: split entry_generate_or_patch for x86 tls
The code works exactly the same with before. Just split this function
out so we can reuse it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-29 17:18:06 -07:00
Jonathan Gray 45206d7673 mapi: Adapted libglvnd x86 tsd changes
The x86 assembly language stub in src/mapi/entry_x86_tsd.h does not
generate PIC (position-independent code). This causes text relocations
which bring troubles on recent versions of FreeBSD, OpenBSD, Android.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108541
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
2019-10-29 17:13:14 -07:00
Jason Ekstrand e2bb7fef94 Revert "mapi: Inline call x86_current_tls."
This reverts commit e137b3a9b7.  It
completely broke 32-bit EGL such that wflinfo can't even run without
crashing.
2019-10-25 11:31:51 -05:00
Lepton Wu e137b3a9b7 mapi: Inline call x86_current_tls.
This saves one return and a simple benchmark which calls glGetString
repeatedly on my desktop shows it improves calls per second from 118M
to 128M.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-24 23:37:18 +00:00
Pierre-Eric Pelloux-Prayer 50533d408d mesa: add EXT_dsa NamedCopyBufferSubDataEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer da21435a7a mesa: add EXT_dsa NamedRenderbufferStorageMultisampleEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 2e14749f8f mesa: add EXT_dsa Generate*MipmapEXT functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer cfc0ebe7f1 mesa: add EXT_dsa glGetFloati_vEXT/glGetDoublei_vEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer a4e935f2d7 mesa: add EXT_dsa + EXT_gpu_program_parameters functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 78b65343e8 mesa: add EXT_dsa + EXT_gpu_shader4 functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer c2d6f61f26 mesa: add EXT_dsa + EXT_texture_integer functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 2bdf809e66 mesa: add EXT_dsa + EXT_texture_buffer_object functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 28cc07a876 mesa: add EXT_dsa glProgramUniform*EXT functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 1d1722e910 mesa: add EXT_dsa NamedProgram functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer eaeab0a998 mesa: add EXT_dsa glClientAttribDefaultEXT / glPushClientAttribDefaultEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Pierre-Eric Pelloux-Prayer 01666ad206 mesa: add EXT_dsa glNamedRenderbufferStorageEXT and glGetNamedRenderbufferParameterivEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-10-18 10:26:26 +02:00
Dylan Baker 63f5aee694 meson: maintain names of shared API libraries
Mesa uses the lib prefix, and doesn't use a version for it's dynamic
libraries, which meson defaults to.

v2: - this patch

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-10 16:33:04 -07:00
Dylan Baker 2e17348600 meson: Add windows defines to glapi
These are needed to control the export or symbols due to differences
between the way windows and *nix handle symbol exports.

Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>

v5: - key NO_EXPORT off of shared-glapi instead of gles
2019-10-10 16:33:04 -07:00
Eric Engestrom a0829cf23b GL: drop symbols mangling support
SCons and Meson have never supported that feature, and Autotools was
deleted over 6 months ago and no-one complained yet, so it's pretty
obvious nobody cares about it.

Fixes: 95aefc94a9 ("Delete autotools")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
2019-10-10 21:40:48 +01:00
Fritz Koenig 66937abe2b mesa: Allow MESA_framebuffer_flip_y for GLES 3
Implement glFramebufferParameteriMESA on GLES 3 so
that the extension is not dependant on GLES 3.1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-08 13:53:01 -07:00
Fritz Koenig 9fb76392de mesa: GetFramebufferParameteriv spelling
GetFramebufferParameteriv was incorrectly spelled as
GetFramebufferParameteri.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-10-08 13:53:01 -07:00
Dylan Baker fafd20f67d meson: fix logic for generating .pc files with old glvnd
We want to generate PC files for non-glvnd builds and for builds with
old glvnd, but the current logic doesn't do that, it builds them
unconditionally, and for GLES it builds the shared libraries, which is
also not what we want. This does not generate .pc files for gles1 or
gles2. Which it we weren't doing before either, making this not a
regression but a return to status-quo.o

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1838
Fixes: 93df862b6a
       ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-09-25 23:25:27 +00:00
Eric Engestrom 93df862b6a meson: re-add incorrect pkg-config files with GLVND for backward compatibility
This is a bit counter-intuitive, but the issue is that GLVND is broken
in versions <= 1.1.1, so we need to keep wrongly providing these files
to cover up their mistake, otherwise the rest of the world ends up
broken.

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-09-25 17:27:54 +01:00
Dylan Baker 9e1f49aae1 scons: Make scons and meson agree about path to glapi generated headers
Currently scons puts them in src/mapi/glapi, meosn puts them in
src/mapi/glapi/gen. This results in some things being compilable only by
one or the other, put them in the same places so that everyone is happy.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-09-16 17:54:00 +00:00
Heinrich Fink df8602f4b5 mesa/gl: Sync with Khronos registry
Update GL headers and xml API from upstream Khronos registry (commit
3d0c3eb). Keep `BUILDING_MESA` quirk in glext.h.

mesa/extensions: Expose EXT_EGL_sync instead of MESA_EGL_sync to reflect
Khronos request of changing this extension's scope from MESA to EXT.
EGL_EGL_sync is also the name of the extension that has been merged into
the upstream Khronos GL registry.

Remove MESA_EGL_sync spec txt from Mesa tree as it is now published as
EXT by Khronos.

v1: Remove MESA_EGL_sync spec and squash commits (Eric E)

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2019-09-16 16:50:43 +01:00
Adam Jackson ad9c1838e0 glx: Remove unused indirection for glx_context->fillImage
This slot is always filled in with __glFillImage.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-09-12 13:23:32 -04:00
Dylan Baker 2595b7c997 glapi: export glapi_destroy_multithread when building shared-glapi on windows
Which will allow meson to build a shared glapi build with mingw.

v2: - Add symbol to symbol check test

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-09-10 20:36:47 +00:00
Dylan Baker af444d84a3 meson: don't build glapi_static_check_table on windows
It doesn't compile due to undefined symbols, which are in
libglapi_static, so I don't understand the problem.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-09-10 20:36:47 +00:00
Heinrich Fink 17470c4aaa registry: update gl.xml with GL_MESA_EGL_sync token
As added by upstream GL registry changes

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-09-08 08:01:55 +00:00
Pierre-Eric Pelloux-Prayer 0f07d18e48 mesa: add ext_dsa GetMultiTexLevelParameterEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-19 18:50:08 -04:00
Pierre-Eric Pelloux-Prayer 1cb8e12717 mesa: add EXT_dsa glCompressedMultiTex* functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-19 18:50:05 -04:00
Pierre-Eric Pelloux-Prayer 8c76221886 mesa: add EXT_dsa glCompressedTexture(Sub)Image1D/2D/3D functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-19 18:49:57 -04:00
Pierre-Eric Pelloux-Prayer 5db28b0cf7 mesa: add EXT_shader_image_load_store glBindImageTextureEXT function
The implementation is almost identical to glBindImageTexture except for error
checking.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:40:53 -04:00
Pierre-Eric Pelloux-Prayer 71e619a825 glapi: add EXT_shader_image_load_store
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:40:52 -04:00
Pierre-Eric Pelloux-Prayer 0556932f4a mesa: add EXT_dsa glMultiTexCoordPointerEXT function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:22 -04:00
Pierre-Eric Pelloux-Prayer e364ddece3 mesa: add EXT_dsa glMultiTexGen* functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:21 -04:00
Pierre-Eric Pelloux-Prayer e8e0de6a8f mesa: add EXT_dsa glCopyMultiTexImage* and glCopyMultiTexSubImage*
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:19 -04:00
Pierre-Eric Pelloux-Prayer f28d9ab1a3 mesa: add EXT_dsa glGetMultiTexParameteriv/fvEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:18 -04:00
Pierre-Eric Pelloux-Prayer 989c375852 mesa: add EXT_dsa glMultiTexSubImage1D/2D/3DEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:16 -04:00
Pierre-Eric Pelloux-Prayer aac6578732 mesa: add EXT_dsa glMultiTexImage1D/2D/3DEXT + glGetMultiTexImageEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:15 -04:00
Pierre-Eric Pelloux-Prayer d9e26c3483 mesa: add EXT_dsa glMultiTexParameter* functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:12 -04:00
Pierre-Eric Pelloux-Prayer e04f95057f mesa: add EXT_dsa (Get)MultiTexEnv functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-08-06 17:03:10 -04:00
Bas Nieuwenhuizen 9f37c9903b mesa: Rename GLX_USE_TLS to USE_ELF_TLS.
These days it is not GLX only and it does not work with all TLS
implementations.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-08-03 20:18:17 +02:00
Pierre-Eric Pelloux-Prayer a0ac0e2653 mesa: add EXT_dsa indexed generic queries
Only GetPointerIndexedvEXT needs an implementation, the other functions are
aliases of existing functions.
2019-07-30 22:04:26 -04:00
Pierre-Eric Pelloux-Prayer ef84d93f3d mesa: add EXT_dsa indexed texture commands functions
Added functions:
  - EnableClientStateIndexedEXT
  - DisableClientStateIndexedEXT
  - EnableClientStateiEXT
  - DisableClientStateiEXT

Implemented using the idiom provided by the spec:

        if (array == TEXTURE_COORD_ARRAY) {
          int savedClientActiveTexture;

          GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture);
          ClientActiveTexture(TEXTURE0+index);
          XXX(array);
          ClientActiveTexture(savedActiveTexture);
        } else {
          // Invalid enum
        }
2019-07-30 22:04:26 -04:00
Pierre-Eric Pelloux-Prayer 7534c536ca mesa: add EXT_dsa (Named)Framebuffer functions
These functions dont support display list as specified:

    Should the selector-free versions of various OpenGL 3.0 and
    EXT_framebuffer_object framebuffer object commands not be allowed
    in display lists [...]?

    RESOLVED:  Yes
2019-07-30 22:04:26 -04:00
Pierre-Eric Pelloux-Prayer e26c6764f2 mesa: add EXT_dsa NamedBuffer functions 2019-07-30 22:04:26 -04:00
Heinrich Fink 4886924262 mesa: Enable GL_MESA_framebuffer_flip_y for GL 4.3
Extend MESA_framebuffer_flip_y to be used with OpenGL versions 4.3 and
higher. OpenGL 4.3 adds FramebufferParameteri needed by this extension.

Reviewed-by: Fritz Koenig <frkoenig@google.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-07-25 04:47:38 +00:00
Pierre-Eric Pelloux-Prayer ff0cafc8f3 mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-19 20:04:06 -04:00
Pierre-Eric Pelloux-Prayer 5fb9c9d628 mesa: add EXT_dsa gl(Copy)Texture(Sub)Image1D/2D/3DEXT functions
Added functions:
- glTextureImage1DEXT
- glTextureImage2DEXT
- glTextureImage3DEXT
- glTextureSubImage1DEXT
- glTextureSubImage3DEXT
- glCopyTextureImage1DEXT
- glCopyTextureImage2DEXT
- glCopyTextureSubImage1DEXT
- glCopyTextureSubImage2DEXT
- glCopyTextureSubImage3DEXT
- glGetTextureImageEXT

All but the last one can be compiled in a display list.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-07-19 20:04:03 -04:00
Alejandro Piñeiro a622aad869 spirv_extensions: add GL_ARB_spirv_extensions boilerplate
v2:
  * Mention extension gap at gl_API.xml (Emil Velikov)
  * Bail with INVALID_ENUM if extension not available on getStringi (Emil Velikov)
  * Use EXTRA_EXT macro when defining the extension at
    get.c/get_hash_params.py (Emil Velikov)
  * Rename source files (spirvextensions.[ch] -> spirv_extensions.[ch]) (Ian)

v3:
  * Fix GL_PROGRAM_BINARY_FORMATS glGet query, broken by error on a
    previous rebase

v4:
   * Fix rebase conflicts on getstring.c after
     GL_SHADING_LANGUAGE_VERSION query was added

v5:
   * Remove src/mapi/glapi/gen/Makefile.am as it no longer exists in
     master

Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com>

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2019-07-17 10:41:44 +02:00
Eric Engestrom b619f89e23 mapi: add shared glapi symbols check
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-07-10 11:27:51 +00:00
Eric Engestrom 6f305d0c61 gles: use new symbols check script
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-07-10 11:27:51 +00:00
Chih-Wei Huang bb75c73e96 android: fix typo LOCAL_EXPORT_C_INCLUDES
Should be LOCAL_EXPORT_C_INCLUDE_DIRS.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
2019-06-29 17:17:49 +02:00
Pierre-Eric Pelloux-Prayer 360ef82765 mesa: add glTextureParameteri/iv/f/fvEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:34 -04:00
Timothy Arceri 9c53a2ecb7 mesa: add support for glMapNamedBufferEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:24 -04:00
Timothy Arceri 76e25edf6a mesa: add support for glUnmapNamedBufferEXT()
Since the ARB DSA function glUnmapNamedBuffer() is only exposed
for 3.1 or above we make glUnmapNamedBuffer() an alias of
glUnmapNamedBufferEXT() rather than the other way around.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:21 -04:00
Timothy Arceri b5f930ea05 mesa: add support for glCompressedTextureSubImage2DEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:20 -04:00
Timothy Arceri b82b3d28d3 mesa: add support for glTextureSubImage2DEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:19 -04:00
Timothy Arceri cb0f25a926 mesa: add support for glMapNamedBufferRangeEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:16 -04:00
Timothy Arceri eec5c01b5e mesa: add support for glNamedBufferStorageEXT
This is available in ARB_buffer_storage when
EXT_direct_state_access is present.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:14 -04:00
Timothy Arceri 83ed9485b7 mesa: add support for glNamedBuffer*DataEXT()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:41:12 -04:00
Timothy Arceri 0972b0b059 mesa: add support for glBindMultiTextureEXT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-28 15:40:54 -04:00
Jory Pratt 10e8d46601 meson: Search for execinfo.h
Rather than checking __GLIBC__/__UCLIBC__ macros as a proxy for
execinfo.h presence, just check directly. This allows the build to work
on musl.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-06-19 12:16:18 -07:00
Emil Velikov a379b1c0ee mapi: correctly handle the full offset table
Earlier commit converted ES1 and ES2 to a new, much simpler, dispatch
generator. At the same time, GL/glapi and the driver side are still
using the old code.

There is a hidden ABI between GL*.so and glapi.so, former referencing
entry-points by offset in the _glapi_table. Hence earlier commit added
the full table of entry-points, alongside a marker for other cases like
indirect GL(X) and driver-size remapping.

Yet the patches did not handle things fully, thus it was possible to
get different interpretations of the dispatch table after the marker.

This commit fixes that adding an indicative error message to catch
future bugs.

While here correct the marker (MAX_OFFSETS) comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110302
Fixes: cf317bf093 ("mapi: add all _glapi_table entrypoints tostatic_data.py")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-06-10 14:04:30 +01:00
Emil Velikov 497de977bd mapi: add static_date offset to EXT_dsa
As elaborated in the next patch, there is some hidden ABI that
effectively require most entrypoints to be listed in the file.

Cc: Marek Olšák <marek.olsak@amd.com>
Fixes: d2906293c4 ("mesa: EXT_dsa add selectorless matrix stackfunctions")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-06-10 14:04:25 +01:00
Emil Velikov 61960547df mapi: add static_date offset to MaxShaderCompilerThreadsKHR
As elaborated in the next patch, there is some hidden ABI that
effectively require most entrypoints to be listed in the file.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110302
Cc: Marek Olšák <maraeo@gmail.com>
Fixes: c5c38e831e ("mesa: implement ARB/KHR_parallel_shader_compile")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-06-10 14:04:18 +01:00
Gert Wollny 10895c39c3 mesa/main: Expose EXT_clip_control and related enums and the function
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-06-06 12:25:17 +02:00
Gert Wollny f1f6228a38 mapi/glapi/registry: Update gl.xml to latest upstream version
The old copy didn't include EXT_clip_control, so update it.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-06-06 12:25:12 +02:00
Pierre-Eric Pelloux-Prayer d2906293c4 mesa: EXT_dsa add selectorless matrix stack functions
Allows the legacy matrix stacks to be manipulated without disturbing the
matrix mode selector.

Adapted from a patch from Chris Forbes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-06-03 15:28:51 -04:00
Timothy Arceri b69584ad69 mesa: add new EXT_direct_state_access tokens
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-06-03 15:28:47 -04:00
Chris Forbes 028682f7f4 glapi: add EXT_direct_state_access
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-06-03 15:28:45 -04:00
Dylan Baker ff9bf223c2 meson: make nm binary optional
This makes nm not required, but used if found. In general I imagine that
this means that on windows nm wont be found, and on other platforms it
will.

v2: - fix gbm and egl symbols check tests to only be run if nm is found
    - reword commit message to reflect the code change

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:58:05 -07:00
Dylan Baker f1d5f2aff3 meson: always define libglapi
This allows the identifier to be used even if shared-glapi isn't build,
which simplifies a bunch of things.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-05-03 10:57:10 -07:00
Ross Burton 1c1efa4ca9 Revert "meson: drop GLESv1 .so version back to 1.0.0"
This patch claimed that the autotools build generates libGLESv1_CM.so.1.0.0, but
it doesn't:

es1api_libGLESv1_CM_la_LDFLAGS = \
        -no-undefined \
        -version-number 1:1 \
        $(GC_SECTIONS) \
        $(LD_NO_UNDEFINED)

Revert commit cc15460e18 to ensure that the
autotools and meson builds produce the same libraries.

Fixes: cc15460e18 "meson: drop GLESv1 .so version back to 1.0.0"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 13:49:20 +01:00
Eric Engestrom 1587586182 delete autotools input files
Leftovers from when autotools was deleted.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-29 21:17:19 +00:00
Eric Engestrom 7ca8ba199f delete autotools .gitignore files
One special case, `src/util/xmlpool/.gitignore` is not entirely deleted,
as `xmlpool.pot` still gets generated (eg. by `ninja xmlpool-pot`).

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-29 21:17:19 +00:00
Marek Olšák 1faf833949 mesa: enable glGet for EXT_gpu_shader4
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-04-24 20:45:15 -04:00
Jonathan Marek 73c1d7e8c9 mesa: add GL_AMD_compressed_ATC_texture support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-04-23 17:11:56 +00:00
Dylan Baker 95aefc94a9 Delete autotools
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Matt Turner <mattst88@gmail.com>
2019-04-15 13:44:29 -07:00
Marek Olšák c5c38e831e mesa: implement ARB/KHR_parallel_shader_compile
Tested by piglit.
2019-04-01 12:37:52 -04:00
Benjamin Gordon b30aad552c configure.ac/meson.build: Add options for library suffixes
When building the Chrome OS Android container, we need to build copies
of mesa that don't conflict with the Android system-supplied libraries.
This adds options to create suffixed versions of EGL and GLES libraries:

libEGL.so -> libEGL${egl-lib-suffix}.so
libGLESv1_CM.so -> libGLESv1_CM${gles-lib-suffix}.so
libGLESv2.so -> libGLES${gles-lib-suffix}.so

This is similar to what happens when --enable-libglvnd is specified, but
without the side effects of linking against libglvnd.  To avoid
unexpected clashes with the suffixed appended by libglvnd, make it an
error to specify both --enable-libglvnd and --with-egl-lib-suffix.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-21 10:18:31 -07:00
Eric Engestrom 9cf85d3b78 autotools: don't build libGLES*.so with GLVND
GLVND already provides these, so distro packagers have been deleting
them all along. Let's save ourselves the trouble and not build them in
the first place.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-03-08 15:13:36 +00:00
Eric Engestrom b01524fff0 meson: don't build libGLES*.so with GLVND
GLVND already provides these, so distro packagers have been deleting
them all along. Let's save ourselves the trouble and not build them in
the first place.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-03-08 15:13:36 +00:00
Konstantin Kharlamov fccc9d3de6 mapi: work around GCC LTO dropping assembly-defined functions
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109391

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-02-13 14:20:51 +00:00
Erik Faye-Lund 3b6f95ad66 mesa: expose NV_conditional_render on GLES
The extension spec has been updated to include GLES 2 support, so let's
enable it there.

v2: fixup ABI-check as well

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2019-01-30 09:43:44 +01:00
Emil Velikov 3b6aaab7e9 mapi: print function declarations for shared glapi
Earlier commit aimed to remove unneeded function declarations. Namely
OpenGL entrypoints which are not applicable for OpenGLES*

Although it did not consider the shared glapi which needs all,
including hidden ones. Resulting in warning/errors like the following

../build/src/mapi/shared-glapi/glapi_mapi_tmp.h:26014:15:
error: no previous prototype for ‘shared_dispatch_stub_1414’ [-Werror=missing-prototypes]

This patch addressed that.

Cc: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reported-by: Eric Anholt <eric@anholt.net>
Fixes: 6148cce388 ("mapi: drop unneeded gl_dispatch_stub declarations")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2019-01-25 13:04:04 -08:00
Emil Velikov 281421e1bc mapi: remove machinery handling CSV files
We haven't have one in years, so just drop the code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 8a0012692a mapi: remove old, unused ES* generator code
As of earlier commit, everyone has switched to the new script for the ES
dispatch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov a41214ca3e mapi/es2api: remove no longer present entrypoints
With the previous scripts API from the following was incorrectly
exported. Drop them from the list, since they're no longer around.

GL_EXT_blend_func_extended
GL_EXT_texture_integer

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 05f8558b27 mapi/es*api: remove GL_EXT_multi_draw_arrays entrypoints
Now we use the upstream XML file and a cleaner generator. Thus the
symbols are no longer exported and we can drop them from this list.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 5661ce6c64 mapi/es*api: remove GL_OES_EGL_image entrypoints
As some point in the past we fixed the scripts so, these are no longer
exported. Drop them from the list.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 9f86f1da7c Revert "mapi/new: sort by slot number"
This reverts commit a1f5d9412cf7cacb3534635f6c2409fafbe6574e.

We no longer needed to sort - it was meant only to ease compare against
the old generated files.
2019-01-24 18:13:25 +00:00
Emil Velikov 3bf08292d2 scons: wire the new generator for es1 and es2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 0842bc879b meson: wire the new generator for es1 and es2
v2: use ${foo})_py naming (Dylan)
v3: use symbolic name for genCommon.py

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v2)
2019-01-24 18:13:25 +00:00
Emil Velikov 656845301d autotools: wire the new generator for es1 and es2
The output produced functionally identical, with the following changes:
 - A cosmetic: swapped ABI compatible types [ GLclampf -> GLfloat, etc ]
 - B cosmetic: renamed parameters [ zNear -> n, etc ]
 - C dropped extension entrypoints - invalid/incorrect

To make things easier to validate, normalise both old/new headers run
the sed patterns A, B and C to both sets.

A
      s/\<GLclampf\>/GLfloat/g; s/\<GLclampx\>/GLfixed/g;
      s/\<GLvoid\>/void/g;

B
      s/\ \* / */g; s/\<texture\>/target/g;
      s/\<plane\>/p/g; s/\<depth\>/d/g; s/\<modeAlpha\>/modeA/g;
      s/\<shader\>/program/g; s/\<obj\>/shaders/g; s/\<equation\>/eqn/g;
      s/\<param\>/data/g; s/\<params\>/data/g; s/\<buffers\>/buffer/g;
      s/\<src\>/mode/g; s/\<count\>/n/g; s/\<zNear\>/n/g; s/\<zFar\>/f/g;
      s/\<zfail\>/dpfail/g; s/\<zpass\>/dppass/g; s/\<buf\>/index/g;
      s/\<value\>/target/g; s/\<cap\>/target/g; s/\<maskNumber\>/index/g;
      s/\<srcRGB\>/sfactorRGB/g; s/\<dstRGB\>/dfactorRGB/g;
      s/\<srcAlpha\>/sfactorAlpha/g; s/\<dstAlpha\>/dfactorAlpha/g;
      s/\<primitiveMode\>/mode/g; s/\<primcount\>/instancecount/g;
      s/\<top\>/t/g; s/\<bottom\>/b/g; s/\<left\>/l/g; s/\<right\>/r/g;
      s/\<x\>/v0/g; s/\<y\>/v1/g; s/\<z\>/v2/g; s/\<w\>/v3/g;
      s/\<sfactor\>/mode/g; s/\<dfactor\>/dst/g; s/\<attribindex\>/bindingindex/g;
      s/\<internalFormat\>/internalformat/g; s/\<bufSize\>/bufsize/g;

C
glMultiDrawArraysEXT
glMultiDrawElementsEXT

glBindFragDataLocationEXT

glGetTexParameterIivEXT
glGetTexParameterIuivEXT
glTexParameterIivEXT
glTexParameterIuivEXT

v2:
 - gl_dispatch_stub declarations are addressed with previous patch
 - the public_entries table is no longer generated

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 389bc2bc6e mapi/new: remove duplicate GLvoid/void substitution
We already do it a few lines above - drop the duplicate.

Note that for consistency sake, we keep the substitution since the GL
API is a mixed bad - some use GLvoid while others a normal void.

We might want to merge this back in GLVND.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 5fa6c34949 mapi/new: fixup the GLDEBUGPROCKHR typedef to the non KHR one
This way we can reuse the latter, which is already present in the
headers that we use. Thus we can drop the manual typedef we generate.

We might want to merge this back in GLVND.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov babec55f7e mapi/new: don't print info we don't need for ES1/ES2
There is no need for the noop functions, the public_stubs and
public_entries table or table size defines. Remove those.

Pretty much all of this is applicable to GLVND, although it
requires preparatory work.

v2:
 - python style fixes (Dylan)
 - use "gldispatch" instead of not "glesv1" "glesv2"
 - remove the public_entries table/array (Erik)

v3:
 - use if == "gldispatch", instead of "in" (Kyle)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v2)
2019-01-24 18:13:25 +00:00
Emil Velikov 5b1bdce156 mapi/new: split out public_entries handling
The only instance that requires the public_entries table is the
dispatch library - split that into another function.

We have to be careful with when undefining the guard, so split it out.

We might want to merge this back in GLVND.
Minor GLVND cleanup will be needed first.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 313f977224 mapi/new: reinstate _NO_HIDDEN suffixes in the new generator
Strictly speaking we can rework the rest of the code so we do not need
those. That said, this will require a series on it's own so let's carry
this local quirk for now.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 451805f810 mapi/new: use the static_data offsets in the new generator
Otherwise the incorrect ones will be used, effectively breaking the ABI.

Note: some entries in static_data.py list a suffixed API, while (for ES*
at least) we expect the one w/o suffix.

v2:
 - rework path handling (Dylan)
 - use else if chain (Erik)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov bba375c016 mapi/new: sort by slot number
Makes it easier to compare the newly generated header against the old
one. Will be reverted after the transition.
2019-01-24 18:13:25 +00:00
Emil Velikov 06eb3fe371 mapi/new: import mapi scripts from glvnd
Currently we have over 20 scripts that generate the libGL* dispatch and
various other functionality. More importantly we're using local XML
files instead of the Khronos provides one(s). Resulting in an
increasing complexity of writing, maintaining and bugfixing.

One fairly annoying bug is handling of statically exported symbols.
Today, if we enable a GL extension for GLES1/2, we add a special tag to
the xml. Thus the ES dispatch gets generated, but also since we have no
separate notion of GL/ES1/ES2 static functions it also gets exported
statically.

This commit adds step one towards clearing and simplifying our setup.
It imports the mapi generator from GLVND.

  012fe39 ("Remove a couple of duplicate typedefs.")

v2: use local genCommon.py

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov cd0f11bac5 mapi: move genCommon.py to src/mapi/new
The helper will also be used by the new Khronos gl.xml aware generator.

v2: Move existing one, instead of duplicating it.
v3: Correct genCommon.py references in meson [Erik]
v4: Drop the file from the EGL EXTRA_DIST [Erik]

Suggested-by: Kyle Brenneman <kbrenneman@nvidia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov cf317bf093 mapi: add all _glapi_table entrypoints to static_data.py
Currently various parts of mesa use the glapi_table differently.

Some use _glapi_get_proc_offset() to get the offset, while others
directly reference the specific offset via _gloffset_Function.

Add all static entries, to ensure things don't break as we flip to the
upstream XML + new mapi generator.

Note: the offsets are also used for the alias remap table, thus we need
to ensure we honour the correct offsets range or it will break.

Currently this is done via MAX_OFFSETS constant, although a better
solution is in the works.

v2: add FramebufferTexture2DMultisampleEXT
v3: add MAX_OFFSETS guard

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2019-01-24 18:13:25 +00:00
Emil Velikov fe9f5c0e21 mapi: sort static entrypoints numerically
A few of the entrypoints were incorrectly placed. Sort those to align
with the rest of the list.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Emil Velikov 5a81e8d40e Revert "mesa/main: remove ARB suffix from glGetnTexImage"
This reverts commit f1998e15ff.

This changes the ABI, such that glGetnTexImageARB entry-point from the
GLAPI gets removed. Thus accessing many functions by offset (as we do)
will result in getting the wrong one.

Follow-up work will swap the by-offset handling, but for now revert
this patch.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:25 +00:00
Erik Faye-Lund 6148cce388 mapi: drop unneeded gl_dispatch_stub declarations
These declarations are not used anywhere - be that generated code or
otherwise.

[Emil: format the hunk from Erik into a patch]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2019-01-24 18:13:24 +00:00
Emil Velikov ca152234e1 mesa: correctly use os.path.join in our python scripts
With Windows in mind, using forward slash isn't the right thing to do.
Even if it just works, we might want to fix it.

As here, use __file__ instead of argv[0] and sys.path.insert over
sys.path.append. With the path tweak being reportedly faster.

Suggested-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-01-24 18:13:24 +00:00
Kristian H. Kristensen c0de7c21a3 glapi: fixup EXT_multisampled_render_to_texture dispatch
There's a few missing and convoluted bits:

 - FramebufferTexture2DMultisampleEXT
Missing sanity check, should be desktop="false"

 - RenderbufferStorageMultisampleEXT
Missing sanity check, is aliased to RenderbufferStorageMultisample.
Thus it's set only when desktop GL or GLES2 v3.0+, while the extension
is GLES2 2.0+.

If we flip the aliasing we'll break indirect GLX, so loosen the version
to 2.0. Not perfect, yet this is the most sane thing I could think of.

v2: [Emil] Fixup RenderbufferStorageMultisampleEXT, commmit message

Cc: Kristian H. Kristensen <hoegsberg@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108974
Fixes: 1b331ae505 ("mesa: Add core support for EXT_multisampled_render_to_texture{,2}")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-12-10 15:09:07 -08:00
Kristian H. Kristensen 1b331ae505 mesa: Add core support for EXT_multisampled_render_to_texture{,2}
This also turns on EXT_multisampled_render_to_texture which is a
subset of EXT_multisampled_render_to_texture2, allowing only
COLOR_ATTACHMENT0.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2018-12-06 16:55:30 -08:00
Marek Olšák 4b218984d8 mesa: expose GL_EXT_texture_view as an alias of GL_OES_texture_view
There are no spec changes.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2018-12-04 12:50:36 -05:00
Erik Faye-Lund f1998e15ff mesa/main: remove ARB suffix from glGetnTexImage
This function has been core since OpenGL 4.3, so naming the
implementation and reporting erros using an ARB-suffix can be
confusing.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
2018-11-26 12:29:54 +01:00
Eric Engestrom 896c59d690 glapi: add missing visibility args
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108829
Fixes: 3218056e0e "meson: Build i965 and dri stack"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-11-22 18:21:05 +00:00
Marek Olšák 7f1cac7ba6 mesa/glthread: enable immediate mode
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2018-11-20 21:17:41 -05:00
Marek Olšák 247d5a8e94 mesa/glthread: pass the function name to _mesa_glthread_restore_dispatch
If you insert printf there, you'll know why glthread was disabled.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2018-11-20 21:17:38 -05:00
Dylan Baker a999798daa meson: Add tests to suites
Meson test has a concepts of suites, which allow tests to be grouped
together. This allows for a subtest of tests to be run only (say only
the tests for nir). A test can be added to more than one suite, but for
the most part I've only added a test to a single suite, though I've
added a compiler group that includes nir, glsl, and glcpp tests.

To use this you'll need to invoke meson test directly, instead of ninja
test (which always runs all targets). it can be invoked as:
`meson test -C builddir --suite $suitename` (meson test has addition
options that are pretty useful).

Tested-By: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-11-20 09:09:22 -08:00
Erik Faye-Lund b55af392d9 Revert "mesa: expose NV_conditional_render on GLES"
This reverts commit 5213be9fab.
2018-11-09 17:39:25 +01:00
Erik Faye-Lund cf8b271cbe Revert "mesa/main: fixup make check after NV_conditional_render for gles"
This reverts commit cccd7a253f.
2018-11-09 17:39:22 +01:00
Erik Faye-Lund cccd7a253f mesa/main: fixup make check after NV_conditional_render for gles
It seems I missed some details when exposing NV_conditional_render
on GLES; this fixes up "make check".

Fixes: 5213be9fab ("mesa: expose NV_conditional_render on GLES")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-and-Tested-by: Eric Engestrom <eric.engestrom@intel.com>
2018-11-09 16:47:34 +01:00
Erik Faye-Lund 5213be9fab mesa: expose NV_conditional_render on GLES
The extension spec has been updated to include GLES 2 support, so let's
enable it there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-11-09 13:03:00 +01:00
Mathias Fröhlich f726c61cc1 mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.c
The array type draw is no longer directly dependent on the vbo module.
Thus move array type draws into mesa/main/draw.c.
Rename symbols starting with vbo_* to _mesa_* and apply some
reindenting to make it consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2018-11-01 06:08:49 +01:00
Emil Velikov 986033a275 configure: allow building with python3
Pretty much all of the scripts are python2+3 compatible.
Check and allow using python3, while adjusting the PYTHON2 refs.

Note:
 - python3.4 is used as it's the earliest supported version
 - python2 chosen prior to python3

v2: use python2 by default

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-10-31 19:15:50 +00:00
Dylan Baker 3d261cf77b gen: Add AMD_gpu_shader_int64.xml to tarball
CC: Ian Romanick <ian.d.romanick@intel.com>
CC: Marek Olšák <marek.olsak@amd.com>
Fixes: b3c17330e6
       ("mesa: expose AMD_gpu_shader_int64")
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
2018-10-24 11:29:30 -07:00
Dylan Baker 6d5fa65c74 gen: Add EXT_vertex_attrib_64bit.xml to dependency lists
Which is also required to put it in the tarball, a requirement for
building with meson from the tarball.

CC: Ian Romanick <ian.d.romanick@intel.com>
CC: Marek Olšák <marek.olsak@amd.com>
Fixes: 263c962cfd
       ("mesa: expose EXT_vertex_attrib_64bit")
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
2018-10-24 11:29:29 -07:00
Jose Fonseca 45bacc4b63 scons: Remove gles option.
It's broken, and WGL state tracker is always built with GLES support
noawadays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2018-10-19 16:50:26 +01:00
Dylan Baker 0fa6a8271a meson: only build clapi tests when OpenGL is being built
Otherwise building just vulkan (among other things) will build these
tests, pull in a bunch of stuff they shouldn't, and potentially fail to
compile.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-10-09 08:55:48 -07:00
Timothy Arceri b54a2311a9 mesa: enable EXT_framebuffer_object in core profile
Since user defined names are not allowed in core profile
we remove the allow_user_names bool and just check if
we have a core profile like all other buffer/texture
object handling code does.

This extension is required by "Wolfenstein: The Old Blood"
and is exposed in core in the Nvidia binary driver.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-09-18 19:58:24 +10:00
Timothy Arceri 781a78914c mesa: enable ARB_direct_state_access in compat for GL3.1+
We could enable it for lower versions of GL but this allows us
to just use the existing version/extension checks that are already
used by the core profile.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-08-30 07:57:38 +10:00
Sagar Ghuge f663fb5487 glapi: define AMD_depth_clamp_separate
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-08-28 12:57:27 -07:00
Emil Velikov cff80b6c15 Revert "configure: allow building with python3"
This reverts commit ae7898dfdb.

Turns out the python scripts are _not_ fully python 3 compatible.
As Ilia reported using get_xmlpool.py with LANG=C produces some weird
output - see the link for details.

Even though the issue was spotted with the autoconf build, it exposes a
genuine problem with the script (and lack of lang handling of the meson
build.)

https://lists.freedesktop.org/archives/mesa-dev/2018-August/203508.html
2018-08-24 11:14:15 +01:00
Marek Olšák 263c962cfd mesa: expose EXT_vertex_attrib_64bit
because the closed driver exposes it.
It's the same as the ARB extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-08-24 00:36:18 -04:00
Marek Olšák 056b9a5a36 mesa: expose AMD_multi_draw_indirect
because the closed driver exposes it.
This is equivalent to the ARB extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-08-24 00:36:18 -04:00
Marek Olšák b3c17330e6 mesa: expose AMD_gpu_shader_int64
because the closed driver exposes it.

It's equivalent to ARB_gpu_shader_int64.
In this patch, I did everything the same as we do for ARB_gpu_shader_int64.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-08-24 00:36:18 -04:00
Marek Olšák 37eee90df7 glapi: actually implement GL_EXT_robustness for GLES
The extension was exposed but not the functions.

This fixes:
    dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.readn_pixels
    dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformfv
    dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformiv

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2018-08-23 16:54:30 -04:00
Emil Velikov ae7898dfdb configure: allow building with python3
Pretty much all of the scripts are python2+3 compatible.
Check and allow using python3, while adjusting the PYTHON2 refs.

Note:
 - python3.4 is used as it's the earliest supported version
 - python3 chosen prior to python2

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-08-23 17:00:13 +01:00
Mathieu Bridon 2ee1c86d71 meson: Build with Python 3
Now that all the build scripts are compatible with both Python 2 and 3,
we can flip the switch and tell Meson to use the latter.

Since Meson already depends on Python 3 anyway, this means we don't need
two different Python stacks to build Mesa.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-08-10 15:15:09 -07:00
Mathieu Bridon 08fe9b3e3a python: Simplify list sorting
Instead of copying the list, then sorting the copy in-place, we can just
get a new sorted copy directly.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-08-09 16:49:19 -07:00
Mathieu Bridon 8d3ff6244c python: Use key-functions when sorting containers
In Python 2, the traditional way to sort containers was to use a
comparison function (which returned either -1, 0 or 1 when passed two
objects) and pass that as the "cmp" argument to the container's sort()
method.

Python 2.4 introduced key-functions, which instead only operate on a
given item, and return a sorting key for this item.

In general, this runs faster, because the cmp-function has to get run
multiple times for each item of the container.

Python 3 removed the cmp-function, enforcing usage of key-functions
instead.

This change makes the script compatible with Python 2 and Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-08-09 16:49:19 -07:00
Mathieu Bridon e1b88aee68 python: Fix rich comparisons
Python 3 doesn't call objects __cmp__() methods any more to compare
them. Instead, it requires implementing the rich comparison methods
explicitly: __eq__(), __ne(), __lt__(), __le__(), __gt__() and __ge__().

Fortunately Python 2 also supports those.

This commit only implements the comparison methods which are actually
used by the build scripts.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-08-07 13:10:34 -07:00
Mathieu Bridon 9b6746b7c0 python: Use explicit integer divisions
In Python 2, divisions of integers return an integer:

    >>> 32 / 4
    8

In Python 3 though, they return floats:

    >>> 32 / 4
    8.0

However, Python 3 has an explicit integer division operator:

    >>> 32 // 4
    8

That operator exists on Python >= 2.2, so let's use it everywhere to
make the scripts compatible with both Python 2 and 3.

In addition, using __future__.division tells Python 2 to behave the same
way as Python 3, which helps ensure the scripts produce the same output
in both versions of Python.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v2)
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-08-07 13:07:44 -07:00
Ian Romanick b7946f6778 glapi: Fix GLES versioning for AMD_framebuffer_multisample_advanced functions
The GL_AMD_framebuffer_multisample_advanced spec says:

    OpenGL ES dependencies:

        Requires OpenGL ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107483
Fixes: 3d6900d76e ("glapi: define AMD_framebuffer_multisample_advanced and add its functions")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: Vinson Lee <vlee@freedesktop.org>
2018-08-06 10:30:06 -07:00
Marek Olšák 3d6900d76e glapi: define AMD_framebuffer_multisample_advanced and add its functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2018-08-04 02:46:55 -04:00
Fritz Koenig 318c265160 mesa: GL_MESA_framebuffer_flip_y extension [v4]
Adds an extension to glFramebufferParameteri
that will specify if the framebuffer is vertically
flipped. Historically system framebuffers are
vertically flipped and user framebuffers are not.
Checking to see the state was done by looking at
the name field.  This adds an explicit field.

v2:
  * updated spec language [for chadv]
  * correctly specifying ES 3.1 [for chadv]
  * refactor access to rb->Name [for jason]
  * handle GetFramebufferParameteriv [for chadv]
v3:
  * correct _mesa_GetMultisamplefv [for kusmabite]
v4:
  * update spec language [for chadv]
  * s/GLboolean/bool/g [for chadv]
  * s/InvertedY/FlipY/g [for chadv]
  * s/inverted_y/flip_y/g [for chadv]
  * assert changes [for chadv]

Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-07-27 12:32:25 -07:00
Mathieu Bridon 9ebd8372b9 python: Use range() instead of xrange()
Python 2 has a range() function which returns a list, and an xrange()
one which returns an iterator.

Python 3 lost the function returning a list, and renamed the function
returning an iterator as range().

As a result, using range() makes the scripts compatible with both Python
versions 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-07-24 11:07:04 -07:00
Mathieu Bridon 022d2a381d python: Better use iterators
In Python 2, iterators had a .next() method.

In Python 3, instead they have a .__next__() method, which is
automatically called by the next() builtin.

In addition, it is better to use the iter() builtin to create an
iterator, rather than calling its __iter__() method.

These were also introduced in Python 2.6, so using it makes the script
compatible with Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-24 11:07:04 -07:00
Mathieu Bridon 01da2feb0e python: Better sort dictionary keys/values
In Python 2, dict.keys() and dict.values() both return a list, which can
be sorted in two ways:

* l.sort() modifies the list in-place;
* sorted(l) returns a new, sorted list;

In Python 3, dict.keys() and dict.values() do not return lists any more,
but iterators. Iterators do not have a .sort() method.

This commit moves the build scripts to using sorted() on dict keys and
values, which makes them compatible with both Python 2 and Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-07-24 11:07:04 -07:00
Mathieu Bridon 5530cb1296 python: Better iterate over dictionaries
In Python 2, dictionaries have 2 sets of methods to iterate over their
keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems().

The former return lists while the latter return iterators.

Python 3 dropped the method which return lists, and renamed the methods
returning iterators to keys()/values()/items().

Using those names makes the scripts compatible with both Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-24 11:07:04 -07:00
Mathieu Bridon fdf946ffbf python: Stop using the string module
Most functions in the builtin string module also exist as methods of
string objects.

Since the functions were removed from the string module in Python 3,
using the instance methods directly makes the code compatible with both
Python 2 and Python 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-24 11:07:04 -07:00
Mathieu Bridon 1d209275c2 python: Better check for keys in dicts
Python 3 lost the dict.has_key() method. Instead it requires using the
"in" operator.

This is also compatible with Python 2.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-07-24 11:07:04 -07:00
Eric Anholt 70534dbe29 Allow AMD_perfmon on GLES contexts
v2: whitespace alignment fix

Reviewed-by: Rob Clark <robdclark@gmail.com>
2018-07-18 10:39:21 -07:00
Mathieu Bridon b39bdb0716 python: Stop using the Python 2 exception syntax
We could have made this compatible with Python 3 by using:

    except Exception as e:

But since none of this code actually uses the exception objects, let's
just drop them entirely.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-07-06 10:18:43 -07:00
Mathieu Bridon e5a8d51e54 python: Use spaces, not tabs
Python 3 doesn't allow mixing spaces and tabs in a script, contrarily to
Python 2.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-06 10:04:55 -07: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
Mathieu Bridon fe8a153648 python: Stabilize some script outputs
In Python, dictionaries and sets are unordered, and as a result their
is no guarantee that running this script twice will produce the same
output.

Using ordered dicts and explicitly sorting items makes the build more
reproducible, and will make it possible to verify that we're not
breaking anything when we move the build scripts to Python 3.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-07-05 12:52:12 +01:00
Timothy Arceri 0cb6537dee mesa: enable ARB_direct_state_access in OpenGL 4.5 compat profile
Its unlikely anyone will add proper ARB_direct_state_access compat
support before we branch 18.2. Enabling the extension in 4.5 at
least allows users to make use of MESA_GL_VERSION_OVERRIDE=4.5COMPAT
for games like No Mans Sky.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-07-05 13:15:34 +10:00